Pub Date : 1999-07-01DOI: 10.1016/S0743-1066(98)10029-8
J.C. González-Moreno, M.T. Hortalá-González, F.J. López-Fraguas, M. Rodríguez-Artalejo
We propose an approach to declarative programming which integrates the functional and relational paradigms by taking possibly non-deterministic lazy functions as the fundamental notion. Classical equational logic does not supply a suitable semantics in a natural way. Therefore, we suggest to view programs as theories in a constructor-based conditional rewriting logic. We present proof calculi and a model theory for this logic, and we prove the existence of free term models which provide an adequate intended semantics for programs. We develop a sound and strongly complete lazy narrowing calculus, which is able to support sharing without the technical overhead of graph rewriting and to identify safe cases for eager variable elimination. Moreover, we give some illustrative programming examples, and we discuss the implementability of our approach.
{"title":"An approach to declarative programming based on a rewriting logic","authors":"J.C. González-Moreno, M.T. Hortalá-González, F.J. López-Fraguas, M. Rodríguez-Artalejo","doi":"10.1016/S0743-1066(98)10029-8","DOIUrl":"https://doi.org/10.1016/S0743-1066(98)10029-8","url":null,"abstract":"<div><p>We propose an approach to declarative programming which integrates the functional and relational paradigms by taking possibly non-deterministic lazy functions as the fundamental notion. Classical equational logic does not supply a suitable semantics in a natural way. Therefore, we suggest to view programs as theories in a constructor-based conditional rewriting logic. We present proof calculi and a model theory for this logic, and we prove the existence of free term models which provide an adequate intended semantics for programs. We develop a sound and strongly complete lazy narrowing calculus, which is able to support sharing without the technical overhead of graph rewriting and to identify safe cases for eager variable elimination. Moreover, we give some illustrative programming examples, and we discuss the implementability of our approach.</p></div>","PeriodicalId":101236,"journal":{"name":"The Journal of Logic Programming","volume":"40 1","pages":"Pages 47-87"},"PeriodicalIF":0.0,"publicationDate":"1999-07-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"https://sci-hub-pdf.com/10.1016/S0743-1066(98)10029-8","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"91725915","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}
Pub Date : 1999-07-01DOI: 10.1016/S0743-1066(98)10030-4
Stefan Brass , Jürgen Dix
We present a new and general approach for defining, understanding, and computing logic programming semantics. We consider disjunctive programs for generality, but our results are still interesting if specialized to normal programs. Our framework consists of two parts: (a) a semantical, where semantics are defined in an abstract way as the weakest semantics satisfying certain properties, and (b) a procedural, namely a bottom-up query evaluation method based on operators working on conditional facts. As to (a), we concentrate in this paper on a particular set of abstract properties (the most important being the unfolding or partial evaluation property GPPE) and define a new semantics D-WFS, which extends WFS and GCWA. We also mention that various other semantics, like Fitting's comp3, Schipf's WFSc, Gelfond and lifschitz' STABLE and Ross and Topor's WGCWA (also introduced independently by Rajasekar et al. (A. Rajasekar, J. Lobo, J. Minker, Journal of Automated Reasoning 5 (1989) 293–307)), can be captured in our framework. In (b) we compute for any program P a residual program res(P), and show that res(P) is equivalent to the original program under very general conditions on the semantics (which are satisfied, e.g., by the well-founded, stable, stationary, and static semantics). Many queries with respect to these semantics can already be answered on the basis of the residual program. In fact, res(P) is complete for D-WFS, WFS and GCWA.
我们提出了一种新的通用方法来定义、理解和计算逻辑编程语义。我们考虑析取程序的普遍性,但我们的结果仍然是有趣的,如果专门针对普通程序。我们的框架由两部分组成:(a)语义,其中语义以抽象的方式定义为满足某些属性的最弱语义,以及(b)过程,即基于操作符的自下而上的查询评估方法。对于(a),我们在本文中集中讨论了一组特定的抽象属性(最重要的是展开或部分求值属性GPPE),并定义了一个新的语义D-WFS,它扩展了WFS和GCWA。我们还提到了各种其他语义,如Fitting的comp3, Schipf的WFSc, Gelfond和lifschitz的STABLE以及Ross和Topor的WGCWA(也由Rajasekar等人独立引入(A. Rajasekar, J. Lobo, J. Minker, Journal of Automated Reasoning 5(1989) 293-307))),可以在我们的框架中捕获。在(b)中,我们计算了任意程序P的残差程序res(P),并证明res(P)在非常一般的语义条件下等价于原程序(例如,由良好的、稳定的、平稳的和静态的语义所满足)。关于这些语义的许多查询已经可以在残差程序的基础上得到回答。实际上,res(P)对于D-WFS、WFS和GCWA是完整的。
{"title":"Semantics of (disjunctive) logic programs based on partial evaluation","authors":"Stefan Brass , Jürgen Dix","doi":"10.1016/S0743-1066(98)10030-4","DOIUrl":"https://doi.org/10.1016/S0743-1066(98)10030-4","url":null,"abstract":"<div><p>We present a new and general approach for defining, understanding, and computing logic programming semantics. We consider disjunctive programs for generality, but our results are still interesting if specialized to normal programs. Our framework consists of two parts: (a) a <em>semantical</em>, where semantics are defined in an abstract way as the <em>weakest</em> semantics satisfying certain properties, and (b) a <em>procedural</em>, namely a bottom-up query evaluation method based on operators working on <em>conditional facts</em>. As to (a), we concentrate in this paper on a particular set of abstract properties (the most important being the <em>unfolding</em> or <em>partial evaluation property</em> GPPE) and define a new semantics D-WFS, which extends WFS and GCWA. We also mention that various other semantics, like Fitting's comp<sub>3</sub>, Schipf's WFS<sub>c</sub>, Gelfond and lifschitz' STABLE and Ross and Topor's WGCWA (also introduced independently by Rajasekar et al. (A. Rajasekar, J. Lobo, J. Minker, Journal of Automated Reasoning 5 (1989) 293–307)), can be captured in our framework. In (b) we compute for any program <em>P</em> a residual program <em>res(P)</em>, and show that <em>res(P)</em> is equivalent to the original program under very general conditions on the semantics (which are satisfied, e.g., by the well-founded, stable, stationary, and static semantics). Many queries with respect to these semantics can already be answered on the basis of the residual program. In fact, <em>res(P)</em> is <em>complete</em> for D-WFS, WFS and GCWA.</p></div>","PeriodicalId":101236,"journal":{"name":"The Journal of Logic Programming","volume":"40 1","pages":"Pages 1-46"},"PeriodicalIF":0.0,"publicationDate":"1999-07-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"https://sci-hub-pdf.com/10.1016/S0743-1066(98)10030-4","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"90028483","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}
Pub Date : 1999-07-01DOI: 10.1016/S0743-1066(98)10039-0
Paqui Lucio, Fernado Orejas, Elvira Pino
The aim of our work is the definition of compositional semantics for modular units over the class of normal logic programs. In this sense, we propose a declarative semantics for normal logic programs in terms of model classes that is monotonic in the sense that , for any programs P and P′ and we show that in the model class associated to every program there is a least model that can be seen as the semantics of the program, which may be built upwards as the least fix point of a continuous immediate consequence operator. In addition, it is proved that this least model is “typical” for the class of models of Clark-Kunen's completion of the program. This means that our semantics is equivalent to Clark-Kunen's completion. Moreover, following the approach defined in a previous paper, it is shown that our semantics constitutes a “specification frame ” equipped with the adequate categorical constructions needed to define compositional and fully abstract (categorical) semantics for a number of program units. In particular, we provide a categorical semantics of arbitrary normal logic program fragments which is compositional and fully abstract with respect to the (standard) union.
{"title":"An algebraic framework for the definition of compositional semantics of normal logic programs","authors":"Paqui Lucio, Fernado Orejas, Elvira Pino","doi":"10.1016/S0743-1066(98)10039-0","DOIUrl":"https://doi.org/10.1016/S0743-1066(98)10039-0","url":null,"abstract":"<div><p>The aim of our work is the definition of compositional semantics for modular units over the class of normal logic programs. In this sense, we propose a declarative semantics for normal logic programs in terms of model classes that is monotonic in the sense that <span><math><mtext>Mod</mtext><mtext>(P∪P′) ⊆ </mtext><mtext>Mod</mtext><mtext>(P)</mtext></math></span>, for any programs <em>P</em> and <em>P</em>′ and we show that in the model class associated to every program there is a least model that can be seen as the semantics of the program, which may be built upwards as the least fix point of a continuous immediate consequence operator. In addition, it is proved that this least model is “typical” for the class of models of Clark-Kunen's completion of the program. This means that our semantics is equivalent to Clark-Kunen's completion. Moreover, following the approach defined in a previous paper, it is shown that our semantics constitutes a “specification frame ” equipped with the adequate categorical constructions needed to define compositional and fully abstract (categorical) semantics for a number of program units. In particular, we provide a categorical semantics of arbitrary normal logic program fragments which is compositional and fully abstract with respect to the (standard) union.</p></div>","PeriodicalId":101236,"journal":{"name":"The Journal of Logic Programming","volume":"40 1","pages":"Pages 89-123"},"PeriodicalIF":0.0,"publicationDate":"1999-07-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"https://sci-hub-pdf.com/10.1016/S0743-1066(98)10039-0","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"91725916","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}
Pub Date : 1999-04-01DOI: 10.1016/S0743-1066(98)10035-3
Dino Pedreschi, Salvatore Ruggieri
We present a proof method in the style of Hoare's logic, aimed at providing a unifying framework for the verification of total correctness of logic and Prolog programs. The method, which relies on purely declarative reasoning, has been designed as a trade-off between expresiveness and ease of use. On the basis of a few simple principles, we reason uniformly on several properties of logic and Prolog programs, including partial correctness, call patterns, absence of run-time errors, safe omission of the occur-check, computed instances, termination and modula program development. We finally generalize the method to general programs.
{"title":"Verification of logic programs","authors":"Dino Pedreschi, Salvatore Ruggieri","doi":"10.1016/S0743-1066(98)10035-3","DOIUrl":"10.1016/S0743-1066(98)10035-3","url":null,"abstract":"<div><p>We present a proof method in the style of Hoare's logic, aimed at providing a unifying framework for the verification of <em>total</em> correctness of logic and Prolog programs. The method, which relies on purely declarative reasoning, has been designed as a trade-off between expresiveness and ease of use. On the basis of a few simple principles, we reason uniformly on several properties of logic and Prolog programs, including partial correctness, call patterns, absence of run-time errors, safe omission of the occur-check, computed instances, termination and modula program development. We finally generalize the method to general programs.</p></div>","PeriodicalId":101236,"journal":{"name":"The Journal of Logic Programming","volume":"39 1","pages":"Pages 125-176"},"PeriodicalIF":0.0,"publicationDate":"1999-04-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"https://sci-hub-pdf.com/10.1016/S0743-1066(98)10035-3","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"130488317","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}
Pub Date : 1999-04-01DOI: 10.1016/S0743-1066(98)10033-X
Marco Comini , Giorgio Levi , Maria Chiara Meo , Giuliana Vitiello
We show how declarative diagnosis techniques can be extended to cope with verification of operational properties, such as computed and correct answers, and of abstract properties, such as depth(k) answers and groundness dependencies. The extension is achieved by using a simple semantic framework, based on abstract interpretation. The resulting technique (abstract diagnosis) leads to elegant bottom-up and top-down verification methods, which do not require to determine the symptoms in advance, and which are effective in the case of abstract properties described by finite domains.
{"title":"Abstract diagnosis","authors":"Marco Comini , Giorgio Levi , Maria Chiara Meo , Giuliana Vitiello","doi":"10.1016/S0743-1066(98)10033-X","DOIUrl":"10.1016/S0743-1066(98)10033-X","url":null,"abstract":"<div><p>We show how declarative diagnosis techniques can be extended to cope with verification of operational properties, such as computed and correct answers, and of abstract properties, such as <em>depth(k)</em> answers and groundness dependencies. The extension is achieved by using a simple semantic framework, based on abstract interpretation. The resulting technique (abstract diagnosis) leads to elegant bottom-up and top-down verification methods, which do not require to determine the symptoms in advance, and which are effective in the case of abstract properties described by finite domains.</p></div>","PeriodicalId":101236,"journal":{"name":"The Journal of Logic Programming","volume":"39 1","pages":"Pages 43-93"},"PeriodicalIF":0.0,"publicationDate":"1999-04-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"https://sci-hub-pdf.com/10.1016/S0743-1066(98)10033-X","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"114347905","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}
Pub Date : 1999-04-01DOI: 10.1016/S0743-1066(98)10036-5
Mireille Ducassé
Traces of program executions are a helpful source of information for program debugging. They, however, give a picture of program executions at such a low level that users often have difficulties to interpret the information. Opium, our extendable trace analyzer, is connected to a “standard” Prolog tracer. Opium is programmable and extendable. It provides a trace query language and abstract views of executions. Users can therefore examine program executions at the levels of abstraction which suit them. Opium has shown its capabilities to build abstract tracers and automated debugging facilities. This article describes in depth the trace query mechanism, from the model to its implementation. Characteristic examples are detailed. Extensions written so far on top of the trace query mechanism are listed. Two recent extensions are presented: the abstract tracers for the LO (Linear Objects) and the CHR (Constraint Handling Rules) languages. These two extensions were specified and implemented within a few days. They show how to use Opium for real applications.
{"title":"Opium: an extendable trace analyzer for Prolog","authors":"Mireille Ducassé","doi":"10.1016/S0743-1066(98)10036-5","DOIUrl":"10.1016/S0743-1066(98)10036-5","url":null,"abstract":"<div><p>Traces of program executions are a helpful source of information for program debugging. They, however, give a picture of program executions at such a low level that users often have difficulties to interpret the information. Opium, our extendable trace analyzer, is connected to a “standard” Prolog tracer. Opium is programmable and extendable. It provides a trace query language and abstract views of executions. Users can therefore examine program executions at the levels of abstraction which suit them. Opium has shown its capabilities to build abstract tracers and automated debugging facilities. This article describes in depth the trace query mechanism, from the model to its implementation. Characteristic examples are detailed. Extensions written so far on top of the trace query mechanism are listed. Two recent extensions are presented: the abstract tracers for the LO (Linear Objects) and the CHR (Constraint Handling Rules) languages. These two extensions were specified and implemented within a few days. They show how to use Opium for real applications.</p></div>","PeriodicalId":101236,"journal":{"name":"The Journal of Logic Programming","volume":"39 1","pages":"Pages 177-223"},"PeriodicalIF":0.0,"publicationDate":"1999-04-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"https://sci-hub-pdf.com/10.1016/S0743-1066(98)10036-5","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"114613872","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}
Pub Date : 1999-04-01DOI: 10.1016/S0743-1066(98)10032-8
Baudouin Le Charlier, Christophe Leclère, Sabina Rossi, Agostino Cortesi
Although Prolog is (still) the most widely used logic language, it suffers from a number of drawbacks which prevent it from being truely declarative. The nondeclarative features such as the depth-first search rule are nevertheless necessary to make Prolog reasonably efficient. Several authors have proposed methodologies to reconcile declarative programming with the algorithmic features of Prolog. The idea is to analyse the logic program with respect to a set of properties such as modes, types, sharing, termination, and the like in order to ensure that the operational behaviour of the Prolog program complies with its logic meaning. Such analyses are tedious to perform by hand and can be automated to some extent. This paper presents a state-of-the-art analyser which allows one to integrate many individual analyses previously proposed in the literature as well as new ones. Conceptually, the analyser is based on the notion of abstract sequence which makes it possible to collect all kinds of desirable information, including relations between the input and output sizes of terms, multiplicity, and termination.
{"title":"Automated verification of Prolog programs","authors":"Baudouin Le Charlier, Christophe Leclère, Sabina Rossi, Agostino Cortesi","doi":"10.1016/S0743-1066(98)10032-8","DOIUrl":"10.1016/S0743-1066(98)10032-8","url":null,"abstract":"<div><p>Although Prolog is (still) the most widely used logic language, it suffers from a number of drawbacks which prevent it from being truely declarative. The nondeclarative features such as the depth-first search rule are nevertheless necessary to make Prolog reasonably efficient. Several authors have proposed methodologies to reconcile declarative programming with the algorithmic features of Prolog. The idea is to analyse the logic program with respect to a set of properties such as modes, types, sharing, termination, and the like in order to ensure that the operational behaviour of the Prolog program complies with its logic meaning. Such analyses are tedious to perform by hand and can be automated to some extent. This paper presents a state-of-the-art analyser which allows one to integrate many individual analyses previously proposed in the literature as well as new ones. Conceptually, the analyser is based on the notion of abstract sequence which makes it possible to collect all kinds of desirable information, including relations between the input and output sizes of terms, multiplicity, and termination.</p></div>","PeriodicalId":101236,"journal":{"name":"The Journal of Logic Programming","volume":"39 1","pages":"Pages 3-42"},"PeriodicalIF":0.0,"publicationDate":"1999-04-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"https://sci-hub-pdf.com/10.1016/S0743-1066(98)10032-8","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"126296396","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}
Pub Date : 1999-04-01DOI: 10.1016/S0743-1066(98)10037-7
Sandro Etalle , Maurizio Gabbrielli
Modes were introduced in logic programming to differentiate the input arguments of a predicate from its output arguments. This information can be used for verifying the most diverse properties of logic programs notably absence of run-time errors and absence of dead-locks in presence of delay declarations. We introduce here layered modes, an extension of existing mode systems which allow us to enlarge the class of programs which can be verified by using modes. In particular, we show that this extension allows us to better handle programs that employ a dynamic selection rule and programs that use incomplete data structures such as difference-lists.
{"title":"Layered modes","authors":"Sandro Etalle , Maurizio Gabbrielli","doi":"10.1016/S0743-1066(98)10037-7","DOIUrl":"10.1016/S0743-1066(98)10037-7","url":null,"abstract":"<div><p>Modes were introduced in logic programming to differentiate the input arguments of a predicate from its output arguments. This information can be used for verifying the most diverse properties of logic programs notably absence of run-time errors and absence of dead-locks in presence of delay declarations. We introduce here <em>layered modes</em>, an extension of existing mode systems which allow us to enlarge the class of programs which can be verified by using modes. In particular, we show that this extension allows us to better handle programs that employ a dynamic selection rule and programs that use incomplete data structures such as difference-lists.</p></div>","PeriodicalId":101236,"journal":{"name":"The Journal of Logic Programming","volume":"39 1","pages":"Pages 225-244"},"PeriodicalIF":0.0,"publicationDate":"1999-04-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"https://sci-hub-pdf.com/10.1016/S0743-1066(98)10037-7","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"128473247","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}