Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let rec simplify e =
- match e with
- | CstI(i) -> CstI(i)
- | Var(x) -> Var(x)
- | Prim("+", e1, e2) -> if simplify e1 = CstI(0) then simplify e2 else
- if simplify e2 = CstI(0) then simplify e1 else
- Prim("+", simplify e1, simplify e2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement