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.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Notes
- 1.
Also available at: https://people.cs.kuleuven.be/~marc.denecker/A-PDF/Prolog50.pdf.
- 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.
See a footnote in [6] for a proof.
References
Aczel, P.: An introduction to inductive definitions. In: Barwise, J. (ed.) Handbook of Mathematical Logic, pp. 739–782. North-Holland Publishing Company (1977)
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)
Chandra, A.K., Harel, D.: Horn clauses queries and generalizations. J. Log. Program. 2(1), 1–15 (1985)
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
Denecker, M., Ternovska, E.: A logic of nonmonotone inductive definitions. ACM Trans. Comput. Log. 9(2), 14:1–14:52 (2008)
Denecker, M., Warren, D.S.: The logic of logic programming. CoRR, cs.LO/2304.13430, arXiv/2304.13430 (2023)
Lloyd, J.W.: Foundations of Logic Programming, 2nd (edn.). Springer, Heidelberg (1987). https://doi.org/10.1007/978-3-642-96826-6
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)
Moschovakis, Y.N.: Elementary Induction on Abstract Structures. North-Holland Publishing Company, Amsterdam-New York (1974)
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)
van Emden, M.H., Kowalski, R.A.: The semantics of predicate logic as a programming language. J. ACM 23(4), 733–742 (1976)
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)
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
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2023 The Author(s), under exclusive license to Springer Nature Switzerland AG
About this chapter
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)