Under Consideration for Publication in Theory and Practice of Logic Programming a Three-valued Semantics for Logic Programmers

This paper describes a simpler way for programmers to reason about the correctness of their code. The study of semantics of logic programs has shown strong links between the model theoretic semantics (truth and falsity of atoms in the programmer's interpretation of a program), procedural semantics (for example, SLD resolution) and fixpoint semantics (which is useful for program analysis and alternative execution mechanisms). Most of this work assumes that intended interpretations are two-valued: a ground atom is true (and should succeed according to the procedural semantics) or false (and should not succeed). In reality, intended interpretations are less precise. Programmers consider that some atoms “should not occur” or are “ill-typed” or “inadmissible”. Programmers don't know and don't care whether such atoms succeed. In this paper we propose a three-valued semantics for (essentially) pure Prolog programs with (ground) negation as failure which reflects this. The semantics of Fitting is similar but only associates the third truth value with non-termination. We provide tools to reason about correctness of programs without the need for unnatural precision or undue restrictions on programming style. As well as theoretical results, we provide a programmer-oriented synopsis. This work has come out of work on declarative debugging, where it has been recognised that inadmissible calls are important.

[1]  Kenneth Kunen,et al.  Negation in Logic Programming , 1987, J. Log. Program..

[2]  Lee Naish A Declarative Debugging Scheme , 1997, J. Funct. Log. Program..

[3]  autoepistemic Zogic Logic programming and negation : a survey , 2001 .

[4]  Wlodzimierz Drabent,et al.  Inductive Assertion Method for Logic Programs , 1987, Theoretical Computer Science.

[5]  Wlodzimierz Drabent,et al.  Inductive Assertion Method for Logic Programs , 1988, Theor. Comput. Sci..

[6]  Melvin Fitting,et al.  A Kripke-Kleene Semantics for Logic Programs , 1985, J. Log. Program..

[7]  Maurizio Martelli,et al.  A New SLDNF-Tree , 1992, Inf. Process. Lett..

[8]  John W. Lloyd,et al.  The Go¨del programming language , 1994 .

[9]  Lee Naish,et al.  A three-valued declarative debugging scheme , 2000, Proceedings 23rd Australasian Computer Science Conference. ACSC 2000 (Cat. No.PR00518).

[10]  Ehud Shapiro,et al.  Algorithmic Program Debugging , 1983 .

[11]  S. C. Kleene,et al.  Introduction to Metamathematics , 1952 .

[12]  J. Lloyd Foundations of Logic Programming , 1984, Symbolic Computation.

[13]  Lee Naish A three-valued semantic for Horn clause programs , 2000, Proceedings 23rd Australasian Computer Science Conference. ACSC 2000 (Cat. No.PR00518).

[14]  Wlodzimierz Drabent,et al.  Proving correctness and completeness of normal programs – a declarative approach , 2001, Theory and Practice of Logic Programming.

[15]  Luís Moniz Pereira Rational Debugging in Logic Programming , 1986, ICLP.

[16]  Lee Naish A Declarative View of Modes , 1996, JICSLP.

[17]  John W. Lloyd,et al.  The Gödel programming language , 1994 .

[18]  Teodor C. Przymusinski Every logic program has a natural stratification and an iterated least fixed point model , 1989, PODS.

[19]  Luís Moniz Pereira,et al.  A Framework for Prolog Debugging , 1988, ICLP/SLP.

[20]  Manuel V. Hermenegildo,et al.  An Assertion Language for Constraint Logic Programs , 2000, Analysis and Visualization Tools for Constraint Programming.

[21]  Lee Naish Verification of Logic Programs and Imperative Programs , 1991, ICLP Workshop on Construction of Logic Programs.

[22]  Lee Naish,et al.  Types and the Intended Meaning of Logic Programs , 1992, Types in Logic Programming.