What is Pure FreshML?
Pure FreshML is a prototype implementation of the programming language
described in the paper Static Name Control for FreshML.
Here is the source code. This is an early prototype,
without documentation; it is provided only as a means of reproducing the experiments
described in the paper. It requires OCaml and
a SAT solver (by default, relsat, but zchaff can also be used).
Installation requires omake. A more polished prototype, with a simpler
installation process, will be made available in the future.
Here are some sample code fragments that might be of interest:
- Conversion to A-normal form, in direct style (anf-direct.fml);
this algorithm, explained in the paper, uses explicit, name-capturing contexts;
- Conversion to A-normal form, in continuation-passing style (anf.fml);
this algorithm uses (defunctionalized) continuations, and gives rise to fewer proof obligations;
- Sets of atoms, implemented as lists of distinct atoms
- An interpreter for a lambda-calculus with callcc
- Closure conversion
(cc.fml); this algorithm requires fine-grained assertions;
(hoist.fml); this follows closure conversion, and is
somewhat remarkable because it does not require much ingenuity; (imagine
doing this with de Bruijn indices!);
- Conversion from lambda-calculus to combinators
- CPS conversion
- Conversion from de Bruijn notation to nominal notation
- An interpreter for a lambda-calculus with pattern matching
- An interpreter for MetaML
- Normalization by evaluation, as described in my paper
(nbe.fml) or with delayed computations
- Type-directed normalization by evaluation