freshocamlv3.08.2+4 · 2005

Recovered source · 2003–2004

Binding structures, in working examples.

These files were distributed with or linked from the original Fresh OCaml site. They use syntax specific to the historical compiler and are presented unchanged as research artifacts.

A.M. Pitts · 2003

Normalization by evaluation

Untyped lambda terms represented with Fresh OCaml names and abstraction types.

Open complete source
type t;;
type var = t name;;

type term =
    Var of var
  | Lam of <<var>>term
  | App of term * term;;

let rec reify d =
  match d with
    L f ->
      let x = fresh in
      Lam(<<x>>(reify(f(function () -> N(V x)))))
  | N n -> reifyn n;;

Complete example set

hm.mlView source ↗minimetaml.mlView source ↗nbe.mlView source ↗pi-calculator.mlView source ↗plc.mlView source ↗plc-nbe.mlView source ↗stlc.mlView source ↗