Skip to main content
    • Aa
    • Aa

Logic + control: On program construction and verification


This paper presents an example of formal reasoning about the semantics of a Prolog program of practical importance (the SAT solver of Howe and King). The program is treated as a definite clause logic program with added control. The logic program is constructed by means of stepwise refinement, hand in hand with its correctness and completeness proofs. The proofs are declarative – they do not refer to any operational semantics. Each step of the logic program construction follows a systematic approach to constructing programs which are provably correct and complete. We also prove that correctness and completeness of the logic program is preserved in the final Prolog program. Additionally, we prove termination, occur-check freedom and non-floundering.

Our example shows how dealing with “logic” and with “control” can be separated. Most of the proofs can be done at the “logic” level, abstracting from any operational semantics.

The example employs approximate specifications; they are crucial in simplifying reasoning about logic programs. It also shows that the paradigm of semantics-preserving program transformations may be not sufficient. We suggest considering transformations which preserve correctness and completeness with respect to an approximate specification.

Linked references
Hide All

This list contains references from the content that can be linked to their source. For a full set of references and notes please see the PDF or HTML where available.

K. R. Apt and I. Luitjes 1995. Verification of logic programs with delay declarations. In Proc. of Algebraic Methodology and Software Technology, AMAST '95, V. S. Alagar and M. Nivat , Eds. Lecture Notes in Computer Science, vol. 936. Springer, 6690.

K. R. Apt and D. Pedreschi 1993. Reasoning about termination of pure Prolog programs. Information and Computation 106, 1, 109157.

M. Davis , G. Logemann and D. W. Loveland 1962. A machine program for theorem-proving. Communications of the ACM 5, 7, 394397.

P. Deransart 1993. Proof methods of declarative properties of definite programs. Theoretical Computer Science 118, 2, 99166.

W. Drabent 2017. Proving completeness of logic programs with the cut. Formal Aspects of Computing 29, 1, 155172.

S. Genaim and A. King 2008. Inferring non-suspension conditions for logic programs with dynamic scheduling. ACM Transactions on Computational Logic 9, 3, 17:117:43.

A. Pettorossi , M. Proietti and V. Senni 2010. The transformational approach to program development. In A 25-Year Perspective on Logic Programming: Achievements of the Italian Association for Logic Programming, GULP, A. Dovier and E. Pontelli , Eds. Lecture Notes in Computer Science, vol. 6125. Springer, 112135.

Recommend this journal

Email your librarian or administrator to recommend adding this journal to your organisation's collection.

Theory and Practice of Logic Programming
  • ISSN: 1471-0684
  • EISSN: 1475-3081
  • URL: /core/journals/theory-and-practice-of-logic-programming
Please enter your name
Please enter a valid email address
Who would you like to send this to? *



Full text views

Total number of HTML views: 0
Total number of PDF views: 11 *
Loading metrics...

Abstract views

Total abstract views: 74 *
Loading metrics...

* Views captured on Cambridge Core between 19th June 2017 - 19th September 2017. This data will be updated every 24 hours.