Results 1  10
of
21
Optimal NonDeterministic Functional Logic Computations
 In Proc. International Conference on Algebraic and Logic Programming (ALP’97
, 1298
"... Abstract. We show that nondeterminism simplifies coding certain problems into programs. We define a nonconfluent, but wellbehaved class of rewrite systems for supporting nondeterministic computations in functional logic programming. We show the benefits of using this class on a few examples. We ..."
Abstract

Cited by 61 (34 self)
 Add to MetaCart
Abstract. We show that nondeterminism simplifies coding certain problems into programs. We define a nonconfluent, but wellbehaved class of rewrite systems for supporting nondeterministic computations in functional logic programming. We show the benefits of using this class on a few examples. We define a narrowing strategy for this class of systems and prove that our strategy is sound, complete, and optimal, modulo nondeterministic choices, for appropriate definitions of these concepts. We compare our strategy with related work and show that our overall approach is fully compatible with the current proposal of a universal, broadbased functional logic language. 1
Constructorbased Conditional Narrowing
 In Proc. of the 3rd International ACM SIGPLAN Conference on Principles and Practice of Declarative Programming (PPDP 2001
, 2001
"... We define a transformation from a leftlinear constructorbased conditional rewrite system into an overlapping inductively sequential rewrite system. This transformation is sound and complete for the computations in the source system. Since there exists a sound and complete narrowing strategy for t ..."
Abstract

Cited by 54 (23 self)
 Add to MetaCart
We define a transformation from a leftlinear constructorbased conditional rewrite system into an overlapping inductively sequential rewrite system. This transformation is sound and complete for the computations in the source system. Since there exists a sound and complete narrowing strategy for the target system, the combination of these results offers the first procedure for provably sound and complete narrowing computations for the whole class of the leftlinear constructorbased conditional rewrite systems. We address the differences between demand driven and lazy strategies and between narrowing strategies and narrowing calculi. In this context, we analyze the efficiency and practicality of using our transformation for the implementation of functional logic programming languages. The results of this paper complement, extend, and occasionally rectify, previously published results in this area. Categories and Subject Descriptors D.1.1 [Programming Techniques]: Applicative (Functional) Programming; D.1.6 [Programming Techniques]: Logic Programming; D.3.3 [Programming Languages]: Language Constructs and FeaturesControl structures; D.3.4 [Programming Languages ]: ProcessorsOptimization; F.4.2 [Mathematical Logic and Formal Languages]: Grammars and Other Rewriting Systems; I.1.1 [Algebraic Manipulation]: Expressions and Their Representation Simplification of expressions; I.2.2 [Automatic Programming ]: Program transformation General Terms Algorithms, Languages, Performance, Theory Keywords Functional Logic Programming Languages, Rewrite Systems, Narrowing Strategies, CallByNeed This work has been supported in part by the National Science Foundation grant INT9981317. 1.
Specialization of Lazy Functional Logic Programs
 IN PROC. OF THE ACM SIGPLAN CONF. ON PARTIAL EVALUATION AND SEMANTICSBASED 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 socalled static/dynamic distinction is hard ..."
Abstract

Cited by 35 (21 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 socalled 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 twophase specialization method for a nonstrict, 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 postprocessing renaming scheme (second phase) is necessary which we describe and illustrate on the wellknown matching example. This phase is essential also for other nonlazy 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.
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 highlevel 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 30 (13 self)
 Add to MetaCart
Abstract. In this paper, we present a highlevel 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 lefthand 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:
Safe Folding/Unfolding with Conditional Narrowing
 PROC. OF THE INTERNATIONAL CONFERENCE ON ALGEBRAIC AND LOGIC PROGRAMMING, ALP'97, SOUTHAMPTON (ENGLAND
, 1997
"... Functional logic languages with a complete operational semantics are based on narrowing, a generalization of term rewriting where unification replaces matching. In this paper, we study the semantic properties of a general transformation technique called unfolding in the context of functional logic l ..."
Abstract

Cited by 11 (9 self)
 Add to MetaCart
Functional logic languages with a complete operational semantics are based on narrowing, a generalization of term rewriting where unification replaces matching. In this paper, we study the semantic properties of a general transformation technique called unfolding in the context of functional logic languages. Unfolding a program is defined as the application of narrowing steps to the calls in the program rules in some appropriate form. We show that, unlike the case of pure logic or pure functional programs, where unfolding is correct w.r.t. practically all available semantics, unrestricted unfolding using narrowing does not preserve program meaning, even when we consider the weakest notion of semantics the program can be given. We single out the conditions which guarantee that an equivalent program w.r.t. the semantics of computed answers is produced. Then, we study the combination of this technique with a folding transformation rule in the case of innermost conditional narrowing, and prove that the resulting transformation still preserves the computed answer semantics of the initial program, under the usual conditions for the completeness of innermost conditional narrowing. We also discuss a relationship between unfold/fold transformations and partial evaluation of functional logic programs.
Lazy Narrowing with Simplification
, 1997
"... Languages that integrate functional and logic programming styles with a complete operational semantics are based on narrowing. In order to avoid useless computations, lazy narrowing strategies have been proposed in the past. This paper presents an improvement of lazy narrowing by incorporating dete ..."
Abstract

Cited by 10 (1 self)
 Add to MetaCart
Languages that integrate functional and logic programming styles with a complete operational semantics are based on narrowing. In order to avoid useless computations, lazy narrowing strategies have been proposed in the past. This paper presents an improvement of lazy narrowing by incorporating deterministic simplification steps into lazy narrowing derivations. These simplification steps reduce the search space so that in some cases infinite search spaces are reduced to finite ones. We consider two classes of programs where this strategy can be applied. Firstly, we show soundness and completeness of our strategy for functional logic programs based on ground confluent and terminating rewrite systems. Then, we show similar results for constructorbased weakly orthogonal (not necessarily terminating) rewrite systems. Finally, we demonstrate the improved operational behavior by means of several examples. Since most functional logic languages are based on programs belonging to one of these classes, our result is a significant step to improve the operational semantics of existing functional logic languages.
A CallbyNeed Strategy for HigherOrder FunctionalLogic Programming
 LOGIC PROGRAMMING. PROC. OF THE 1995 INTERNATIONAL SYMPOSIUM
, 1995
"... We present an approach to truely higherorder functionallogic programming based on higherorder narrowing. Roughly speaking, we model a higherorder functional core language by higherorder rewriting and extend it by logic variables. For the integration of logic programs, conditional rules are suppo ..."
Abstract

Cited by 9 (3 self)
 Add to MetaCart
We present an approach to truely higherorder functionallogic programming based on higherorder narrowing. Roughly speaking, we model a higherorder functional core language by higherorder rewriting and extend it by logic variables. For the integration of logic programs, conditional rules are supported. For solving goals in this framework, we present a complete calculus for higherorder conditional narrowing. We develop several refinements that utilize the determinism of functional programs. These refinements can be combined to a narrowing strategy which generalizes callbyneed as in functional programming, where the dedicated higherorder methods are only used for full higherorder goals. Furthermore, we propose an implementational model for this narrowing strategy which delays computations until needed.
How to Transform Canonical Decreasing CTRSs into Equivalent Canonical TRSs
 In Proceedings of the 4th International Workshop on Conditional Term Rewriting Systems
, 1994
"... We prove constructively that the class of groundconfluent and decreasing conditional term rewriting systems (CTRSs) (without extra variables) coincides with the class of orthogonal and terminating, unconditional term rewriting systems (TRSs). TRSs being included in CTRSs, this result follows from a ..."
Abstract

Cited by 9 (0 self)
 Add to MetaCart
We prove constructively that the class of groundconfluent and decreasing conditional term rewriting systems (CTRSs) (without extra variables) coincides with the class of orthogonal and terminating, unconditional term rewriting systems (TRSs). TRSs being included in CTRSs, this result follows from a transformation from any groundconfluent and decreasing CTRS specifying a computable function f into a TRS with the mentioned properties for f . The generated TRS is ordersorted, but we outline a similar transformation yielding an unsorted TRS.
Goal Solving as Operational Semantics
 Proceedings of the International Symposium on Logic Programming
, 1995
"... To combine a functional or equational programming style with logic programming, one can use an underlying logic of Horn clauses with equality #as an interpreted predicate symbol# and #typed# terms. From this point of view, the most satisfying operational semantics would search for solutions to equat ..."
Abstract

Cited by 8 (1 self)
 Add to MetaCart
To combine a functional or equational programming style with logic programming, one can use an underlying logic of Horn clauses with equality #as an interpreted predicate symbol# and #typed# terms. From this point of view, the most satisfying operational semantics would search for solutions to equations or predicates. #Narrowing" and many of its variants are complete mechanisms for generating solutions. Such a melded language is more expressive than either paradigm alone: functional dependencies are explicit; #multivalued" functions can be better expressed as predicates; nested functions can be evaluated without recourse to search #backtracking#; #nonconstructor # terms can serve as arguments to predicates; functions can be inverted; nonterminating functions can be programmed in a terminating fashion; goals can be simpli#ed in a #don't care" manner; #functional" negation can prune searches. Moreover, the availabilityofbacktracking and existential ##logic"# variables provides an altern...