Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- open Types ;;
- open Tools ;;
- let rec eval2 t = match t with
- | Apply (Lambda(s,tt),t2) when ( (v t2) ) -> sub s t2 tt
- | Apply (t1,t2) when (v t1) -> Apply(t1, eval2 t2)
- | Apply (t1 ,t2) -> Apply(eval2 t1, t2)
- | _ -> t
- ;;
- let rec eval1 t =
- match eval2 t with
- | tt when ( (v tt) or t = tt ) -> tt
- | tt -> eval1 tt
- ;;
- let eval t =
- match t with
- Let(s,tt) -> let r = (eval1 tt) in alias := StringMap.add s r !alias ; Let(s,r)
- | _ -> eval1 t
- ;;
Advertisement
Add Comment
Please, Sign In to add comment