| J.J. Moreno and M. Rodriguez-Artalejo. Logic Programming with Functions and Predicates: The language Babel. Journal of Logic Programming, 12(3):191--224, 1992. |
....and conclusions. Due to the lack of space, the proofs of our results have not been included in this version but the full proofs can be found in [1] 2 Basic Notions We assume the reader has familiarity with basic concepts of model theory on logic programming and functional logic programming (see [3, 17, 7] for more details) We now point up some of the notions used in this paper. Given S, a partially ordered set (in short, poset) with bottom (equipped with a partial order and a least element ) the set of all totally de ned elements of S will be noted Def(S) We write C(S ) I(S ) for the sets ....
J. J. Moreno-Navarro and M. Rodrguez-Artalejo. Logic Programming with Functions and Predicates: The Language BABEL. JLP, 12(3):191-223, 1992.
....the other hand, the integration of functional and logic programming has been widely investigated during the last years, see [Han94] for a survey. It has leaded to the recent design of modern programming languages such as CURRY [Han00] and T OY [LS99] following the ideas of the predecessors BABEL [MR92] and K LEAF [GLMP91] The aim of such integration is to include features from functional (cfr. determinism, higher order functions, partial, non strict and lazy functions, possibly in nite data structures) and logic languages (cfr. logic variables, function inversion, non determinism, built in ....
....and nally the appendix A will include the proofs of soundness, completeness and optimality and appendix B will exhibit some examples. 2 Basic Notions We assume the reader has familiarity with basic concepts of model theory on logic programming and functional logic programming (see [Apt90, MR92, GHLR99] for more details) We now point up some of the notions used in this paper. Given S, a partially ordered set (in short, poset) with bottom (equipped with a partial order and a least element ) the set of all totally de ned elements of S will be noted Def(S) We write C(S ) I(S ) for ....
J. J. Moreno-Navarro and M. Rodrguez-Artalejo. Logic Programming with Functions and Predicates: The Language BABEL. JLP, 12(3):191-223, 1992.
.... the standard (non strict) equality = which is de ned on partially determined or in nite data structures from the strict equality , which is only de ned on nite and completely determined data structures, and which gives to equality the weak meaning of identity of nite objects (e.g. see [32]) We also assume that equations in g and C have the form s = t whenever we consider = inn, whereas the equations have the form s t when we consider = out. Note that a non strict equation like f(a) g(a) is not an acceptable goal when = out. Innermost narrowing is the foundation of ....
....and partial functions, then nonnormalizable terms, which may occur as subterms within normalizable expressions, also have to be assigned a denotation. Such a denotation is bound to the class of all partial results of the in nite computation along with the usual approximation ordering on them [22, 32] or, equivalently, the in nite data structure de ned as the least upper bound of this class. Following [22, 32] we introduce a fresh constant symbol into to represent the value of expressions which would otherwise be unde ned. De nition 2. Let I be a Herbrand interpretation and R 2 IR . ....
[Article contains additional citation context not shown here]
J.J. Moreno-Navarro and M. Rodrguez-Artalejo. Logic Programming with Functions and Predicates: The language Babel. Journal of Logic Programming, 12(3):191-224, 1992.
....we demonstrate that such a program structure is preserved through the transformation sequence (R 0 ; Rn ) which is a key point for proving the correctness of the transformation system as well as its effective applicability. For instance, other variants of narrowing, e.g. lazy narrowing [31], do not enjoy this property, thus seriously restricting the applicability of the resulting system. In general, the correctness of a transformation rule depends on the appropriate applicability conditions under which the application of such a rule to a program R i in the sequence produces a new ....
....based (CB) if each lhs l is a pattern. In the remainder of this paper, a functional logic program is a left linear CB TRS. Conditions in program rules are treated by using the predefined functions and, if Gamma then Gamma else, case Gamma of which are reduced by standard defining 3 rules [22, 31]. Two (possibly renamed) rules l r and l 0 r 0 overlap, if there is a non variable position p 2 FPos(l) and a most general unifier oe such that oe(lj p ) oe(l 0 ) A left linear TRS with no overlapping rules is called orthogonal. In the remainder of this paper, a functional logic ....
[Article contains additional citation context not shown here]
J.J. Moreno-Navarro and M. Rodr'iguez-Artalejo. Logic Programming with Functions and Predicates: The language Babel. Journal of Logic Programming, 12(3):191--224, 1992.
....Reddy [Red85] narrowing is the operational principle which computes the non ground value (ngv) of an input expression. Given a domain D, a ngv is a mapping from valuations (on D) to values (in D) In moving valuations from being parameters of semantic functions (as usual in many approaches, e.g. [GHLR99, MR92]) to be components of a semantic domain, we understand narrowing as an evaluation mechanism which incorporates the instantiation of variables as a part of such evaluation mechanism. Since ngv s are func2 tional values, we use the domain theoretic notion of approximable mapping [Sco82, Sco81] to ....
....In [Red85] the notion of ngv as the semantic object that a narrowing computation should compute was already introduced. It was also noted that narrowing only computes a representation of the object, not the object itself. However, it was not clearly explained how this connection can be done. In [MR92], domains are used to give semantics to the functional logic language BABEL. However, the style of the presentation is model theoretic: all symbols take meaning from a given interpretation and the connection between the declarative and operational semantics (lazy narrowing) are given by means of ....
[Article contains additional citation context not shown here]
J.J. Moreno-Navarro and M. Rodrguez-Artalejo. Logic programming with functions and predicates: the language BABEL. Journal of Logic Programming, 12:191-223, 1992.
....improved strategies have been proposed (see [29] for a survey. How to debug functional logic programs is an important practical problem which has hardly been addressed in the previous literature. Only a few functional logic languages are equipped with a debugging tool (e.g. ALF [28] Babel [39] and Curry [31] However, these debuggers consist of tracers which are based on suitable extended box models which help display the execution [30, 5] Due to the complexity of the operational semantics of (functional) logic programs, the information obtained by tracing the execution is dicult to ....
.... the standard (non strict) equality = which is de ned on partially determined or in nite data structures from the strict equality , which is only de ned on nite and completely determined data structures, and which gives to equality the weak meaning of identity of nite objects (e.g. see [39]) We also 2 An innermost term is an operation applied to constructor terms, i.e. a term of the form f(d1 ; dk ) where f 2 F and for all i = 1; k, d i 2 (C [ V ) The leftmost innermost position of g is the leftmost position of g which points to an innermost subterm. A position ....
[Article contains additional citation context not shown here]
J.J. Moreno-Navarro and M. Rodrguez-Artalejo. Logic Programming with Functions and Predicates: The language Babel. Journal of Logic Programming, 12(3):191-224, 1992. 17
....is able to solve equations w.r.t. R by deriving both sides of an equation to syntactically unifiable terms. Due to the huge search space of simple narrowing, several authors have proposed restrictions on the admissible narrowing derivations (see [18] for a detailed survey) Lazy narrowing [3, 23, 27] is influenced by the idea of lazy evaluation in functional programming languages. Lazy narrowing steps are only applied at outermost positions with the exception that arguments are evaluated by narrowing to their head normal form if their values are required for an outermost narrowing step. Since ....
....evaluated by narrowing to their head normal form if their values are required for an outermost narrowing step. Since lazy strategies are important in the context of non terminating rewrite rules, these strategies have been proved to be complete w.r.t. domain based interpretations of rewrite rules [13, 23]. Lazy unification is very similar to lazy narrowing but manipulates sets of equations rather than terms. It has been proved to be complete for canonical term rewriting systems w.r.t. standard semantics [6, 22] From a practical point of view the most essential improvement of simple narrowing is ....
[Article contains additional citation context not shown here]
J.J. Moreno-Navarro and M. Rodr'iguez-Artalejo. Logic Programming with Functions and Predicates: The Language BABEL. Journal of Logic Programming, Vol. 12, pp. 191--223, 1992.
....process during the execution of functional logic programs. 1 Introduction In recent years, a lot of proposals have been made to amalgamate functional and logic programming languages [7, 17] Functional logic languages with a sound and complete operational semantics are based on narrowing (e.g. [10, 12, 26, 28]) a combination of the reduction principle of functional languages and the resolution principle of logic languages. Narrowing, originally introduced in automated theorem proving [29] is used to solve equations by finding appropriate values for variables occurring in arguments of functions. This ....
.... logic programs are constructor based, i.e. a distinction is made between operation symbols to construct data terms, called constructors, and operation symbols to operate on data terms, called defined functions or operations (see, for instance, the functional logic languages ALF [12] BABEL [26], K LEAF [11] SLOG [10] Hence we assume that the signature F is partitioned into two sets F = C [ D with C D = A constructor term t is built from constructors and variables, i.e. t 2 T (C; X ) An innermost term t [10] is an operation applied to constructor terms, i.e. t = f(t 1 ; ....
J.J. Moreno-Navarro and M. Rodr'iguez-Artalejo. Logic Programming with Functions and Predicates: The Language BABEL. Journal of Logic Programming, Vol. 12, pp. 191--223, 1992.
....computes only independent unifiers, and is efficiently implemented by pattern matching. 1 Introduction In recent years, most proposals with a sound and complete operational semantics for the integration of functional and logic programming languages [5, 10] were based on narrowing, e.g. [6, 15, 17, 19, 37, 44]. Narrowing, originally introduced in automated theorem proving [46] solves equations by computing unifiers with respect to an equational theory [14] Informally, narrowing unifies a term with the left hand side of a rewrite rule and fires the rule on the instantiated term. Example 1 Consider ....
.... are generally constructor based, i.e. symbols, called constructors, that construct data terms are distinguished from those, called defined functions or operations, that operate on data terms (see, for instance, the Equational Interpreter [40] and the functional logic languages ALF [19] BABEL [37], K LEAF [16] LPG [6] SLOG [15] Hence, we assume that R is a constructor based term rewriting system consisting of rewrite rules of the form l r, where l is an innermost term, i.e. the root of l is an operation and the arguments of l do not contain any operation symbol. Substitutions and ....
[Article contains additional citation context not shown here]
J. J. Moreno-Navarro and M. Rodr'iguez-Artalejo. Logic programming with functions and predicates: The language BABEL. Journal of Logic Programming, 12:191--223, 1992.
....to be formal, we consider only derivations in the technical results of this paper. Note that this is not a practical restriction in our context, since derivations are ecient, easy to compute, and used in the implementations of modern functional logic languages such as Curry [17] and Toy [27]. The above property allows us to de ne the cost of a term as the cost of its derivation when the computed substitution is empty (since it is unique) De nition 5 (cost of a term) Let R be a program and t a term. Let C denote a cost criterion. We overload function C by partially de ning it on ....
J.J. Moreno-Navarro and M. Rodrguez-Artalejo. Logic Programming with Functions and Predicates: The language Babel. Journal of Logic Programming, 12(3):191-224, 1992.
....programming paradigms: functional programming and logic programming [Han94, Han97] This integration can be accomplished in two ways. In some cases, logic programming languages have been 2. 3 The Rewriting based Functional Logic Language 23 extended with function declarations [BE86, Fri85, Han90, MNRA92] The well established narrowing semantics provides a computational mechanism for these languages [Red85, BGM88] On the other hand, functional languages can be extended by permitting logical variables in the terms of a computation [Llo95] or by adding set abstraction [DG89, RS82] ....
J.J. Moreno-Navarro and M. Rodr iguez-Artalejo. Logic Programming with Functions and Predicates. Journal of Logic Programming, 12:191--223, 1992.
.... logic programs are constructor based, i.e. a distinction is made between operation symbols to construct data terms, called constructors, and operation symbols to operate on data terms, called defined functions or operations (see, for instance, the functional logic languages ALF [16] BABEL [29], K LEAF [14] SLOG [13] Hence we assume that the signature F is partitioned into two sets F = C [ D with C D = A constructor term t is built from constructors and variables, i.e. t 2 T (C; X ) A (rewrite) rule l r is a pair of terms l and r satisfying Var(r) Var(l) where l has the ....
....[31] Since sorts are not relevant to the subject of this paper, we omit them for the sake of simplicity. 3 For the sake of simplicity we consider only unconditional rules, but our results can easily be extended to conditional rules with the restrictions of the functional logic language BABEL [29]. 3 A rewrite step is an application of a rewrite rule to a term, i.e. t R s if there exist a position p in t, a rewrite rule l r and a substitution oe with tj p = oe(l) and s = t[oe(r) p . In this case we say t is reducible (at position p) A term t is called irreducible or in normal ....
[Article contains additional citation context not shown here]
J.J. Moreno-Navarro and M. Rodr'iguez-Artalejo. Logic Programming with Functions and Predicates: The Language BABEL. Journal of Logic Programming, Vol. 12, pp. 191--223, 1992.
....this cannot occur for normal systems [Klo92] Theorem 3.2 The rewrite relation of a weakly orthogonal normal CTRS is confluent. Therefore, we consider in the following only normal CTRS as equational logic programs (this restriction is also made in the functional logic languages BABEL [MR92] and K LEAF [GLMP91] This is not a restriction from a logic programming point of view, since each logic program can be transformed into a weakly orthogonal normal CTRS by representing predicates as Boolean functions and eliminating multiple occurrences of variables in left hand sides by ....
.... point of view, since each logic program can be transformed into a weakly orthogonal normal CTRS by representing predicates as Boolean functions and eliminating multiple occurrences of variables in left hand sides by introducing new variables and new equations for them in the condition part (see [MR92] for details) In practice, most equational logic programs are constructor based, i.e. the set of function symbols is divided into a set of constructors C and a set of defined functions or operations D (see, for instance, the functional logic languages ALF [Han90] BABEL [MR92] K LEAF ....
[Article contains additional citation context not shown here]
J.J. Moreno-Navarro and M. Rodr'iguez-Artalejo. Logic Programming with Functions and Predicates: The Language BABEL. Journal of Logic Programming, Vol. 12, pp. 191--223, 1992.
....improved strategies have been proposed (see [28] for a survey. How to debug functional logic programs is an important practical problem which has been hardly addressed in the literature before. Only a few functional logic languages are equipped with a debugging tool (e.g. ALF [27] Babel [38] and Curry [30] But those debuggers consist of tracers which are based on suitable extended box models which help display the execution [29, 4] Due to the complexity of the operational semantics of (functional) logic programs, the information obtained by tracing the execution is difficult to ....
.... oe = mgu(fs = tg) In the case when nonterminating rules are considered, R is defined as (R[ StrEq) where StrEq are the rules for the strict equality which model the identity on ground data terms, i.e. the rules which give to equality the weak meaning of identity of finite objects (e.g. see [38]) c c true c=0 2 C c(x 1 ; xn ) c(y 1 ; yn ) x 1 y 1 ) x n yn ) c=n 2 C We use the symbol as a generic notation for sequences of the form true; true. A successful derivation (or refutation) for g in R is a narrowing derivation g ; where ....
[Article contains additional citation context not shown here]
J.J. Moreno-Navarro and M. Rodr'iguez-Artalejo. Logic Programming with Functions and Predicates: The language Babel. Journal of Logic Programming, 12(3):191--224, 1992. 17
....Hence a possible lazy narrowing derivation is f(f(I,J) K) 0 ; fI7 0;J7 0g f(0,K) 0 ; fK7 0g 0=0 which is also an innermost narrowing derivation. But in general an inner narrowing step is allowed only if it is demanded and contributes to some later narrowing step at an outer position (see [97] for an exact definition of a lazy narrowing redex) In narrowing derivations rules are always applied only in one direction. Hence the confluence of the associated rewrite relation is essential in order to ensure completeness. Since confluence is undecidable and cannot be achieved by completion ....
....to ensure completeness. Since confluence is undecidable and cannot be achieved by completion techniques [77] if the rewrite relation is not terminating, functional logic languages with a lazy operational semantics have the following strong restrictions on the rules in order to ensure completeness [27, 47, 97]: 1. Constructor based: The functional logic program is constructor based. 2. Left linearity: The functional logic program is left linear, i.e. no variable appears more than once in the left hand side of any rule. 3. Free variables: If l = r is a rule, then Var(r) Var(l) 4. Nonambiguity: ....
[Article contains additional citation context not shown here]
J.J. Moreno-Navarro and M. Rodr'iguez-Artalejo. Logic Programming with Functions and Predicates: The Language BABEL. Journal of Logic Programming, Vol. 12, pp. 191--223, 1992.
....that t n is a computed value and oe is a computed answer for t 0 . To avoid unnecessary narrowing computations and to provide computations with infinite data structures, as well as a demand driven generation of the search space, the most recent work has advocated lazy narrowing strategies (e.g. [15, 26, 28]) In this paper we consider needed narrowing [10] an evaluation strategy which is based on the idea of evaluating only subterms that are needed, in a precise technical sense, to obtain a result. Needed Narrowing. Needed narrowing is an optimal evaluation strategy w.r.t. both the length of ....
J.J. Moreno-Navarro and M. Rodr'iguez-Artalejo. Logic Programming with Functions and Predicates: The language Babel. Journal of Logic Programming, 12(3):191--224, 1992.
....for each constructor c in . true X X c c true 8c=0 2 c(X 1 ; X n ) c(Y 1 ; Y n ) X 1 Y 1 ) X n Y n ) 8c=n 2 The equality rules de ne an equivalence on terms referred to as strict equality and commonly used when computations may not terminate [8, 16]. A solution of an equation t u is a substitution such that (t u) rewrites to true using both R and the equality rules of . A literal application of the equality rules may lead to an inecient enumeration of all the narrowing derivations of a term. We correct this problem, in practice, by ....
J. J. Moreno-Navarro and M. Rodrguez-Artalejo. Logic programming with functions and predicates: The language BABEL. Journal of Logic Programming, 12:191-223, 1992.
....whenever the main program is executed. For instance, the action getChar can be composed with the action putChar (which has type Char IO ( and writes a character to the terminal) by the sequential composition operator = which has type 2 This notion of equality, known as strict equality [9, 22], is the only reasonable notion of equality in the presence of non terminating functions. 174 IO ( IO ) IO ) Thus, getChar = putChar is a composed action which prints the next character of the input stream on the screen. The second composition operator, is like = but ....
J.J. Moreno-Navarro and M. Rodrguez-Artalejo. Logic Programming with Functions and Predicates: The Language BABEL. Journal of Logic Programming, Vol. 12, pp. 191-223, 1992.
.... = In practice, most functional logic programs are constructorbased, i.e. symbols, called constructors, that construct data terms are distinguished from those, called de ned functions or operations, that operate on data terms (see, for instance, the functional logic languages ALF [8] BABEL [18], K LEAF [7] LPG [4] Hence, we assume that R is a constructorbased term rewriting system consisting of rewrite rules l r, where l is a pattern, i.e. the root of l is an operation symbol and the arguments of l do not contain any operation symbol. A term f(t 1 ; t n ) n 0) is called ....
....normal form obtained by rewriting. Functional logic programs compute with partial information, i.e. a functional expression may contain logic variables. The goal is to compute values for these variables such that the expression is evaluable to a particular normal form, e.g. a constructor term [4, 7, 18]. This is done by narrowing. A term t is narrowable to a term s if there exist a non variable position p in t (i.e. t jp is not a variable) a variant l r of a rewrite rule in R with Var(t) Var(l r) and a uni er of t jp and l such that s = t[r] p ) In this case we write t ; p; ....
[Article contains additional citation context not shown here]
J. J. Moreno-Navarro and M. Rodrguez-Artalejo. Logic programming with functions and predicates: The language BABEL. Journal of Logic Programming, 12:191-223, 1992.
....derivation, computes only independent uni ers, and is eciently implemented by pattern matching. 1 Introduction In recent years, most proposals with a sound and complete operational semantics for the integration of functional and logic programming languages [5, 10] were based on narrowing, e.g. [6, 15, 17, 19, 37, 44]. Narrowing, originally introduced in automated theorem proving [46] solves equations by computing uni ers with respect to an equational theory [14] Informally, narrowing uni es a term with the left hand side of a rewrite rule and res the rule on the instantiated term. Example 1 Consider the ....
.... are generally constructor based, i.e. symbols, called constructors, that construct data terms are distinguished from those, called de ned functions or operations, that operate on data terms (see, for instance, the Equational Interpreter [40] and the functional logic languages ALF [19] BABEL [37], K LEAF [16] LPG [6] SLOG [15] Hence, we assume that R is a constructor based term rewriting system consisting of rewrite rules of the form l r, where l is an innermost term, i.e. the root of l is an operation and the arguments of l do not contain any operation symbol. Substitutions and ....
[Article contains additional citation context not shown here]
J. J. Moreno-Navarro and M. Rodrguez-Artalejo. Logic programming with functions and predicates: The language BABEL. Journal of Logic Programming, 12:191-223, 1992.
....computes only independent substitutions and minimizes the number of steps of a derivation when the common subterms of a term are shared. Many interesting functional logic languages which adopt narrowing as their operational principle have been designed in the last decade, e.g. ALF [7] BABEL [13], K LEAF [6] and LPG [4] These neither make use of needed narrowing, due to its novelty, nor use Prolog as underlying run time environment. This work has been supported in part by the National Science Foundation under grant CCR 9406751. Authors addresses: Department of Computer Science, ....
J. J. Moreno-Navarro and M. Rodrguez-Artalejo. Logic programming with functions and predicates: The language BABEL. Journal of Logic Programming, 12:191-223, 1992.
....function symbol applied to a sequence of n patterns (i.e. variables or (full) applications of constructors to patterns) The condition C is a conjunction of boolean expressions. A boolean expression is built from boolean functions, predefined boolean operators like , and) or) and not [MNR92] not changes true to false and vice versa; it is not handled by finite failure. The language also allows for if then else like expressions in the form C = e 1 # e 2 . Curry provides a predefined equality equal for all the types, that must be understood as a strict equality in the sense of ....
....not changes true to false and vice versa; it is not handled by finite failure. The language also allows for if then else like expressions in the form C = e 1 # e 2 . Curry provides a predefined equality equal for all the types, that must be understood as a strict equality in the sense of [MNR92] A strict equation is provable, if the left and right hand side are reducible to the same ground constructor term. In order to ensure the well definedness and determinism of a function specified by several equations, additional non ambiguity requirements are necessary (see [MNR92] for details) ....
[Article contains additional citation context not shown here]
J.J. Moreno-Navarro and M. Rodr'iguez-Artalejo. Logic programming with functions and predicates: The language BABEL. Journal of Logic Programming, 12:191--223, 1992.
....Every (partial) definition of a function with a number of rules can be completed by an extra default rule. The default rule establishes the function value for all the tuples that are not finitely defined by the previous rules. In particular we have incorporated the default value feature to BABEL [15] with disequality constraints over the Herbrand Universe [10] resulting a new language called Def BABEL. However, it is clear that the techniques are independent of the chosen narrowing based language. In order to manage default rules, symbolic constraints are needed to express that the ....
....(1) parity (2) parity (3) parity (4) result [odd, even, odd, even] no (more) solutions. ae 3 Declarative Semantics of Default Rules This section is devoted to the declarative semantics of Def BABEL. Since pure BABEL is a subset of our language some technical details (present in [15]) will be skipped or simplified. We start with the definition of the domain. Polymorphism is treated in the simplest way: every polymorphic function is replicated for each particular monomorphic application. Definition 3.1 Herbrand Universe H is the correctly typed Herbrand universe built up ....
[Article contains additional citation context not shown here]
J.J. Moreno Navarro, M. Rodr'iguez Artalejo. Logic Programming with Functions and Predicates: The Language BABEL. Journal of Logic Programming 12:189-223, 1992.
No context found.
J.J. Moreno and M. Rodriguez-Artalejo. Logic Programming with Functions and Predicates: The language Babel. Journal of Logic Programming, 12(3):191--224, 1992.
No context found.
J. J. Moreno-Navarro and M. Rodrguez-Artalejo. Logic programming with functions and predicates: The language BABEL. Journal of Logic Programming, 12:191-223, 1992.
First 50 documents Next 50
Online articles have much greater impact More about CiteSeer.IST Add search form to your site Submit documents Feedback
CiteSeer.IST - Copyright Penn State and NEC