Termination analysis of logic programs through combination of type-based norms

This article makes two contributions to the work on semantics-based termination analysis for logic programs. The first involves a novel notion of type-based norm where for a given type, a corresponding norm is defined to count in a term the number of subterms of that type. This provides a collection of candidate norms, one for each type defined in the program. The second enables an analyzer to base termination proofs on the combination of several different norms. This is useful when different norms are better suited to justify the termination of different parts of the program. Application of the two contributions together consists in considering the combination of the type-based candidate norms for a given program. This results in a powerful and practical technique. Both contributions have been introduced into a working termination analyzer. Experimentation indicates that they yield state-of-the-art results in a fully automatic analysis tool, improving with respect to methods that do not use both types and combined norms.

[1]  Frank Plumpton Ramsey,et al.  On a Problem of Formal Logic , 1930 .

[2]  J. Spencer Ramsey Theory , 1990 .

[3]  Annalisa Bossi Logic-Based Program Synthesis and Transformation , 1999, Lecture Notes in Computer Science.

[4]  Danny De Schreye,et al.  Automatic Inference of Norms: A Missing Link in Automatic Termination Analysis , 1993, ILPS.

[5]  Wim Vanhoof,et al.  Reuse of Results in Termination Analysis of Typed Logic Programs , 2002, SAS.

[6]  Zohar Manna,et al.  Proving termination with multiset orderings , 1979, CACM.

[7]  John P. Gallagher,et al.  Combining Norms to Prove Termination , 2002, VMCAI.

[8]  Francisco Bueno,et al.  More Precise Yet Efficient Type Inference for Logic Programs , 2002, SAS.

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

[10]  John P. Gallagher,et al.  One Loop at a Time , 2003 .

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

[12]  John P. Gallagher,et al.  Fast and Precise Regular Approximations of Logic Programs , 1994, ICLP.

[13]  Yehoshua Sagiv,et al.  Automatic Termination Analysis of Logic Programs , 1997, ICLP.

[14]  Annalisa Bossi,et al.  Proving Termination of Logic Programs by Exploiting Term Properties , 1991, TAPSOFT, Vol.2.

[15]  Alexander Serebrenik,et al.  Non-tranformational termination analysis of logic programs, based on general term-orderings , 2000, LOPSTR.

[16]  D. D. Schreye,et al.  Exploiting the power of typed norms in automatic inference of interargument relations , 1997 .

[17]  Max Bramer Logic Programming with Prolog , 2005, Springer London.

[18]  Sandro Etalle,et al.  On modular termination proofs of general logic programs , 2000, Theory and Practice of Logic Programming.

[19]  Frédéric Mesnard,et al.  Applying Static Analysis Techniques for Inferring Termination Conditions of Logic Programs , 2001, SAS.

[20]  Nachum Dershowitz,et al.  Examples of Termination , 1993, Term Rewriting.

[21]  Samir Genaim,et al.  Proving Termination One Loop at a Time , 2003, WLPE.

[22]  Yehoshua Sagiv,et al.  Inference of monotonicity constraints in Datalog programs , 1989, PODS '89.

[23]  Michael Karr,et al.  Affine relationships among variables of a program , 1976, Acta Informatica.

[24]  Zohar Manna,et al.  Proving termination with multiset orderings , 1979, CACM.

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

[26]  Neil D. Jones,et al.  The size-change principle for program termination , 2001, POPL '01.

[27]  Jean-Marie Jacquet,et al.  Introduction to Logic Programming , 1993, ICLP Workshop on Construction of Logic Programs.

[28]  John P. Gallagher,et al.  Inference of Well-Typings for Logic Programs with Application to Termination Analysis , 2005, SAS.

[29]  Patrick Brézillon,et al.  Lecture Notes in Artificial Intelligence , 1999 .

[30]  Wim Vanhoof,et al.  When Size Does Matter , 2001, LOPSTR.

[31]  Nicolas Halbwachs,et al.  Automatic discovery of linear restraints among variables of a program , 1978, POPL.

[32]  Frédéric Mesnard,et al.  Inferring Left-terminating Classes of Queries for Constraint Logic Programs , 1996 .

[33]  Leon Sterling,et al.  The Art of Prolog , 1987, IEEE Expert.

[34]  Wim Vanhoof,et al.  A note on the reuse of the results of a termination analysis based on polymorphic types , 2003 .

[35]  Krzysztof R. Apt,et al.  Introduction to Logic Programming , 1988 .

[36]  Peter J. Stuckey,et al.  A Framework for Analysis of Typed Logic Programs , 2001, FLOPS.

[37]  Andy King,et al.  Typed Norms for Typed Logic Programs , 1996, LOPSTR.

[38]  Leon Sterling,et al.  The art of Prolog (2nd ed.): advanced programming techniques , 1994 .

[39]  John P. Gallagher,et al.  Abstract Interpretation over Non-deterministic Finite Tree Automata for Set-Based Analysis of Logic Programs , 2002, PADL.

[40]  Maurizio Gabbrielli,et al.  Goal independency and call patterns in the analysis of logic programs , 1994, SAC '94.

[41]  Yehoshua Sagiv,et al.  Inference of Monotonicity Constraints in Datalog Programs , 1989, PODS.

[42]  Kim Marriott,et al.  Precise and efficient groundness analysis for logic programs , 1993, LOPL.

[43]  Michael Codish,et al.  A Semantic Basis for the Termination Analysis of Logic Programs , 1999, J. Log. Program..

[44]  Nachum Dershowitz,et al.  A General Framework for Automatic Termination Analysis of Logic Programs , 2000, Applicable Algebra in Engineering, Communication and Computing.

[45]  Sandro Etalle,et al.  On modular termination proofs of general logic programs , 2002, Theory Pract. Log. Program..

[46]  和達 三樹 G. L. Lamb, Jr.: Elements of Soliton Theory, John Wiley, New York and Chichester, 1980, xiii+289ページ, 24×17cm, 8,980円(Pure and Applied Mathematics; A Wiley-Interscience Series of Texts, Monographs and Tracts). , 1981 .

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

[48]  Alan Mycroft,et al.  A Polymorphic Type System for Prolog , 1984, Logic Programming Workshop.

[49]  Peter J. Stuckey,et al.  Termination Analysis with Types Is More Accurate , 2003, ICLP.

[50]  Samir Genaim,et al.  Inferring termination conditions for logic programs using backwards analysis , 2001, Theory and Practice of Logic Programming.

[51]  Annalisa Bossi,et al.  Typed Norms , 1992, ESOP.

[52]  Zoltan Somogyi,et al.  The Execution Algorithm of Mercury, an Efficient Purely Declarative Logic Programming Language , 1996, J. Log. Program..

[53]  Andy King,et al.  Inferring Argument Size Relationships with CLP(R) , 1996, LOPSTR.

[54]  Paul J. Krause,et al.  The art of Prolog - second edition by Leon Sterling and Ehud Shapiro, MIT Press, Cambridge, MA 1994, pp 509, £19.95 (paperback), £44.94 (hardback), ISBN 0-262-19338-8 , 1995, The Knowledge Engineering Review.

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

[56]  Rodney W. Topor,et al.  A Semantics for Typed Logic Programs , 1992, Types in Logic Programming.

[57]  Danny De Schreye,et al.  Deriving linear size relations for logic programs by abstract interpretation , 2009, New Generation Computing.

[58]  Wim Vanhoof,et al.  Pos(T): Analyzing Dependencies in Typed Logic Programs , 2001, Ershov Memorial Conference.

[59]  Andy King,et al.  Lower-bound Time-complexity Analysis of Logic Programs , 1997, ILPS.