Skip to main content Accessibility help
×
Home
Hostname: page-component-65dc7cd545-8rn5k Total loading time: 0.18 Render date: 2021-07-25T16:00:23.158Z Has data issue: true Feature Flags: { "shouldUseShareProductTool": true, "shouldUseHypothesis": true, "isUnsiloEnabled": true, "metricsAbstractViews": false, "figures": true, "newCiteModal": false, "newCitedByModal": true, "newEcommerce": true, "newUsageEvents": true }

Logic + control: On program construction and verification

Published online by Cambridge University Press:  19 June 2017

WŁODZIMIERZ DRABENT
Affiliation:
Institute of Computer Science, Polish Academy of Sciences, Warsaw IDA, Linköping University, Linköping, Sweden (e-mails: drabent@ipipan.waw.pl)
Corresponding
E-mail address:

Abstract

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.

Type
Regular Papers
Copyright
Copyright © Cambridge University Press 2017 

Access options

Get access to the full version of this content by using one of the access options below.

References

Apt, K. R. 1997. From Logic Programming to Prolog. International Series in Computer Science. Prentice-Hall.Google Scholar
Apt, K. R. and Luitjes, I. 1995. Verification of logic programs with delay declarations. In Proc. of Algebraic Methodology and Software Technology, AMAST '95, Alagar, V. S. and Nivat, M., Eds. Lecture Notes in Computer Science, vol. 936. Springer, 6690.CrossRefGoogle Scholar
Apt, K. R. and Pedreschi, D. 1993. Reasoning about termination of pure Prolog programs. Information and Computation 106, 1, 109157.CrossRefGoogle Scholar
Bezem, M. 1993. Strong termination of logic programs. Journal of Logic Programming 15, 1&2, 7997.CrossRefGoogle Scholar
Carlsson, M. and Mildner, P. 2012. SICStus Prolog – the first 25 years. TPLP 12, 1–2, 3566.Google Scholar
Clark, K. L. 1979. Predicate Logic as Computational Formalism. Technical Report 79/59, Imperial College, London. December.Google Scholar
Davis, M., Logemann, G. and Loveland, D. W. 1962. A machine program for theorem-proving. Communications of the ACM 5, 7, 394397.CrossRefGoogle Scholar
Deransart, P. 1993. Proof methods of declarative properties of definite programs. Theoretical Computer Science 118, 2, 99166.CrossRefGoogle Scholar
Deransart, P. and Małuszyński, J. 1993. A Grammatical View of Logic Programming. The MIT Press.Google Scholar
Deville, Y. 1990. Logic Programming: Systematic Program Development. Addison-Wesley.Google Scholar
Drabent, W. 2012. Logic + control: An example. In Technical Communications of the 28th International Conference on Logic Programming (ICLP'12), Dovier, A. and Costa, V. S., Eds. Leibniz International Proceedings in Informatics (LIPIcs), Schloss Dagstuhl – Leibniz-Zentrum für Informatik GmbH, Dagstuhl Publishing, Saarbrücken/Wadern, Germany, vol. 17, 301311. http://drops.dagstuhl.de/opus/volltexte/2012/3631.Google Scholar
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. Extended version in CoRR abs/1411.3015 (2014). http://arxiv.org/abs/1411.3015.Google Scholar
Drabent, W. 2016a. Correctness and completeness of logic programs. ACM Transactions on Computational Logic 17, 3, 18:118:32.CrossRefGoogle Scholar
Drabent, W. 2016b. On definite program answers and least Herbrand models. TPLP 16, 4, 498508.Google Scholar
Drabent, W. 2017. Proving completeness of logic programs with the cut. Formal Aspects of Computing 29, 1, 155172.CrossRefGoogle Scholar
Drabent, W. and Miłkowska, M. 2005. Proving correctness and completeness of normal programs – a declarative approach. TPLP 5, 6, 669711.Google Scholar
Genaim, S. and King, A. 2008. Inferring non-suspension conditions for logic programs with dynamic scheduling. ACM Transactions on Computational Logic 9, 3, 17:117:43.CrossRefGoogle Scholar
Gomes, C. P., Kautz, H., Sabharwal, A. and Selman, B. 2008. Satisfiability solvers. In Handbook of Knowledge Representation, van Harmelen, F., Lifschitz, V. and Porter, B., Eds. Chapter 2, Elsevier, 89134.CrossRefGoogle Scholar
Howe, J. M. and King, A. 2012. A pearl on SAT and SMT solving in Prolog. Theoretical Computer Science 435, 4355.CrossRefGoogle Scholar
King, A. 2012. Private communication.Google Scholar
Kowalski, R. A. 1979. Algorithm = logic + control. Communications of the ACM 22, 7, 424436.CrossRefGoogle Scholar
Maher, M. J. 1988. Equivalences of logic programs. In Foundations of Deductive Databases and Logic Programming, Minker, J., Ed. Morgan Kaufmann, 627658.CrossRefGoogle Scholar
Nguyen, M. T., Schreye, D. D., Giesl, J. and Schneider-Kamp, P. 2011. Polytool: Polynomial interpretations as a basis for termination analysis of logic programs. TPLP 11, 1, 3363.Google Scholar
Pedreschi, D. and Ruggieri, S. 1999. Verification of logic programs. Journal of Logic Programming 39, 1–3, 125176.CrossRefGoogle Scholar
Pedreschi, D., Ruggieri, S. and Smaus, J.-G. 2002. Classes of terminating logic programs. TPLP 2, 3, 369418.Google Scholar
Pettorossi, A., Proietti, M. and Senni, V. 2010. The transformational approach to program development. In A 25-Year Perspective on Logic Programming: Achievements of the Italian Association for Logic Programming, GULP, Dovier, A. and Pontelli, E., Eds. Lecture Notes in Computer Science, vol. 6125. Springer, 112135.CrossRefGoogle Scholar
Pfenning, F., Ed. 1992. Types in Logic Programming. The MIT Press.Google Scholar
Shapiro, E. 1983. Algorithmic Program Debugging. The MIT Press.Google Scholar
Smaus, J., Hill, P. M. and King, A. 1998a. Preventing instantiation errors and loops for logic programs with multiple modes using block declarations. In Proc. of Logic Programming Synthesis and Transformation, LOPSTR'98, Flener, P., Ed. Lecture Notes in Computer Science, vol. 1559. Springer, 289307.Google Scholar
Smaus, J., Hill, P. M. and King, A. 1998b. Termination of logic programs with block declarations running in several modes. In Proc. of Principles of Declarative Programming, PLILP'98, Palamidessi, C., Glaser, H. and Meinke, K., Eds. Lecture Notes in Computer Science, vol. 1490, 7388.Google Scholar
1
Cited by

Send article to Kindle

To send this article to your Kindle, first ensure no-reply@cambridge.org is added to your Approved Personal Document E-mail List under your Personal Document Settings on the Manage Your Content and Devices page of your Amazon account. Then enter the ‘name’ part of your Kindle email address below. Find out more about sending to your Kindle. Find out more about sending to your Kindle.

Note you can select to send to either the @free.kindle.com or @kindle.com variations. ‘@free.kindle.com’ emails are free but can only be sent to your device when it is connected to wi-fi. ‘@kindle.com’ emails can be delivered even when you are not connected to wi-fi, but note that service fees apply.

Find out more about the Kindle Personal Document Service.

Logic + control: On program construction and verification
Available formats
×

Send article to Dropbox

To send this article to your Dropbox account, please select one or more formats and confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your <service> account. Find out more about sending content to Dropbox.

Logic + control: On program construction and verification
Available formats
×

Send article to Google Drive

To send this article to your Google Drive account, please select one or more formats and confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your <service> account. Find out more about sending content to Google Drive.

Logic + control: On program construction and verification
Available formats
×
×

Reply to: Submit a response

Please enter your response.

Your details

Please enter a valid email address.

Conflicting interests

Do you have any conflicting interests? *