Detecting Determinacy in Prolog Programs

In program development it is useful to know that a call to a Prolog program will not inadvertently leave a choice-point on the stack. Determinacy inference has been proposed for solving this problem yet the analysis was found to be wanting in that it could not infer determinacy conditions for programs that contained cuts or applied certain tests to select a clause. This paper shows how to remedy these serious deficiencies. It also addresses the problem of identifying those predicates which can be rewritten in a more deterministic fashion. To this end, a radically new form of determinacy inference is introduced, which is founded on ideas in ccp, that is capable of reasoning about the way bindings imposed by a rightmost goal can make a leftmost goal deterministic.

[1]  Dan Sahlin Determinacy Analysis for Full Prolog , 1991, PEPM.

[2]  Prakash Panangaden,et al.  The semantic foundations of concurrent constraint programming , 1991, POPL '91.

[3]  Samir Genaim,et al.  Goal-Independent Suspension Analysis for Logic Programs with Dynamic Scheduling , 2003, ESOP.

[4]  Pascal Van Hentenryck,et al.  Cardinality Analysis of Prolog , 1994, ILPS.

[5]  Pascal Van Hentenryck,et al.  Sequence-based abstract interpretation of Prolog , 2000, Theory and Practice of Logic Programming.

[6]  Torben Æ. Mogensen A Semantics-Based Determinacy Analysis for Prolog with Cut , 1996, Ershov Memorial Conference.

[7]  Andy King,et al.  A backward analysis for constraint logic programs , 2001, Theory and Practice of Logic Programming.

[8]  John P. Gallagher,et al.  Termination analysis of logic programs through combination of type-based norms , 2007, TOPL.

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

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

[11]  Martin Müller,et al.  PAN - The Prolog Analyzer , 1996, SAS.

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

[13]  Manuel V. Hermenegildo,et al.  Determinacy Analysis for Logic Programs Using Mode and Type Information , 2004, LOPSTR.

[14]  C. R. Ramakrishnan,et al.  Extracting Determinacy in Logic Programs , 1993, ICLP.

[15]  Andy King,et al.  Determinacy Inference for Logic Programs , 2005, ESOP.

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

[17]  Wim Vanhoof,et al.  Offline specialisation in Prolog using a hand-written compiler generator , 2002, Theory and Practice of Logic Programming.