Danny De Schreye , Robert Glück , Jesper Jørgensen , Michael Leuschel , Bern Martens , Morten Heine Sørensen
{"title":"Conjunctive partial deduction: foundations, control, algorithms, and experiments","authors":"Danny De Schreye , Robert Glück , Jesper Jørgensen , Michael Leuschel , Bern Martens , Morten Heine Sørensen","doi":"10.1016/S0743-1066(99)00030-8","DOIUrl":"https://doi.org/10.1016/S0743-1066(99)00030-8","url":null,"abstract":"<div><p>Partial deduction in the Lloyd–Shepherdson framework cannot achieve certain optimisations which are possible by unfold/fold transformations. We introduce <em>conjunctive partial deduction</em>, an extension of partial deduction accommodating such optimisations, e.g., tupling and deforestation. We first present a <em>framework for conjunctive partial deduction,</em> extending the Lloyd–Shepherdson framework by considering conjunctions of atoms (instead of individual atoms) for specialisation and renaming. Correctness results are given for the framework with respect to computed answer semantics, least Herbrand model semantics, and finite failure semantics. Maintaining the well-known distinction between local and global control, we describe a <em>basic algorithm</em> for conjunctive partial deduction, and refine it into a <em>concrete algorithm</em> for which we prove termination. The problem of finding suitable renamings which <em>remove redundant arguments</em> turns out to be important, so we give an independent technique for this. A fully automatic <em>implementation</em> has been undertaken, which always terminates. Differences between the abstract semantics and Prolog's left-to-right execution motivate deviations from the abstract technique in the actual implementation, which we discuss. The implementation has been tested on an extensive set of <em>benchmarks</em> which demonstrate that conjunctive partial deduction indeed pays off, surpassing conventional partial deduction on a range of small to medium-size programs, while remaining manageable in an automatic and terminating system.</p></div>","PeriodicalId":101236,"journal":{"name":"The Journal of Logic Programming","volume":"41 2","pages":"Pages 231-277"},"PeriodicalIF":0.0,"publicationDate":"1999-11-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"https://sci-hub-pdf.com/10.1016/S0743-1066(99)00030-8","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"91718022","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"OA","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
{"title":"Synthesis and transformation of logic programs using unfold/fold proofs","authors":"Alberto Pettorossi , Maurizio Proietti","doi":"10.1016/S0743-1066(99)00029-1","DOIUrl":"https://doi.org/10.1016/S0743-1066(99)00029-1","url":null,"abstract":"<div><p>We present a method for proving properties of definite logic programs. This method is called <em>unfold/fold proof method</em> because it is based on the unfold/fold transformation rules. Given a program <em>P</em> and two goals (that is, conjunctions of atoms) <span><math><mtext>F(</mtext><mtext>X</mtext><mtext>,</mtext><mtext>Y</mtext><mtext>)</mtext></math></span> and <span><math><mtext>G(</mtext><mtext>X</mtext><mtext>,</mtext><mtext>Z</mtext><mtext>)</mtext></math></span>, where <span><math><mtext>X</mtext></math></span>, <span><math><mtext>Y</mtext></math></span>, and <span><math><mtext>Z</mtext></math></span> are pairwise disjoint vectors of variables, the unfold/fold proof method can be used to show that the equivalence formula <span><math><mtext>∀</mtext><mtext>X</mtext><mspace></mspace><mtext>(∃</mtext><mtext>Y</mtext><mspace></mspace><mtext>F(</mtext><mtext>X</mtext><mtext>,</mtext><mtext>Y</mtext><mtext>)↔∃</mtext><mtext>Z</mtext><mspace></mspace><mtext>G(</mtext><mtext>X</mtext><mtext>,</mtext><mtext>Z</mtext><mtext>))</mtext></math></span> holds in the least Herbrand model of <em>P</em>. Equivalence formulas of that form can be used to justify goal replacement steps, which allow us to transform logic programs by replacing old goals, such as <span><math><mtext>F(</mtext><mtext>X</mtext><mtext>,</mtext><mtext>Y</mtext><mtext>)</mtext></math></span>, by equivalent new goals, such as <span><math><mtext>G(</mtext><mtext>X</mtext><mtext>,</mtext><mtext>Z</mtext><mtext>)</mtext></math></span>. These goal replacements preserve the least Herbrand model semantics if we find <em>non-ascending</em> unfold/fold proofs of the corresponding equivalence formulas, that is, unfold/fold proofs which ensure suitable well-founded orderings between the successful SLD-derivations of <span><math><mtext>F(</mtext><mtext>X</mtext><mtext>,</mtext><mtext>Y</mtext><mtext>)</mtext></math></span> and <span><math><mtext>G(</mtext><mtext>X</mtext><mtext>,</mtext><mtext>Z</mtext><mtext>)</mtext></math></span>, respectively. We also present a method for <em>program synthesis from implicit definitions</em>. It can be used to derive a definite logic program for the predicate <em>newp</em> implicitly defined by an equivalence formula of the form <span><math><mtext>∀</mtext><mspace></mspace><mtext>X</mtext><mtext>(∃</mtext><mtext>Y</mtext><mspace></mspace><mtext>F(</mtext><mtext>X</mtext><mtext>,</mtext><mtext>Y</mtext><mtext>)↔∃</mtext><mtext>Z</mtext><mspace></mspace><mtext>(H(</mtext><mtext>X</mtext><mtext>,</mtext><mtext>Z</mtext><mtext>),newp(</mtext><mtext>X</mtext><mtext>,</mtext><mtext>Z</mtext><mtext>)))</mtext></math></span>, such that the predicates occurring in the goals <span><math><mtext>F(</mtext><mtext>X</mtext><mtext>,</mtext><mtext>Y</mtext><mtext>)</mtext></math></span> and <span><math><mtext>H(</mtext><mtext>X</mtext><mtext>,</mtext><mtext>Z</mtext><mtext>)</mtext></math></span> are defined in a given program <em>P</em>, and <em>newp</em> is a","PeriodicalId":101236,"journal":{"name":"The Journal of Logic Programming","volume":"41 2","pages":"Pages 197-230"},"PeriodicalIF":0.0,"publicationDate":"1999-11-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"https://sci-hub-pdf.com/10.1016/S0743-1066(99)00029-1","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"91718030","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"OA","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
{"title":"Abstract multiple specialization and its application to program parallelization","authors":"German Puebla, Manuel Hermenegildo","doi":"10.1016/S0743-1066(99)00031-X","DOIUrl":"https://doi.org/10.1016/S0743-1066(99)00031-X","url":null,"abstract":"<div><p>Program specialization optimizes programs for known values of the input. It is often the case that the set of possible input values is unknown, or this set is infinite. However, a form of specialization can still be performed in such cases by means of abstract interpretation, specialization then being with respect to abstract values (substitutions), rather than concrete ones. We study the multiple specialization of logic programs based on abstract interpretation. This involves in principle, and based on information from global analysis, generating several versions of a program predicate for different uses of such predicate, optimizing these versions, and, finally, producing a new, “multiply specialized” program. While multiple specialization has received theoretical attention, little previous evidence exists on its practicality. In this paper, we report on the incorporation of multiple specialization in a parallelizing compiler and quantify its effects. A novel approach to the design and implementation of the specialization system is proposed. The resulting implementation techniques result in identical specializations to those of the best previously proposed techniques but require little or no modification of some existing abstract interpreters. Our results show that, using the proposed techniques, the resulting “abstract multiple specialization” is indeed a relevant technique in practice. In particular, in the parallelizing compiler application, a good number of run-time tests are eliminated and invariants extracted automatically from loops, resulting generally in lower overheads and in several cases in increased speedups.</p></div>","PeriodicalId":101236,"journal":{"name":"The Journal of Logic Programming","volume":"41 2","pages":"Pages 279-316"},"PeriodicalIF":0.0,"publicationDate":"1999-11-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"https://sci-hub-pdf.com/10.1016/S0743-1066(99)00031-X","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"91651282","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"OA","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
{"title":"A pragmatic reconstruction of λProlog","authors":"Catherine Belleannée , Pascal Brisset , Olivier Ridoux","doi":"10.1016/S0743-1066(98)10038-9","DOIUrl":"10.1016/S0743-1066(98)10038-9","url":null,"abstract":"<div><p><em>λ</em>Prolog is a logic programming language in which hereditary Harrop formulas generalize Horn formulas, and simply typed <em>λ</em>-terms generalize Prolog terms. One may wonder if these extensions are simultaneously required, and if useful subsets of <em>λ</em>Prologcan be defined, at least for pedagogical purposes. We answer this question by exhibiting a network of necessity links between the new features of <em>λ</em>Prolog. The starting point of the network is the demand for programming by structural induction on <em>λ</em>-terms, and the necessity links give a rationale for such a programming style.</p></div>","PeriodicalId":101236,"journal":{"name":"The Journal of Logic Programming","volume":"41 1","pages":"Pages 67-102"},"PeriodicalIF":0.0,"publicationDate":"1999-10-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"https://sci-hub-pdf.com/10.1016/S0743-1066(98)10038-9","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"133835436","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"OA","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
{"title":"On the Floyd–Warshall algorithm for logic programs","authors":"Christos Papadimitriou , Martha Sideri","doi":"10.1016/S0743-1066(99)00013-8","DOIUrl":"10.1016/S0743-1066(99)00013-8","url":null,"abstract":"<div><p>We explore the possibility of evaluating single-rule Datalog programs efficiently and with logarithmic work space by a natural extension of the Floyd–Warshall algorithm for transitive closure. We characterize exactly the single rule chain programs that can be so evaluated – they are rather modest generalizations of the transitive closure. The proof relies on an interesting language-theoretic concept, <em>total ambiguity</em>. Extensions to more general classes of programs, and more general algorithms, are discussed.</p></div>","PeriodicalId":101236,"journal":{"name":"The Journal of Logic Programming","volume":"41 1","pages":"Pages 129-137"},"PeriodicalIF":0.0,"publicationDate":"1999-10-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"https://sci-hub-pdf.com/10.1016/S0743-1066(99)00013-8","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"125840261","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"OA","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
{"title":"Stable generated models, partial temporal logic and disjunctive defaults","authors":"Joeri Engelfriet , Heinrich Herre","doi":"10.1016/S0743-1066(99)00008-4","DOIUrl":"10.1016/S0743-1066(99)00008-4","url":null,"abstract":"<div><p>Stable generated models for extended generalized logic programs with two kinds of negation provide a semantics for logic programming in its (up to now) most general form. We show that stable generated semantics for extended logic programs coincides with the semantics obtained by translating programs into a minimal partial temporal logic. Then we introduce several new versions of (disjunctive) default logic and show that there are strong (semantical) connections between default logic and logic programming with stable generated models.</p></div>","PeriodicalId":101236,"journal":{"name":"The Journal of Logic Programming","volume":"41 1","pages":"Pages 1-25"},"PeriodicalIF":0.0,"publicationDate":"1999-10-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"https://sci-hub-pdf.com/10.1016/S0743-1066(99)00008-4","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"123941680","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"OA","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
{"title":"A semantic basis for the termination analysis of logic programs","authors":"Michael Codish, Cohavit Taboch","doi":"10.1016/S0743-1066(99)00006-0","DOIUrl":"10.1016/S0743-1066(99)00006-0","url":null,"abstract":"<div><p>This paper presents a formal semantic basis for the termination analysis of logic programs. The semantics exhibits the termination properties of a logic program through its <em>binary unfoldings</em> — a possibly infinite set of binary clauses. Termination of a program <strong>P</strong> and goal <strong>G</strong> is determined by the absence of an infinite chain in the binary unfoldings of <strong>P</strong> starting with <strong>G</strong>. The result is of practical use as basing termination analysis on a formal semantics facilitates both the design and implementation of analyzers. A simple Prolog interpreter for binary unfoldings coupled with an abstract domain based on symbolic norm constraints is proposed as an implementation vehicle. We illustrate its application using two recently proposed abstract domains. Both the techniques are implemented using a standard CLP(R) library. The combination of an interpreter for binary unfoldings and a constraint solver simplifies the design of the analyzer and improves its efficiency significantly.</p></div>","PeriodicalId":101236,"journal":{"name":"The Journal of Logic Programming","volume":"41 1","pages":"Pages 103-123"},"PeriodicalIF":0.0,"publicationDate":"1999-10-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"https://sci-hub-pdf.com/10.1016/S0743-1066(99)00006-0","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"134417053","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"OA","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
{"title":"Worst-case groundness analysis using positive Boolean functions","authors":"Michael Codish","doi":"10.1016/S0743-1066(99)00014-X","DOIUrl":"10.1016/S0743-1066(99)00014-X","url":null,"abstract":"<div><p>This note illustrates a theoretical worst-case scenario for groundness analyses obtained through abstract interpretation over the abstract domain of positive Boolean functions. A sequence of programs is given for which any <em>Pos</em>-based abstract interpretation for groundness analysis follows an exponential chain. Another sequence of programs is given for which a state-of-the-art implementation based on ROBDDs gives a result of exponential size in only three iterations. The moral of the story is that a serious <em>Pos</em> analyser must incorporate some form of widening to protect itself from the inherent complexity of the underlying domain.</p></div>","PeriodicalId":101236,"journal":{"name":"The Journal of Logic Programming","volume":"41 1","pages":"Pages 125-128"},"PeriodicalIF":0.0,"publicationDate":"1999-10-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"https://sci-hub-pdf.com/10.1016/S0743-1066(99)00014-X","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"116789066","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"OA","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}