open Syntax (* Delinearized interpreter : eval5 *) (* Value *) type v = VNum of int | VFun of (v -> c -> s -> t -> m -> v) | VContS of c * s * t | VContC of c * s * t | VEnv of v list and c = C0 | CApp0 of e * string list * c | CApp1 of c | COp0 of e * string list * op * c | COp1 of op * c and s = v list and t = TNil | Trail of (v -> t -> m -> v) and m = MNil | MCons of (c * s * t) * m (* to_string : v -> string *) let rec to_string value = match value with VNum (n) -> string_of_int n | VFun (_) -> "" | VContS (_) -> "" | VContC (_) -> "" | VEnv (_) -> "" (* Value.print : v -> unit *) let print exp = let str = to_string exp in print_string str