Results 1 - 10
of
26
Lazy Narrowing in a Graph Machine
, 1990
"... The paper investigates the implementation of lazy narrowing in the framework of a graph reduction machine. By extending an appropriate architecture for purely functional languages an abstract graph narrowing machine for a functional logic language is constructed. The machine is capable of perform ..."
Abstract
-
Cited by 36 (4 self)
- Add to MetaCart
The paper investigates the implementation of lazy narrowing in the framework of a graph reduction machine. By extending an appropriate architecture for purely functional languages an abstract graph narrowing machine for a functional logic language is constructed. The machine is capable of performing unification and backtracking.
Specialization of Lazy Functional Logic Programs
- IN PROC. OF THE ACM SIGPLAN CONF. ON PARTIAL EVALUATION AND SEMANTICS-BASED PROGRAM MANIPULATION, PEPM'97, VOLUME 32, 12 OF SIGPLAN NOTICES
, 1997
"... Partial evaluation is a method for program specialization based on fold/unfold transformations [8, 25]. Partial evaluation of pure functional programs uses mainly static values of given data to specialize the program [15, 44]. In logic programming, the so-called static/dynamic distinction is hard ..."
Abstract
-
Cited by 36 (22 self)
- Add to MetaCart
Partial evaluation is a method for program specialization based on fold/unfold transformations [8, 25]. Partial evaluation of pure functional programs uses mainly static values of given data to specialize the program [15, 44]. In logic programming, the so-called static/dynamic distinction is hardly present, whereas considerations of determinacy and choice points are far more important for control [12]. We discuss these issues in the context of a (lazy) functional logic language. We formalize a two-phase specialization method for a non-strict, first order, integrated language which makes use of lazy narrowing to specialize the program w.r.t. a goal. The basic algorithm (first phase) is formalized as an instance of the framework for the partial evaluation of functional logic programs of [2, 3], using lazy narrowing. However, the results inherited by [2, 3] mainly regard the termination of the PE method, while the (strong) soundness and completeness results must be restated for the lazy strategy. A post-processing renaming scheme (second phase) is necessary which we describe and illustrate on the well-known matching example. This phase is essential also for other non-lazy narrowing strategies, like innermost narrowing, and our method can be easily extended to these strategies. We show that our method preserves the lazy narrowing semantics and that the inclusion of simplification steps in narrowing derivations can improve control during specialization.
The Integration of Functions into Logic Programming: A Survey
, 1994
"... Functional and logic programming are the most important declarative programming paradigms, and interest in combining them has grown over the last decade. Early research concentrated on the definition and improvement of execution principles for such integrated languages, while more recently efficient ..."
Abstract
-
Cited by 34 (0 self)
- Add to MetaCart
Functional and logic programming are the most important declarative programming paradigms, and interest in combining them has grown over the last decade. Early research concentrated on the definition and improvement of execution principles for such integrated languages, while more recently efficient implementations of these execution principles have been developed so that these languages became relevant for practical applications. In this paper we survey the development of the operational semantics as well as
Efficient Translation of Lazy Functional Logic Programs into Prolog
- In Proc. Fifth International Workshop on Logic Program Synthesis and Transformation
, 1995
"... Abstract. In this paper, we present a high-level implementation of lazy functional logic programs by transforming them into Prolog programs. The transformation is controlled by generalized definitional trees which specify the narrowing strategy to be implemented. Since we consider a sophisticated na ..."
Abstract
-
Cited by 31 (16 self)
- Add to MetaCart
Abstract. In this paper, we present a high-level implementation of lazy functional logic programs by transforming them into Prolog programs. The transformation is controlled by generalized definitional trees which specify the narrowing strategy to be implemented. Since we consider a sophisticated narrowing strategy, a direct mapping of functions into predicates is not possible. Therefore, we present new techniques to reduce the interpretational overhead of the generated Prolog code. This leads to a portable and efficient implementation of functional logic programs. 1 Introduction In recent years, a lot of proposals have been made to amalgamate functional and logic programming languages [15]. Functional logic languages with a sound and complete operational semantics are based on narrowing, a combination of the reduction principle of functional languages and the resolution principle of logic languages. Narrowing, originally introduced in automated theorem proving [26], is used to solve equations by finding appropriate values for variables occurring in arguments of functions. A narrowing step instantiates some variables in a goal and applies a reduction step to a redex of the instantiated goal. The instantiation of goal variables is usually computed by unifying a subterm of the goal with the left-hand side of some rule. Example 1. Consider the following rules defining the addition and comparison of natural numbers which are represented by terms built from 0 and s:
Efficient Lazy Narrowing using Demandedness Analysis
- In Proc. of the 5th International Symposium on Programming Language Implementation and Logic Programming
, 1993
"... Functional logic programming languages have a functional syntax and use narrowing as operational semantics. Here we consider the efficient implementation of lazy narrowing, a strategy which only evaluates the arguments of a function application, if their evaluation is really demanded. For an effi ..."
Abstract
-
Cited by 22 (8 self)
- Add to MetaCart
Functional logic programming languages have a functional syntax and use narrowing as operational semantics. Here we consider the efficient implementation of lazy narrowing, a strategy which only evaluates the arguments of a function application, if their evaluation is really demanded. For an efficient implementation of lazy narrowing it is crucial to evaluate the arguments as early as possible. Otherwise the arguments are frequently reevaluated. A demandedness analysis is used to detect which parts of the arguments can safely be evaluated before the call to the function. Several approaches (e.g. [HLW92, JMM92]) also use this idea, but they sacrify laziness in order to avoid inefficiency. Our approach is more lazy than the previous approaches, and it uses a more powerful notion of demandedness, which allows to express infinite demand patterns like e.g. spine normal form. Moreover, in contrast to the previous approaches, we take into account dependencies between the arguments o...
Implementation of Narrowing: The Prolog-Based Approach
- Logic programming languages: constraints, functions, and objects
, 1993
"... We present the problem of integrating functional languages and logic languages. We explain why the narrowing-based techniques have so far prevailed as operational mechanisms for the functional logic interpreters. We then discuss various strategies of narrowing. Finally we explain how to simulate the ..."
Abstract
-
Cited by 18 (0 self)
- Add to MetaCart
We present the problem of integrating functional languages and logic languages. We explain why the narrowing-based techniques have so far prevailed as operational mechanisms for the functional logic interpreters. We then discuss various strategies of narrowing. Finally we explain how to simulate these strategies of narrowing using the leftmost SLD-resolution rule of Prolog, and compare some experimental results with those obtained with direct narrowing implementations. 1. Introduction There has been a flurry of research on the integration of functional programming (FP) and logic programming (LP). A natural framework would be to consider the union of a set H of Horn clauses with a set E of conditional equations as a program. The declarative semantics of a program is then given by first-order logic with equality [26], that is, first-order logic extended with an equality symbol and the standard equality axioms. The operational semantics of a program is usually given by a system of infere...
Abstract machines for programming language implementation
- FUTURE GENERATION COMPUTER SYSTEMS
, 2000
"... We present an extensive, annotated bibliography of the abstract machines designed for each of the main programming paradigms (imperative, object oriented, functional, logic and concurrent). We conclude that whilst a large number of efficient abstract machines have been designed for particular langua ..."
Abstract
-
Cited by 16 (0 self)
- Add to MetaCart
We present an extensive, annotated bibliography of the abstract machines designed for each of the main programming paradigms (imperative, object oriented, functional, logic and concurrent). We conclude that whilst a large number of efficient abstract machines have been designed for particular language implementations, relatively little work has been done to design abstract machines in a systematic fashion.
Dynamic Detection of Determinism in Functional Logic Languages
- Theoretical Computer Science 142
, 1995
"... Programs in functional logic languages usually have to satisfy a nonambiguity condition, that semantically ensures completeness of conditional narrowing and pragmatically ensures that the defined (non-boolean) functions are deterministic and do not yield different result values for the same argument ..."
Abstract
-
Cited by 14 (0 self)
- Add to MetaCart
Programs in functional logic languages usually have to satisfy a nonambiguity condition, that semantically ensures completeness of conditional narrowing and pragmatically ensures that the defined (non-boolean) functions are deterministic and do not yield different result values for the same argument tuples. The nonambiguity condition allows the dynamic detection of determinism in implementations of functional logic languages. In this paper we show how to achieve this and what can be gained by this optimization. 1 Introduction Functional logic languages are extensions of functional languages with principles derived from logic programming [Reddy 85,87]. While their syntax almost looks like the syntax of conventional functional languages, their operational semantics is based on narrowing, an evaluation mechanism that uses unification instead of pattern matching for parameter passing. Narrowing is a natural extension of reduction to incorporate unification. It means applying the minimal ...
Implementing a Lazy Functional Logic Language with Disequality Constraints
- IN PROC. OF THE 1992 JOINT INTERNATIONAL CONFERENCE AND SYMPOSIUM ON LOGIC PROGRAMMING
, 1992
"... In this paper, we investigate the implementation of a lazy functional logic language (in particular the language BABEL [MR88, MR92]) which uses disequality constraints for solving equations and building answers. We specify a new operational semantics which combines lazy narrowing with disequality co ..."
Abstract
-
Cited by 13 (4 self)
- Add to MetaCart
In this paper, we investigate the implementation of a lazy functional logic language (in particular the language BABEL [MR88, MR92]) which uses disequality constraints for solving equations and building answers. We specify a new operational semantics which combines lazy narrowing with disequality constraints and we define an abstract machine tailored to the execution of BABEL programs according to this semantics. The machine is designed as a quite natural extension of a lazy graph narrowing machine [MKLR90]. Disjunctions of disequalities are handled using the backtracking mechanism.
Relating the Implementation Techniques of Functional and Functional Logic Languages
- New Generation Computing
, 1993
"... Functional logic languages are declarative programming languages that integrate the programming paradigms of functional and logic languages within a single framework. They are extensions of functional languages with principles derived from logic programming. Narrowing, the evaluation mechanism of fu ..."
Abstract
-
Cited by 12 (0 self)
- Add to MetaCart
Functional logic languages are declarative programming languages that integrate the programming paradigms of functional and logic languages within a single framework. They are extensions of functional languages with principles derived from logic programming. Narrowing, the evaluation mechanism of functional logic languages, can be defined as a generalization of reduction, the evaluation mechanism of purely functional languages. The unidirectional pattern matching, which is used for parameter passing in functional languages, is simply replaced by the bidirectional unification known from logic programming languages. We show in this paper, how to extend a reduction machine, that has been designed for the evaluation of purely functional programs to a machine that performs narrowing. The necessary extensions concern the realization of unification and backtracking, for which we fall back upon the methods of Warren's Prolog engine [Warren 83]. The narrowing machine embodies an optimized trea...

