Results 1  10
of
10
Deriving Backtracking Monad Transformers
 In The International Conference on Functional Programming (ICFP
, 2000
"... In a paper about pretty printing J. Hughes introduced two fundamental techniques for deriving programs from their specication, where a specication consists of a signature and properties that the operations of the signature are required to satisfy. Briey, the rst technique, the term implementation, r ..."
Abstract

Cited by 27 (1 self)
 Add to MetaCart
In a paper about pretty printing J. Hughes introduced two fundamental techniques for deriving programs from their specication, where a specication consists of a signature and properties that the operations of the signature are required to satisfy. Briey, the rst technique, the term implementation, represents the operations by terms and works by dening a mapping from operations to observations  this mapping can be seen as dening a simple interpreter. The second, the contextpassing implementation, represents operations as functions from their calling context to observations. We apply both techniques to derive a backtracking monad transformer that adds backtracking to an arbitrary monad. In addition to the usual backtracking operations  failure and nondeterministic choice  the prolog cut and an operation for delimiting the eect of a cut are supported. Categories and Subject Descriptors D.1.1 [Programming Techniques]: Applicative (Functional) Programming; D.3.2 [Programming La...
Automated termination analysis for logic programs with cut
, 2010
"... Termination is an important and wellstudied property for logic programs. However, almost all approaches for automated termination analysis focus on definite logic programs, whereas realworld Prolog programs typically use the cut operator. We introduce a novel preprocessing method which automatica ..."
Abstract

Cited by 24 (13 self)
 Add to MetaCart
Termination is an important and wellstudied property for logic programs. However, almost all approaches for automated termination analysis focus on definite logic programs, whereas realworld Prolog programs typically use the cut operator. We introduce a novel preprocessing method which automatically transforms Prolog programs into logic programs without cuts, where termination of the cutfree program implies termination of the original program. Hence after this preprocessing, any technique for proving termination of definite logic programs can be applied. We implemented this preprocessing in our
Algebra of logic programming
 International Conference on Logic Programming
, 1999
"... At present, the field of declarative programming is split into two main areas based on different formalisms; namely, functional programming, which is based on lambda calculus, and logic programming, which is based on firstorder logic. There are currently several language proposals for integrating th ..."
Abstract

Cited by 20 (3 self)
 Add to MetaCart
At present, the field of declarative programming is split into two main areas based on different formalisms; namely, functional programming, which is based on lambda calculus, and logic programming, which is based on firstorder logic. There are currently several language proposals for integrating the expressiveness of these two models of computation. In this thesis we work towards an integration of the methodology from the two research areas. To this end, we propose an algebraic approach to reasoning about logic programs, corresponding to the approach taken in functional programming. In the first half of the thesis we develop and discuss a framework which forms the basis for our algebraic analysis and transformation methods. The framework is based on an embedding of definite logic programs into lazy functional programs in Haskell, such that both the declarative and the operational semantics of the logic programs are preserved. In spite of its conciseness and apparent simplicity, the embedding proves to have many interesting properties and it gives rise to an algebraic semantics of logic programming. It also allows us to reason about logic programs in a simple calculational style, using rewriting and the algebraic laws of combinators. In the embedding, the meaning of a logic program arises compositionally from the meaning of its constituent subprograms and the combinators that connect them. In the second half of the thesis we explore applications of the embedding to the algebraic transformation of logic programs. A series of examples covers simple program derivations, where our techniques simplify some of the current techniques. Another set of examples explores applications of the more advanced program development techniques from the Algebra of Programming by Bird and de Moor [18], where we expand the techniques currently available for logic program derivation and optimisation. To my parents, Sandor and Erzsebet. And the end of all our exploring Will be to arrive where we started And know the place for the first time.
Prolog's Control Constructs in a Functional . . .
 INTERNATIONAL JOURNAL OF FOUNDATIONS OF COMPUTER SCIENCE
"... The purpose of this article is twofold. First, we show that Prolog's control constructs can be smoothly integrated into a functional language like Haskell. The resulting `language', termed embedded Prolog, incorporates many of the features prescribed by the Prolog ISO standard: control constructs ..."
Abstract

Cited by 13 (5 self)
 Add to MetaCart
The purpose of this article is twofold. First, we show that Prolog's control constructs can be smoothly integrated into a functional language like Haskell. The resulting `language', termed embedded Prolog, incorporates many of the features prescribed by the Prolog ISO standard: control constructs including the cut, all solution collecting functions, and error handling facilities. Embedded Prolog lacks some concepts such as logical variables but it inherits all of Haskell's strengths, eg static polymorphic typing, higher order functions etc. Technically, the integration is achieved using monads and monad transformers. One of the main innovations is the de nition of a backtracking monad transformer, which allows us to combine backtracking with exception handling and interaction. Second, we work towards an axiomatization of the operations, through which the computational features are accessed. Equations are used to lay down the meaning of the various operations and their interrelations enabling the programmer to reason about programs in a simple calculational style. The axiomatization is applied to show that each nite computation has a simple canonical form.
A Logical Semantics for DepthFirst Prolog with Ground Negation
 Theoretical Computer Science
, 1993
"... : A sound and complete semantics is given for sequential, depthfirst logic programming with a version of negation as failure. The semantics is logical in the sense that it is built up only from valuation functions (multivalued logic interpretations in the style of Fitting and Kunen) and logically ..."
Abstract

Cited by 9 (3 self)
 Add to MetaCart
: A sound and complete semantics is given for sequential, depthfirst logic programming with a version of negation as failure. The semantics is logical in the sense that it is built up only from valuation functions (multivalued logic interpretations in the style of Fitting and Kunen) and logicallymotivated equivalence relations between formulas. The notion of predicate folding and unfolding with respect to a program (Tamaki, Sato, Levi et al.) and the universal notion of "disjunctive unfolding" (Andrews) are important elements of this semantics. The negation used is the version which returns an error indication whenever it is invoked on a nonground goal. It is theoretically interesting that this form of negation, along with the lefttoright processing of depthfirst logic programming, can be characterized logically with fourvalued interpretations over an extended alphabet of terms. The fourth truth value, N , can be read operationally as "floundering on negation". The extension of...
RedAlert: Determinacy Inference for Prolog
 UNDER CONSIDERATION FOR PUBLICATION IN THEORY AND PRACTICE OF LOGIC PROGRAMMING
, 2003
"... This paper revisits the problem of determinacy inference addressing the problem of how to uniformly handle cut. To this end a new semantics is introduced for cut, which is abstracted to systematically derive a backward analysis that derives conditions sufficient for a goal to succeed at most once. T ..."
Abstract

Cited by 4 (2 self)
 Add to MetaCart
This paper revisits the problem of determinacy inference addressing the problem of how to uniformly handle cut. To this end a new semantics is introduced for cut, which is abstracted to systematically derive a backward analysis that derives conditions sufficient for a goal to succeed at most once. The method is conceptionally simpler and easier to implement than existing techniques, whilst improving the latter’s handling of cut. Formal arguments substantiate correctness and experimental work, and a tool called ’RedAlert’ demonstrates the method’s generality and applicability.
Deriving Monad Transformers
, 1999
"... In a paper about pretty printing J. Hughes introduced two fundamental techniques for deriving programs from their specification, where a specification consists of a signature and properties that the operations of the signature are required to satisfy. Very briefly, the first technique, the term impl ..."
Abstract

Cited by 2 (0 self)
 Add to MetaCart
In a paper about pretty printing J. Hughes introduced two fundamental techniques for deriving programs from their specification, where a specification consists of a signature and properties that the operations of the signature are required to satisfy. Very briefly, the first technique, the term implementation, represents the operations by terms and works by defining a mapping from operations to observations  this mapping can be seen as defining a simple interpreter. The second, the contextpassing implementation, represents operations as functions from their calling context to observations. We apply both techniques to derive among others a backtracking monad transformer which adds backtracking to an arbitrary monad. In addition to the usual backtracking operations  failure and nondeterministic choice  the prolog cut and an operation for delimiting the effect of a cut are supported. 1 Introduction Why should one derive a program from its specification? Ideally, a derivation ex...
The Witness Properties and the Semantics of the Prolog Cut
, 1999
"... : The semantics of the Prolog "cut" construct is explored in the context of some desirable properties of logic programming systems, referred to as the witness properties. The witness properties concern the operational consistency of responses to queries. A generalization of Prolog with negation as f ..."
Abstract

Cited by 1 (1 self)
 Add to MetaCart
: The semantics of the Prolog "cut" construct is explored in the context of some desirable properties of logic programming systems, referred to as the witness properties. The witness properties concern the operational consistency of responses to queries. A generalization of Prolog with negation as failure and cut is described, and shown not to have the witness properties. A restriction of the system is then described, which preserves the choice and firstsolution behaviour of cut but allows the system to have the witness properties. A static analysis system is described which allows programs to be computed in a more efficient manner under the restricted system. The restricted system is then given an abstract semantics, which depends essentially on the witness properties. Finally, it is shown how the abstract semantics can be used to simplify proofs of properties of programs. Parts of this paper appeared previously in a different form in the Proceedings of the 1995 International Logic ...
Under consideration for publication in Theory and Practice of Logic Programming 1 The Witness Properties and the Semantics of the Prolog Cut
, 2002
"... The semantics of the Prolog “cut ” construct is explored in the context of some desirable properties of logic programming systems, referred to as the witness properties. The witness properties concern the operational consistency of responses to queries. A generalization of Prolog with negation as fa ..."
Abstract
 Add to MetaCart
The semantics of the Prolog “cut ” construct is explored in the context of some desirable properties of logic programming systems, referred to as the witness properties. The witness properties concern the operational consistency of responses to queries. A generalization of Prolog with negation as failure and cut is described, and shown not to have the witness properties. A restriction of the system is then described, which preserves the choice and firstsolution behaviour of cut but allows the system to have the witness properties. The notion of cut in the restricted system is more restricted than the Prolog hard cut, but retains the useful firstsolution behaviour of hard cut, not retained by other proposed cuts such as the “soft cut”. It is argued that the restricted system achieves a good compromise between the power and utility of the Prolog cut and the need for internal consistency in logic programming systems. The restricted system is given an abstract semantics, which depends on the witness properties; this semantics suggests that the restricted system has a deeper connection to logic than simply permitting some computations which are logical. Parts of this paper appeared previously in a different form in the Proceedings of the
Proofs You Can Believe In Proving Equivalences Between Prolog Semantics in Coq
"... Basing program analyses on formal semantics has a long and successful tradition in the logic programming paradigm. These analyses rely on results about the relative correctness of mathematically sophisticated semantics, and authors of such analyses often invest considerable effort into establishing ..."
Abstract
 Add to MetaCart
Basing program analyses on formal semantics has a long and successful tradition in the logic programming paradigm. These analyses rely on results about the relative correctness of mathematically sophisticated semantics, and authors of such analyses often invest considerable effort into establishing these results. The development of interactive theorem provers such as Coq and their recent successes both in the field of program verification as well as in mathematics, poses the question whether these tools can be usefully deployed in logic programming. This paper presents formalisations in Coq of several general results about the correctness of semantics in different styles; forward and backward, topdown and bottomup. The results chosen are paradigmatic of the kind of correctness theorems that semantic analyses rely on and are therefore wellsuited to explore the possibilities afforded by the application of interactive theorem provers to this task, as well as the difficulties likely to be encountered in the endeavour. It turns out that the advantages offered by moving to a functional setting, including the possibility to apply higherorder abstract syntax, are considerable.