Completeness of a logic program means that the program produces all the answers required by its specification. The cut is an important construct of programming language Prolog. It prunes part of the search space, this may result in a loss of completeness. This paper proposes a way of proving completeness of programs with the cut. The semantics of the cut is formalized by describing how SLD-trees are pruned. A sufficient condition for completeness is presented, proved sound, and illustrated by examples.
This is a preview of subscription content, log in to check access.
Buy single article
Instant access to the full article PDF.
Price includes VAT for USA
Subscribe to journal
Immediate online access to all issues from 2019. Subscription will auto renew annually.
This is the net price. Taxes to be calculated in checkout.
Andrews JH (2003) The witness properties and the semantics of the Prolog cut. TPLP 3(1): 1–59
Apt KR, Pedreschi D (1993) Reasoning about termination of pure Prolog programs. Inf Comput 106(1): 109–157
Apt KR (1997) From logic programming to Prolog. International Series in Computer Science. Prentice Hall Europe, Hemel Hempstead, Hertfordshire
Bossi A, Cocco N (1989) Verifying correctness of logic programs. In: Díaz J, Orejas F (eds) TAPSOFT, Vol.2, Lecture Notes in Computer Science, vol 352.. Springer, Berlin Heidelberg, pp 96–110
Bezem M (1993) Strong termination of logic programs. J Log Program 15(1&2): 79–97
Billaud M (1990) Simple operational and denotational semantics for Prolog with cut. Theor Comput Sci 71(2): 193–208
Clark KL (1979) Predicate logic as computational formalism. Technical Report 79/59, Imperial College, London
Deransart P (1993) Proof methods of declarative properties of definite programs. Theor Comput Sci 118(2): 99–166
Drabent W, Małuszyński J (1988) Inductive assertion method for logic programs. Theor Comput Sci 59: 133–155
Deransart P, Małuszyński J (1993) A Grammatical view of logic programming. The MIT Press, Cambridge, Massachusetts, London, England
Drabent W, Miłkowska M (2005) Proving correctness and completeness of normal programs – a declarative approach. TPLP 5(6): 669–711
Doets K (1994) From logic to logic programming. The MIT Press, Cambridge
Drabent W (2015) On completeness of logic programs. In: Logic based program synthesis and transformation, LOPSTR 2014. Revised Selected Papers, Lecture Notes in Computer Science, vol 8981. Springer, Berlin. Extended version in CoRR (2014). arXiv:1411.3015.
Drabent W (2016) Correctness and completeness of logic programs. ACM Trans Comput Log 17(3): 18–11832
Drabent W (2016) On definite program answers and least Herbrand models. TPLP 16(4): 498–508
de Vink EP (1989) Comparative semantics for PROLOG with cut. Sci Comput Program 13(1): 237–264
Kriener J, King A (2014) Semantics for Prolog with cut-revisited. In: Codish M, Sumii E (eds) Functional and Logic Programming—12th International Symposium, FLOPS 2014, Kanazawa, Japan, June 4–6, 2014. Proceedings, Lecture Notes in Computer Science, vol 8475. Springer, Berlin, pp 270–284
Lloyd JW, (1987) Foundations of logic programming. Second, extended edition. Springer, Berlin
Maher MJ (1988) Equivalences of logic programs. In: Minker J (ed) Foundations of deductive databases and logic programming. Morgan Kaufmann, Los Altos, California, pp 627–658
Nilsson U, Małuszyński J (1995) Logic, programming and Prolog (2ed). Wiley, Chichester, West Sussex, England. http://www.ida.liu.se/~ulfni/lpp/.
Schneider-Kamp P, Giesl J, Ströder T, Serebrenik A, Thiemann R (2010) Automated termination analysis for logic programs with cut. TPLP 10(4-6): 365–381
Shapiro E (1983) Algorithmic program debugging. The MIT Press, Cambridge, Massachusetts, London, England
Spoto F (2000) Operational and goal-independent denotational semantics for Prolog with cut. J Log Program 42(1): 1–46
Sterling L, Shapiro E (1994) The art of Prolog, 2nd edn. The MIT Press, Cambridge, Massachusetts, London, England
Maurizio Proietti, Hirohisa Seki, and Jim Woodcock
About this article
Cite this article
Drabent, W. Proving completeness of logic programs with the cut. Form Asp Comp 29, 155–172 (2017). https://doi.org/10.1007/s00165-016-0392-0
- Logic programming
- The cut
- Operational semantics
- Program completeness
- Program correctness