Fix free vars of a lambda in Defun
This commit is contained in:
parent
2e5e691cfe
commit
4419abf57d
|
@ -77,7 +77,11 @@ let rec walk_term fs t =
|
||||||
vars
|
vars
|
||||||
(S.vvars (List.tl args)) in
|
(S.vvars (List.tl args)) in
|
||||||
let thisTag = freshTag () in
|
let thisTag = freshTag () in
|
||||||
let freeVars = Atom.Set.elements @@ S.fv_term body in
|
let freeVars = Atom.Set.elements @@
|
||||||
|
Atom.Set.diff
|
||||||
|
(S.fv_term body)
|
||||||
|
(Atom.Set.of_list vars)
|
||||||
|
in
|
||||||
let thisFunc =
|
let thisFunc =
|
||||||
T.Branch(thisTag, freeVars, nBody) in
|
T.Branch(thisTag, freeVars, nBody) in
|
||||||
let fs = add_func fs arity thisFunc in
|
let fs = add_func fs arity thisFunc in
|
||||||
|
|
Loading…
Reference in a new issue