(* 9. Pierce 7.3.1 *) (* This replaces existing eval function in untypes/core.ml *) let rec eval ctx t = match t with _ when isval ctx t -> t | TmApp(fi,t1,t2) -> (match eval ctx t1 with TmAbs(_,_,t12) -> eval ctx (termSubstTop (eval ctx t2) t12) | _ -> raise NoRuleApplies) | _ -> raise NoRuleApplies