(*
** Some code used in the lecture
*)

(* ****** ****** *)

datatype term =
  | TERMvar of string
  | TERMlam of (string, term) // lam x. t
  | TERMapp of (term, term)
  | TERMint of int
  | TERMopr of (string, termlst)
  | TERMif of (term, term, term)
  | TERMfix of (string(*f*), string(*x*), term)
// end of [term]

where termlst = list0 (term)

(* ****** ****** *)

fun fprint_term (out: FILEref, t: term): void
overload fprint with fprint_term

(* ****** ****** *)

datatype value =
  | VALclo of (env, term)
  | VALint of int
  | VALbool of bool
(*
  | VALfix of (env, term)
*)
  | VALref of ref (value)

where env = list0 @(string, value)

fun fprint_value (out: FILEref, t: value): void
overload fprint with fprint_value

(* ****** ****** *)

fun eval0 (t: term): value
fun eval (env: env, t: term): value

(* ****** ****** *)

(* end of [lambda.sats] *)