Skip to main content

A Better Logical Semantics for Prolog

  • Chapter
  • First Online:
Prolog: The Next 50 Years

Part of the book series: Lecture Notes in Computer Science ((LNAI,volume 13900))

Abstract

This paper describes a semantics for the language of pure positive Prolog programs that improves on the widely accepted Least Herbrand Model (LHM) semantics. The LHM semantics gives meaning only to complete Prolog programs, and not to components of programs. Yet programmers clearly understand the meaning of a predicate even if not all predicates used in its definition are defined in the program. For example, programmers understand the meaning of the two rules defining transitive closure without having to know the specific graph that it applies to. A semantics for the Prolog language should also provide such a meaning. We motivate the meaning of Prolog rules as inductive definitions by starting with Clark’s completion, analyzing its limitations, and then describing how it can be modified to yield a logical theory of inductive definitions.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 64.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 84.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    Also available at: https://people.cs.kuleuven.be/~marc.denecker/A-PDF/Prolog50.pdf.

  2. 2.

    The form of the not operator in most Prologs is \(\mathtt{\backslash +}\), which is intended to approximate in ASCII the logical proves symbol \(\vdash \) with a slash / through it.

  3. 3.

    See a footnote in [6] for a proof.

References

  1. Aczel, P.: An introduction to inductive definitions. In: Barwise, J. (ed.) Handbook of Mathematical Logic, pp. 739–782. North-Holland Publishing Company (1977)

    Google Scholar 

  2. Apt, K.R., Blair, H.A., Walker, A.: Towards a theory of declarative knowledge. In: Minker, J. (ed.) Foundations of Deductive Databases and Logic Programming, pp. 89–148. Morgan Kaufmann (1988)

    Google Scholar 

  3. Chandra, A.K., Harel, D.: Horn clauses queries and generalizations. J. Log. Program. 2(1), 1–15 (1985)

    Article  MathSciNet  MATH  Google Scholar 

  4. Clark, K.L.: Negation as failure. In: Gallaire, H., Minker, J. (eds.) Logic and Data Bases, Symposium on Logic and Data Bases, Centre d’études et de recherches de Toulouse, France, 1977, Advances in Data Base Theory, pp. 293–322, New York (1977). Plemum Press

    Google Scholar 

  5. Denecker, M., Ternovska, E.: A logic of nonmonotone inductive definitions. ACM Trans. Comput. Log. 9(2), 14:1–14:52 (2008)

    Google Scholar 

  6. Denecker, M., Warren, D.S.: The logic of logic programming. CoRR, cs.LO/2304.13430, arXiv/2304.13430 (2023)

    Google Scholar 

  7. Lloyd, J.W.: Foundations of Logic Programming, 2nd (edn.). Springer, Heidelberg (1987). https://doi.org/10.1007/978-3-642-96826-6

  8. Martin-Löf, P.: Hauptsatz for the intuitionistic theory of iterated inductive definitions. In: Fenstad, J.E. (ed.), Second Scandinavian Logic Symposium, pp. 179–216 (1971)

    Google Scholar 

  9. Moschovakis, Y.N.: Elementary Induction on Abstract Structures. North-Holland Publishing Company, Amsterdam-New York (1974)

    Google Scholar 

  10. Przymusinski, T.C.: Perfect model semantics. In: Kowalski, R.A., Bowen, K.A. (eds.) Logic Programming, Proceedings of the Fifth International Conference and Symposium, Seattle, Washington, USA, August 15–19, 1988, vol. 2, pp. 1081–1096. MIT Press (1988)

    Google Scholar 

  11. van Emden, M.H., Kowalski, R.A.: The semantics of predicate logic as a programming language. J. ACM 23(4), 733–742 (1976)

    Article  MathSciNet  MATH  Google Scholar 

  12. Vennekens, J., Denecker, M., Bruynooghe, M.: FO(ID) as an extension of dl with rules. Ann. Math. Artif. Intell. 58(1–2), 85–115 (2010)

    Article  MathSciNet  MATH  Google Scholar 

  13. Warren, D.S.: Introduction to prolog. In: Warren, D.S., Dahl, V., Eiter, T., Hermenegildo, M., Kowalski, R., Rossi, F. (eds.) Prolog: 50 Years of Future, LNAI 13900, pp. 3–19. Springer, Cham (2023). https://doi.org/10.1007/978-3-031-35254-6_1

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to David S. Warren .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2023 The Author(s), under exclusive license to Springer Nature Switzerland AG

About this chapter

Check for updates. Verify currency and authenticity via CrossMark

Cite this chapter

Warren, D.S., Denecker, M. (2023). A Better Logical Semantics for Prolog. In: Warren, D.S., Dahl, V., Eiter, T., Hermenegildo, M.V., Kowalski, R., Rossi, F. (eds) Prolog: The Next 50 Years. Lecture Notes in Computer Science(), vol 13900. Springer, Cham. https://doi.org/10.1007/978-3-031-35254-6_7

Download citation

  • DOI: https://doi.org/10.1007/978-3-031-35254-6_7

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-031-35253-9

  • Online ISBN: 978-3-031-35254-6

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics