Curry Partial Evaluator (v1.3)
This is a purely declarative partial evaluator for the multi-paradigm language Curry. It has been implemented in Curry itself by Elvira Albert, Germán Vidal (UPV), and Michael Hanus (CAU Kiel). The partial evaluator is able to deal with programs containing local declarations, external functions, constraints, higher-order functions, conditional equations, and several built-in functions.
The partial evaluator considers an intermediate language, FlatCurry, and translates programs to FlatCurry in order to specialize them. This is essential to express the above language features at an appropriate level of abstraction. In this way, the resulting partial evaluator can be used to specialize "real" Curry programs, even a meta-interpreter for Curry.
A complete description of the partial evaluator can be found in [AHV00, AHV01, AHV02].
The partial evaluation tool has been integrated into the PAKCS compiler for Curry. It is integrated in PAKCS as follows:
If you want to play with the partial evaluator, you can use the (annotated) examples contained in PevalExamples.tar.gz.
The latest version (v1.3) of the partial evaluator can be found here (it contains peval.curry and a modified file of the PAKCS library, Flat.curry, which should be in the same directory as peval.curry). Once the file peval.curry is loaded in PAKCS, you can partially evaluate programs by using the command mainauto "filename". The current version requires PAKCS 1.6.0. If you have an older version of PAKCS, you can try this.
The partial evaluator does not work yet in the Münster Curry Compiler. The reason is that the partial evaluator requires the meta-programming facilities of PAKCS.
Please report any bug or comment to
gvidal@dsic.upv.es.
MIST | ELP | GPLIS | DSIC | UPV |
Last update June 2004 # gvidal (at) dsic (dot) upv (dot) es