A Productivity Checker for Logic Programming

Automated analysis of recursive derivations in logic programming is known to be a hard problem. Both termination and non-termination are undecidable problems in Turing-complete languages. However, some declarative languages offer a practical work-around for this problem, by making a clear distinction between whether a program is meant to be understood inductively or coinductively. For programs meant to be understood inductively, termination must be guaranteed, whereas for programs meant to be understood coinductively, productive non-termination (or "productivity") must be ensured. In practice, such classification helps to better understand and implement some non-terminating computations. Logic programming was one of the first declarative languages to make this distinction: in the 1980's, Lloyd and van Emden's "computations at infinity" captured the big-step operational semantics of derivations that produce infinite terms as answers. In modern terms, computations at infinity describe "global productivity" of computations in logic programming. Most programming languages featuring coinduction also provide an observational, or small-step, notion of productivity as a computational counterpart to global productivity. This kind of productivity is ensured by checking that finite initial fragments of infinite computations can always be observed to produce finite portions of their infinite answer terms. In this paper we introduce a notion of observational productivity for logic programming as an algorithmic approximation of global productivity, give an effective procedure for semi-deciding observational productivity, and offer an implemented automated observational productivity checker for logic programs.

[1]  Patricia Johann,et al.  Structural Resolution: a Framework for Coinductive Proof Search and Proof Construction in Horn Clause Logic , 2015, ArXiv.

[2]  Jasmin Christian Blanchette,et al.  A Decision Procedure for (Co)datatypes in SMT Solvers , 2016, Journal of Automated Reasoning.

[3]  Danny De Schreye,et al.  Termination of Logic Programs: The Never-Ending Story , 1994, J. Log. Program..

[4]  Bruno Courcelle,et al.  Fundamental Properties of Infinite Trees , 1983, Theor. Comput. Sci..

[5]  Nao Hirokawa,et al.  Dependency Pairs Revisited , 2004, RTA.

[6]  Jürgen Giesl,et al.  Termination Analysis of Logic Programs Based on Dependency Graphs , 2007, LOPSTR.

[7]  Jürgen Giesl,et al.  Termination of term rewriting using dependency pairs , 2000, Theor. Comput. Sci..

[8]  Jürgen Giesl,et al.  Automated Termination Analysis for Logic Programs by Term Rewriting , 2006, LOPSTR.

[9]  Ekaterina Komendantskaya,et al.  Operational semantics of resolution and productivity in Horn clause logic , 2016, Formal Aspects of Computing.

[10]  Frank Pfenning,et al.  Mode and Termination Checking for Higher-Order Logic Programs , 1996, ESOP.

[11]  Patricia Johann,et al.  Structural Resolution for Logic Programming , 2015, ICLP.

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

[13]  Jan Willem Klop,et al.  Productivity of stream definitions , 2007, Theor. Comput. Sci..

[14]  Enno Ohlebusch,et al.  Term Rewriting Systems , 2002 .

[15]  Martin Schmidt,et al.  Coalgebraic logic programming: from Semantics to Implementation , 2013, J. Log. Comput..

[16]  Gopal Gupta,et al.  Coinductive Logic Programming and Its Applications , 2007, ICLP.

[17]  Gopal Gupta,et al.  Co-Logic Programming: Extending Logic Programming with Coinduction , 2007, ICALP.

[18]  Frank Pfenning,et al.  Types in Logic Programming , 1992, ICLP.

[19]  Martin Schmidt,et al.  Exploiting Parallelism in Coalgebraic Logic Programming , 2013, WACT.

[20]  Alexandra Silva,et al.  A Coinductive Framework for Infinitary Rewriting and Equational Reasoning , 2015, RTA.

[21]  K. Rustan M. Leino,et al.  Co-induction Simply - Automatic Co-inductive Proofs in a Program Verifier , 2014, FM.