Preserving Sharing in the Partial Evaluation of Lazy Functional Programs
نویسندگان
چکیده
The goal of partial evaluation is the specialization of programs w.r.t. part of their input data. Although this technique is already well-known in the context of functional languages, current approaches are either overly restrictive or destroy sharing through the specialization process, which is unacceptable from a performance point of view. In this work, we present a new partial evaluation scheme for first-order lazy functional programs that preserves sharing through the specialization process and still allows the unfolding of arbitrary functions.
منابع مشابه
Towards a Safe Partial Evaluation of Lazy Functional Logic Programs
Partial Evaluation is a well-known technique for specializing programs w.r.t. a given restriction of their input data. Although partial evaluation has been widely investigated in the context of functional and functional logic languages like Haskell or Curry, current schemes are either overly restrictive or destroy sharing through the specialization process, which may produce incorrect specializ...
متن کاملDetecting sharing of partial applications in functional programs
A method is presented for detecting sharing of partial function applications in higher order functional programs. Such sharing occurs when there are several references to variables that are bound to a particular function application. In order to provide an interprocedural analysis, a non-standard semantics is defined for a lazy, higher-order functional language such that the meaning of a progra...
متن کاملSpecialization of functional logic programs based on needed narrowing
Many functional logic languages are based on narrowing, a unification-based goal-solving mechanism which subsumes the reduction mechanism of functional languages and the resolution principle of logic languages. Needed narrowing is an optimal evaluation strategy which constitutes the basis of modern (narrowing-based) lazy functional logic languages. In this work, we present the fundamentals of p...
متن کاملMulti-Paradigm Logic Programming Call-by-Name Specialization of Functional Logic Programs
Partial evaluation is a method for program specialization based on fold/unfold transformations [4, 15]. Partial evaluation of functional programs uses only static values of given data to specialize the program. 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 [7]. In this ...
متن کاملCall-By Name Partial Evaluation of Functional Logic Programs
Partial evaluation is a method for program specialization based on fold/unfold transformations [4, 16]. Partial evaluation of functional programs uses only static values of given data to specialize the program. 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 [8]. In this ...
متن کامل