Offline Narrowing-Driven Partial Evaluator  (v0.1)

This is a purely declarative partial evaluator for term rewriting systems expressed as typical (first-order) Haskell or Curry programs. It has been implemented in Curry by Gustavo Arroyo, J. Guadalupe Ramos, Josep Silva, and Germán Vidal.

In contrast to previous narrowing-driven partial evaluators, here we follow the offline approach for ensuring termination. In this way, the system scales up better to more realistic problems (like interpreter specialization). A detailed description of new scheme can be found in [RSV05, ARSV06].

The sources of the partial evaluator, together with some selected benchmarks, can be found here. Once you download this file, you can uncompress it with

  tar xvfz offpeval.tgz
In order to use the partial evaluator, first you need to install the PAKCS (version 1.7.3) environment for Curry. Then, start PAKCS and load in the file offpeval.curry as follows:
[guest@gv]$ pakcs
% restoring /usr/local/pakcs/curry2prolog/c2p.state...
  ______      __       _    _    ______   _______     
 |  __  |    /  \     | |  / /  |  ____| |  _____|   Portland Aachen Kiel
 | |  | |   / /\ \    | |_/ /   | |      | |_____    Curry System
 | |__| |  / /__\ \   |  _  |   | |      |_____  |   
 |  ____| / ______ \  | | \ \   | |____   _____| |   Version 1.7.3 (10)
 |_|     /_/      \_\ |_|  \_\  |______| |_______|   September 2006

Curry2Prolog(sicstus) Compiler Environment (Version of 15/09/06)
(RWTH Aachen, CAU Kiel, Portland State University)

Bug reports: mh@informatik.uni-kiel.de

Type ":h" for help

Prelude> :l OffPeval
...
{compiled /home/guest/OffPeval/OffPeval.pl in module user, 4820 msec 1836284 bytes}
OffPeval>
Now, you have available three commands: For instance, a typical session is as follows:
offpeval> annotate "examples/power"
Offline Narrowing-Driven Partial Evaluator (Version 0.1 of Sep 2006)

Pre-processing analysis and annotation of source program

Writing annotated program in "examples/power_ann.fcy"...

offpeval> mix "examples/power"
Offline Narrowing-Driven Partial Evaluator (Version 0.1 of Sep 2006)

Specialization from annotated program

Main call to be partially evaluated:

(pow x (S (S (S (S (S (S (Z ))))))))

Writing specialized program into "examples/power_ann_pe.fcy"...
If you want to see the result of the partial evaluator, you can load in the residual program examples/power_ann_pe and use the show utility.

Please report any bug or comment to gvidal (at) dsic.upv.es.

MiST ELP GPLIS DSIC UPV


Last update / Germán Vidal