Abstract
We provide a logical specification of set predicates findall and bagof of Prolog. The specification is given in proof theoretic terms, and pertains to any SLD-resolution based language. The order dependent aspects, relevant for languages embodying a sequential proof search strategy (possibly with side effects), can be added in an orthogonal way. The specification also allows us to prove that bagof cannot be defined by SLD-resolution alone. We show the correctness, wrt to our specification, of Demoen's definition of bagof for Prolog in Prolog. The specification of bagof allows us to throw some light on the logical problems with setof.
Preview
Unable to display preview. Download preview PDF.
References
K.R.Apt, Logic Programming, in: J. van Leeuwen (ed.), Formal Models and Semantics. Handbook of Theoretical Computer Science, Vol.B, Elsevier 1990, pp. 493–574
H.P.Barendregt, The Lambda Calculus, Elsevier 1984
E.Börger, D.Rosenzweig, A Formal Specification of Prolog by Tree Algebras, in: V.Čerić et.al. (eds.), Proceedings of The Third International Conference on Information Technology Interfaces, SRCE, Zagreb 1991, pp. 513–518
E.Börger, D.Rosenzweig, The WAM-Definition and Compiler Correctness, Technical report TR-14/92, Dipartimento di Informatica, Università di Pisa 1992
B.Demoen, Code and Comments Regarding bagof/3, in: PROLOG. Paris papers 2, ISO/IEC JTC1 SC22 WG17 N.80, pp. 85–86
A.Dodd, The Predicates bagof/3 and setof/3, a Proposal, in: PRO-LOG. Paris papers 2, ISO/IEC JTC1 SC22 WG17 N.80, pp. 75–84
R.A.O'Keefe, The Craft of Prolog, MIT Press 1990
L.M.Pereira, A.Porto, All Solutions, in: Logic Programming Newsletter 2, 1981, pp. 9–10
K.Ueda, Making Exhaustive Search Programs Deterministic, in: Proceedings of the 3rd International Conference on Logic Programming, pp. 270–282
K.Ueda, Making Exhaustive Search Programs Deterministic, Part 2, in: Proceedings of the 4th International Conference on Logic Programming, pp. 356–375
D.H.D.Warren, Higher Order Extensions to Prolog: Are they Needed?, in: Machine Intelligence 10(1982), pp. 441–454
PROLOG. Part 1, General Core, Committee Draft 1.0, ISO/IEC JTC1 SC22 WG17 N.92
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1993 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Börger, E., Rosenzweig, D. (1993). The mathematics of set predicates in Prolog. In: Gottlob, G., Leitsch, A., Mundici, D. (eds) Computational Logic and Proof Theory. KGC 1993. Lecture Notes in Computer Science, vol 713. Springer, Berlin, Heidelberg. https://doi.org/10.1007/BFb0022547
Download citation
DOI: https://doi.org/10.1007/BFb0022547
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-57184-1
Online ISBN: 978-3-540-47943-7
eBook Packages: Springer Book Archive