Abstract
Program correctness (in imperative and functional programming) splits in logic programming into correctness and completeness. Completeness means that a program produces all the answers required by its specification. Little work has been devoted to reasoning about completeness. This paper presents a few sufficient conditions for completeness of definite programs. We also study preserving completeness under some cases of pruning of SLD-trees (e.g. due to using the cut).
We treat logic programming as a declarative paradigm, abstracting from any operational semantics as far as possible. We argue that the proposed methods are simple enough to be applied, possibly at an informal level, in practical Prolog programming. We point out importance of approximate specifications.
This is a preview of subscription content, log in via an institution.
Buying options
Tax calculation will be finalised at checkout
Purchases are for personal use only
Learn about institutional subscriptionsNotes
- 1.
The same holds for \(A\) of the form \(q(s_{11}\mathtt{-}s_{11},s_2)\), or \(q(s_{11}\mathtt{-}s_{12},s_2)\) with non-unifiable \(s_{11}\), \(s_{12}\). The pruning is implemented using the if-then-else construct in Prolog: \(\mathtt{q(V-P,[A|T]) :\!\!-\,V=\,P\, -\!\!\!> true;\, p(A,T).}\) (And the first case of pruning by \(\mathtt{p(V-P,[B|T]):\!\!-\, non{}var(V)\,-\!\!\!> q(V-P,[B|T]);}\,\, \mathtt{q(B,[V-P|T])}.)\)
- 2.
References
Apt, K.R.: From Logic Programming to Prolog. International Series in Computer Science. Prentice-Hall, Upper Saddle River (1997)
Apt, K.R., Pedreschi, D.: Reasoning about termination of pure Prolog programs. Inf. Comput. 106(1), 109–157 (1993)
Bezem, M.: Strong termination of logic programs. J. Log. Program. 15(1&2), 79–97 (1993)
Clark, K.L.: Predicate logic as computational formalism. Technical report 79/59, Imperial College, London (1979)
Deransart, P., Małuszyński, J.: A Grammatical View of Logic Programming. The MIT Press, Cambridge (1993)
Deville, Y.: Logic Programming: Systematic Program Development. Addison-Wesley, Reading (1990)
Deville, Y., Lau, K.-K.: Logic program synthesis. J. Log. Program. 19(20), 321–350 (1994)
Doets, K.: From Logic to Logic Programming. The MIT Press, Cambridge (1994)
Drabent, W.: Logic + control: an example. In: Dovier, A., Santos Costa, V. (eds.) Technical Communications of ICLP 2012. LIPIcs, vol. 17, pp. 301–311 (2012). http://drops.dagstuhl.de/opus/volltexte/2012/3631
Drabent, W.: Logic + control: an example of program construction, CoRR. abs/1110.4978 (2012). http://arxiv.org/abs/1110.4978.
Drabent, W.: Correctness and completeness of logic programs, CoRR. abs/1412.8739 (2014). http://arxiv.org/abs/1412.8739
Drabent, W.: On completeness of logic programs, CoRR. abs/1411.3015(2014). http://arxiv.org/abs/1411.3015
Drabent, W., Miłkowska, M.: Proving correctness and completeness of normal programs - a declarative approach. Theory Pract. Log. Program. 5(6), 669–711 (2005)
Genaim, S., King, A.: Inferring non-suspension conditions for logic programs with dynamic scheduling. ACM Trans. Comput. Log. 9(3), 17:1–17:43 (2008)
Hogger, C.J.: Introduction to Logic Programming. Academic Press, London (1984)
Howe, J.M., King, A.: A pearl on SAT and SMT solving in Prolog. Theor. Comput. Sci. 435, 43–55 (2012)
King, A.: Personal communication, March 2012
Kowalski, R.A.: The relation between logic programming and logic specification. In: Hoare, C., Shepherdson, J. (eds.) Mathematical Logic and Programming Languages, pp. 11–27. Prentice-Hall, Upper Saddle River (1985). Also in Phil. Trans. R. Soc. Lond. A, 312, 345–361(1984)
Pettorossi, A., Proietti, M.: Transformation of logic programs: foundations and techniques. J. Log. Program. 19/20, 261–320 (1994)
Pettorossi, A., Proietti, M., Senni, V.: The transformational approach to program development. In: Dovier, A., Pontelli, E. (eds.) GULP. LNCS, vol. 6125, pp. 112–135. Springer, Heidelberg (2010)
Shapiro, E.: Algorithmic Program Debugging. The MIT Press, Cambridge (1983)
Stärk, R.F.: The theoretical foundations of LPTP (a logic program theorem prover). J. Log. Program. 36(3), 241–269 (1998)
Sterling, L., Shapiro, E.: The Art of Prolog, 2nd edn. The MIT Press, Cambridge (1994)
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2015 Springer International Publishing Switzerland
About this paper
Cite this paper
Drabent, W. (2015). On Completeness of Logic Programs. In: Proietti, M., Seki, H. (eds) Logic-Based Program Synthesis and Transformation. LOPSTR 2014. Lecture Notes in Computer Science(), vol 8981. Springer, Cham. https://doi.org/10.1007/978-3-319-17822-6_15
Download citation
DOI: https://doi.org/10.1007/978-3-319-17822-6_15
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-319-17821-9
Online ISBN: 978-3-319-17822-6
eBook Packages: Computer ScienceComputer Science (R0)