Results 1 - 10
of
11
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.
A Practical Partial Evaluation Scheme for Multi-Paradigm Declarative Languages
- Journal of Functional and Logic Programming
, 2002
"... \Lambda y ..."
Cost-Augmented Narrowing-Driven Specialization
, 2002
"... The aim of many program transformers is to improve efficiency while preserving program meaning. Correctness issues have been dealt with extensively. However, very little attention has been paid to formally establish the improvements achieved by these transformers. In this work, we introduce the sche ..."
Abstract
-
Cited by 12 (9 self)
- Add to MetaCart
The aim of many program transformers is to improve efficiency while preserving program meaning. Correctness issues have been dealt with extensively. However, very little attention has been paid to formally establish the improvements achieved by these transformers. In this work, we introduce the scheme of a narrowing-driven partial evaluator enhanced with abstract costs. They are "abstract" in the sense that they measure the number of basic operations performed during a computation rather than actual execution times. Thus, we have available a setting in which one can discuss the effects of the program transformer in a precise framework and, moreover, to quantify these effects. Our scheme may serve as a basis to develop speedup analyses and cost-guided transformers. An implementation of the cost-augmented specializer has been undertaken, which demonstrates the practicality of our approach.
Turchin's Supercompiler Revisited - An operational theory of positive information propagation
, 1996
"... Turchin`s supercompiler is a program transformer that includes both partial evaluation and deforestation. Although known in the West since 1979, the essence of its techniques, its more precise relations to other transformers, and the properties of the programs that it produces are only now becoming ..."
Abstract
-
Cited by 12 (0 self)
- Add to MetaCart
Turchin`s supercompiler is a program transformer that includes both partial evaluation and deforestation. Although known in the West since 1979, the essence of its techniques, its more precise relations to other transformers, and the properties of the programs that it produces are only now becoming apparent in the Western functional programming community. This thesis gives a new formulation of the supercompiler in familiar terms; we study the essence of it, how it achieves its effects, and its relations to related transformers; and we develop results dealing with the problems of preserving semantics, assessing the efficiency of transformed programs, and ensuring termination.
Experiments with the Call-by-Value Partial Evaluator
, 1998
"... Indy Indy Indy 1 Introduction innermost lazy M. Alpuente M. Falaschi G. Vidal March 4, 1998 Experiments with the Call-by-Value Partial Evaluator polyvariant polygenetic local global closedness unfolding abstraction This work has been partially supported by CICYT under grant TIC 95-0433-C03-03 and ..."
Abstract
-
Cited by 3 (3 self)
- Add to MetaCart
Indy Indy Indy 1 Introduction innermost lazy M. Alpuente M. Falaschi G. Vidal March 4, 1998 Experiments with the Call-by-Value Partial Evaluator polyvariant polygenetic local global closedness unfolding abstraction This work has been partially supported by CICYT under grant TIC 95-0433-C03-03 and by HCM project CONSOLE. DSIC, U. P. Valencia, Camino de Vera s/n, 46022 Valencia, Spain ( alpuente,gvidal @dsic.upv.es). Dip. Matematica e Informatica, U. Udine, Via delle Scienze 206, 33100 Udine, Italy (falaschi@dimi.uniud.it). This paper summarizes our experience gained using the system, a narrowing-driven partial evaluator for functional logic programs which combines in a useful and effective way the propagation of partial data structures, by means of logical variables and unification, with better opportunities for optimization thanks the functional dimension. allows the user to select either a call-by-value ( , eager) or a call-by-name (outside-in, ) narrowing strategy to construct lo...
A Graph-Based Definition of Distillation
- SECOND INTERNATIONAL WORKSHOP ON METACOMPUTATION IN RUSSIA (META 2010)
, 2010
"... In this paper, we give a graph-based definition of the distillation transformation algorithm. This definition is made within a similar framework to the positive supercompilation algorithm, thus allowing for a more in-depth comparison of the two algorithms. We find that the main distinguishing charac ..."
Abstract
-
Cited by 3 (0 self)
- Add to MetaCart
In this paper, we give a graph-based definition of the distillation transformation algorithm. This definition is made within a similar framework to the positive supercompilation algorithm, thus allowing for a more in-depth comparison of the two algorithms. We find that the main distinguishing characteristic between the two algorithms is that in positive supercompilation, generalization and folding are performed with respect to expressions, while in distillation they are performed with respect to graphs. We also find that while only linear improvements in performance are possible using positive supercompilation, super-linear improvements are possible using distillation. This is because computationally expensive terms can only be extracted from within loops when generalizing graphs rather than expressions.
Specialization of Functional Logic Programs
"... Languages that integrate functional and logic programming with a complete operational semantics are based on narrowing, a unification-based goal-solving mechanism which subsumes the reduction principle of functional languages and the resolution principle of logic languages. In this article, we prese ..."
Abstract
-
Cited by 2 (2 self)
- Add to MetaCart
Languages that integrate functional and logic programming with a complete operational semantics are based on narrowing, a unification-based goal-solving mechanism which subsumes the reduction principle of functional languages and the resolution principle of logic languages. In this article, we present a partial evaluation scheme for functional logic languages based on an automatic unfolding algorithm which builds narrowing trees. The method is formalized within the theoretical framework established by Lloyd and Shepherdson for the partial deduction of logic programs, which we have generalized for dealing with functional computations. A generic specialization algorithm is proposed which does not depend on the eager or lazy nature of the narrower being used. To the best of our knowledge, this is the first generic algorithm for the specialization of functional logic programs. We study the semantic properties of the transformation and the conditions under which the technique terminates, is...
Context Patterns, Part II
- In Implementation of Functional Languages
, 1997
"... Functional languages allow the definition of functions by pattern matching, which performs an analysis of the structure of values. However, the structures which can be described by such patterns are restricted to a fixed portion from the the root of the value. Context patterns are a new nonlocal for ..."
Abstract
-
Cited by 2 (0 self)
- Add to MetaCart
Functional languages allow the definition of functions by pattern matching, which performs an analysis of the structure of values. However, the structures which can be described by such patterns are restricted to a fixed portion from the the root of the value. Context patterns are a new nonlocal form of patterns, which allow the matching of subterms without fixed distance from the root of the value. Typical applications of context patterns are functions which search a data structure for patterns and transform it by replacing the pattern. In this paper we introduce a new construct called extended context, which allows the definition of transformational functions without superfluous repetition of the recursive search.
Strengthening supercompilation for call-by-value languages
- SECOND INTERNATIONAL WORKSHOP ON METACOMPUTATION IN RUSSIA (META 2010)
, 2010
"... A termination preserving supercompiler for a call-by-value language sometimes fails to remove intermediate structures that a supercompiler for a call-by-name language would remove. This discrepancy in power stems from the fact that many function bodies are either non-linear in use of an important va ..."
Abstract
-
Cited by 2 (1 self)
- Add to MetaCart
A termination preserving supercompiler for a call-by-value language sometimes fails to remove intermediate structures that a supercompiler for a call-by-name language would remove. This discrepancy in power stems from the fact that many function bodies are either non-linear in use of an important variable or often start with a pattern match on their first argument and are therefore not strict in all their arguments. As a consequence, intermediate structures are left in the output program, making it slower. We present a revised supercompilation algorithm for a call-by-value language that propagates let-bindings into case-branches and uses termination analysis to remove dead code. This allows the algorithm to remove all intermediate structures for common examples where previous algorithms for call-by-value languages had to leave the intermediate structures in place.
A Practical Method for Program Specialization in a Multi-Paradigm Language
, 2000
"... This paper summarizes our findings in the development of partial evaluation tools for Curry, a modern multi-paradigm declarative language which combines features from functional programming, logic programming, and concurrent programming. We present a novel approach to perform automatic program speci ..."
Abstract
-
Cited by 1 (1 self)
- Add to MetaCart
This paper summarizes our findings in the development of partial evaluation tools for Curry, a modern multi-paradigm declarative language which combines features from functional programming, logic programming, and concurrent programming. We present a novel approach to perform automatic program specialization in Curry, which differs from those presented in the literature for the specialization of functional logic languages mainly by considering the translation of the source program into an intermediate language. This is essential in order to express the different features of the language at an appropriate level of abstraction, which allows us to design a simple and concise automatic partial evaluation method covering all the features of the language. Thanks to this simplicity, we have been able to write our partial evaluator in the same language that it partially evaluates (without using any extra-logical feature) and, hence, it is amenable to self-application (able to specialize itse...

