Proving correctness and completeness of normal programs - a declarative approach

We advocate a declarative approach to proving properties of logic programs. Total correctness can be separated into correctness, completeness and clean termination; the latter includes non-floundering. Only clean termination depends on the operational semantics, in particular on the selection rule. We show how to deal with correctness and completeness in a declarative way, treating programs only from the logical point of view. Specifications used in this approach are interpretations (or theories). We point out that specifications for correctness may differ from those for completeness, as usually there are answers which are neither considered erroneous nor required to be computed. We present proof methods for correctness and completeness for definite programs and generalize them to normal programs. For normal programs we use the 3-valued completion semantics; this is a standard semantics corresponding to negation as finite failure. The proof methods employ solely the classical 2-valued logic. We use a 2-valued characterization of the 3-valued completion semantics, which may be of separate interest. The method of proving correctness of definite programs is not new and can be traced back to the work of clark in 1979. However a more complicated approach using operational semantics was proposed by some authors. We show that it is not stronger than the declarative one, as far as properties of program answers are concerned. For a corresponding operational approach to normal programs, we show that it is (strictly) weaker than our method. We also employ the ideas of this work to generalize a known method of proving termination of normal programs.

[1]  Bruno Courcelle,et al.  Proofs of Partial Correctness for Attribute Grammars with Applications to Recursive Procedures and Logic Programming , 1988, Inf. Comput..

[2]  Christopher J. Hogger,et al.  Derivation of Logic Programs , 1981, JACM.

[3]  Gérard Ferrand,et al.  Proof Method of Partial Correctness and Weak Completeness for Normal Logic Programs , 1993, J. Log. Program..

[4]  Dino Pedreschi,et al.  Reasoning about Termination of Pure Prolog Programs , 1993, Inf. Comput..

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

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

[7]  Paolo Mancarella,et al.  Algebraic Properties of a Class of Logic Programs , 1990, NACLP.

[8]  Krzysztof R. Apt Declarative Programming in Prolog , 1993, ILPS.

[9]  Bernard Malfon Characterization of Some Semantics for Logic Programs with Negation and Applications to Program Validation , 1994, ILPS.

[10]  Kees Doets,et al.  From logic to logic programming , 1994, Foundations of computing series.

[11]  J. W. Lloyd,et al.  Foundations of logic programming; (2nd extended ed.) , 1987 .

[12]  Wlodzimierz Drabent,et al.  What is failure? An approach to constructive negation , 1995, Acta Informatica.

[13]  Maurizio Gabbrielli,et al.  The s-Semantics Approach: Theory and Applications , 1994, J. Log. Program..

[14]  Krzysztof R. Apt,et al.  From logic programming to Prolog , 1996, Prentice Hall International series in computer science.

[15]  Robert Stärk,et al.  From logic programs to inductive definitions , 1996 .

[16]  KRZYSZTOF R. APT,et al.  A New Definition of SNDNF-Resolution , 1994, J. Log. Program..

[17]  Yves Deville,et al.  Logic programming - systematic program development , 1990, International series in logic programming.

[18]  Wlodzimierz Drabent,et al.  Completeness of SLDNF-Resolution for Nonfloundering Queries , 1993, J. Log. Program..

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

[20]  Krzysztof R. Apt,et al.  Logic Programming , 1990, Handbook of Theoretical Computer Science, Volume B: Formal Models and Sematics.

[21]  Maurizio Gabbrielli,et al.  Proving concurrent constraint programs correct , 1997, TOPL.

[22]  Melvin Fitting,et al.  Bilattices and the Semantics of Logic Programming , 1991, J. Log. Program..

[23]  Jan Maluszynski,et al.  Directional Types and the Annotation Method , 1997, J. Log. Program..

[24]  Annalisa Bossi,et al.  Verifying Correctness of Logic Programs , 1989, TAPSOFT, Vol.2.

[25]  Pierre Deransart,et al.  Proof Methods of Declarative Properties of Definite Programs , 1993, Theor. Comput. Sci..

[26]  Maurice Bruynooghe,et al.  A Framework for Analyzing the Termination of Definite Logic Programs with respect to Call Patterns , 1992, FGCS.

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

[28]  Kenneth A. Ross,et al.  The well-founded semantics for general logic programs , 1991, JACM.

[29]  Dino Pedreschi,et al.  Verification of Logic Programs , 1999, J. Log. Program..

[30]  Annalisa Bossi,et al.  Norms on Terms and their use in Proving Universal Termination of a Logic Program , 1994, Theor. Comput. Sci..

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

[32]  Robert F. Stärk Formal Verification of Logic Programs: Foundations and Implementation , 1997, LFCS.

[33]  Maurizio Gabbrielli,et al.  A Closer Look at Declarative Interpretations , 1994, J. Log. Program..

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

[35]  Wlodzimierz Drabent,et al.  It is declarative on reasoning about logic programs , 1999, ICLP 1999.

[36]  Jan Maluszynski,et al.  A grammatical view of logic programming , 1988, PLILP.