signature LAMBDA_AST = sig

  type var = string * int
  val eqvar : var -> var -> bool

  (* Syntactic Constructs *)

  datatype binop =
    Plus
  | Times
  | Minus
  | Cons
  | And
  | Or

  datatype unop = 
    Head
  | Tail
  | ZeroP

  datatype expr =
    Var of var
  | True
  | False
  | Num of int
  | Binop of binop * expr * expr
  | Unop of unop * expr
  | If of expr * expr * expr
  | Lambda of var * expr
  | App of expr * expr
  | Letrec of var * expr  * expr  (* letrec (f (fn x => e1)) e2) *)
  | For of var * expr * expr
  | Yield of expr
  | Print of expr

  exception Bad
  val newvar : string -> var

  exception LetrecNotFunction

  val alpha_vary : expr -> expr
end
