Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let performOneReduction var term =
- let rec performOneReduction' = function
- | Const(x) -> Const(x)
- | Var(c) when c = var -> term
- | Var(c) -> Var(c)
- | Term(t1, t2) -> Term(performOneReduction' t1, performOneReduction' t2)
- performOneReduction'
- let isVar = function
- | Var(c) -> true
- | _ -> false
- let variableToChar = function
- | Var(c) -> c
- | _ -> '-'
- let termReduction =
- let rec termReduction' = function
- | Const(x) -> Const(x)
- | Var(c) -> Variable(c)
- | Term(t1, t2) -> TermTerm(termReduction' t1, termReduction' t2)
- termReduction'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement