One binary horn clause is enough

  • Philippe Devienne
  • Patrick Lebègue
  • Jean-Christophe Routier
  • Jörg Würtz
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 775)


This paper proposes an equivalent form of the famous Böhm-Jacopini theorem for declarative languages. C. Böhm and G. Jacopini [1] proved that all programming can be done with at most one single whiledo. That result is cited as a mathematical justification for structured programming. A similar result can be shown for declarative programming. Indeed the simplest class of recursive programs in Horn clause languages can be defined by the following scheme:

$$\left\{ {\begin{array}{*{20}c}{\mathcal{A}_1 \leftarrow .} \\{\mathcal{A}_2 \leftarrow } \\{ \leftarrow \mathcal{A}_4 } \\\end{array} } \right.\mathcal{A}_3 . that is \forall x_1 \cdot \cdot \cdot \forall x_m \left[ {\mathcal{A}_1 \wedge \left( {\mathcal{A}_2 \vee \neg \mathcal{A}_3 } \right) \wedge \neg \mathcal{A}_4 } \right]$$
are positive first-order literals. This class is shown here to be as expressive as Turing machines and all simpler classes would be trivial. The proof is based on a remarkable and not enough known codification of any computable function by unpredictable iterations proposed by [5]. Then, we prove effectively by logical transformations that all conjunctive formulas of Horn clauses can be translated into an equivalent conjuctive 4-formula (as above). Some consequences are presented in several contexts (mathematical logic, unification modulo a set of axioms, compilation techniques and other program patterns).


Logic in Computer Science Theory of Programming Languages 


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Böhm C., Jacopini G. “Flow diagrams, Turing machines and languages with only two formation rules.” Communications of the Association for Computing Machinery, Vol. 9, pp. 366–371. 1966.Google Scholar
  2. 2.
    Bouquard J.L. “Logic programming and Attribute grammars.” Ph.D. Thesis, Orléans 1992.Google Scholar
  3. 3.
    Bratko I. “Prolog Programming for Artificial Intelligence”. Addison-Wesley Publishers limited. 1986.Google Scholar
  4. 4.
    William F. Clocksin and Christopher S. Mellish, “Programming in Prolog”. Springer-Verlag. 1981.Google Scholar
  5. 5.
    Conway J.H. “Unpredictable Iterations.” Proc. 1972 Number Theory Conference. University of Colorado, pp 49–52. 1972.Google Scholar
  6. 6.
    Clark K.L., Tärnlund S.A. “A First Order Theory of Data and Programs.” in Proc. IFIP 77. pp. 939–944. 1977.Google Scholar
  7. 7.
    Dauchet M. “Simulation of Turing Machines by a regular rewrite rule.” Journal of Theoretical Computer Science. nℴ103. 409–420. 1992.Google Scholar
  8. 8.
    Devienne P., Lebègue P., Routier J.C. “Halting Problem of One Binary Horn Clause is Undecidable.” Proceedings of STACS'93, LNCS nℴ665, pp. 48–57, Springer-Verlag. Würzburg. February 1993.Google Scholar
  9. 9.
    Devienne P., Lebègue P., Routier J.C. “The Emptiness Problem of One Binary Recursive Horn Clause is Undecidable.” In proceedings of ILPS'93, Vancouver. MIT Press. pp 250–265. October 1993.Google Scholar
  10. 10.
    Goldfarb W. and Lewis H.R. “The decision problem for formulas with a small number of atomic subformulas” J. Symbolic Logic 38(3), pp. 471–480, 1973.Google Scholar
  11. 11.
    Guy R.K. “ Conway's Prime Producing Machine.” Mathematics Magazine. nℴ56. 26–33. 1983.Google Scholar
  12. 12.
    Hanschke P., Würtz J. “Satisfiability of the Smallest Binary Program.” Information Processing Letters, vol. 45, nℴ5. pp. 237–241. April 1993.Google Scholar
  13. 13.
    Harel D. “On folk theorems” CACM, vol. 23, nℴ7. pp. 379–389. 1980.Google Scholar
  14. 14.
    Kowalski R. A. “Logic for Problem Solving.” North Holland. New York. 1979.Google Scholar
  15. 15.
    Marcinkowski J., Leszek Pacholski “Undecidability of the Horn-Clause Implication Problem” Proc. of the 33rd FOCS. 1992.Google Scholar
  16. 16.
    Minsky M. “Computation: Finite and Infinite Machines.” Prentice-Hall. 1967.Google Scholar
  17. 17.
    Parrain A., Devienne P., Lebègue P. “Prolog programs transformations and Meta-Interpreters.” Logic program synthesis and transformation, Springer-Verlag, LOPSTR'91, Manchester. 1991.Google Scholar
  18. 18.
    Robinson J. A. “A Machine-oriented Logic Based on the Resolution Principle.” J. ACM nℴ 12, pp. 23–45. Januar 1965.Google Scholar
  19. 19.
    Schmidt-Schauss M. “Implication of clauses is undecidable.” Journal of Theoretical Computer Science, nℴ59, pp. 287–296. 1988.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1994

Authors and Affiliations

  • Philippe Devienne
    • 1
  • Patrick Lebègue
    • 1
  • Jean-Christophe Routier
    • 1
  • Jörg Würtz
    • 2
  1. 1.Laboratoire d'Informatique Fondamentale de Lille - CNRS UA 369Université des Sciences et Technologies de Lille Cité ScientifiqueVilleneuve d'Ascq CedexFrance
  2. 2.Deutsches Forschungszentrum für Künstliche Intelligenz - DFKISaarbrücken 11Germany

Personalised recommendations