X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=ocaml%2Fnum.ml;h=85a2bfa7583c6aaa82d70719ca5880da38207a32;hb=eb8bb784b35d303a1c239f30008cba79f658f4b3;hp=d00398532ae4495d6379a2fca1cc3e7f1adbf002;hpb=1bef432e151246cbcd9776da9cef4f0c038d387e;p=fireball-separation.git diff --git a/ocaml/num.ml b/ocaml/num.ml index d003985..85a2bfa 100644 --- a/ocaml/num.ml +++ b/ocaml/num.ml @@ -70,12 +70,12 @@ let rec make_lams t = | n when n > 0 -> `Lam (false, lift 1 (make_lams t (n-1))) | _ -> assert false -let free_vars = +let free_vars' = let rec aux n = function `N _ -> [] - | `Var(x,_) -> if x < n then [] else [x-n] - | `I((x,_),args) -> - (if x < n then [] else [x-n]) @ + | `Var(x,ar) -> if x < n then [] else [(x-n,ar)] + | `I((x,ar),args) -> + (if x < n then [] else [(x-n,ar)]) @ List.concat (List.map (aux n) (Listx.to_list args)) | `Lam(_,t) -> aux (n+1) t | `Match(t,_,liftno,bs,args) -> @@ -84,6 +84,7 @@ let free_vars = List.concat (List.map (aux n) args) in aux 0 ;; +let free_vars = (List.map fst) ++ free_vars';; module ToScott = struct