]> matita.cs.unibo.it Git - fireball-separation.git/blobdiff - ocaml/lambda4.ml
Moved env_of_sigma to Pure
[fireball-separation.git] / ocaml / lambda4.ml
index 311537a151c3409ace586ee7ef0982a2a2ed8ceb..9395daa7e0998eca7c8f9bd2a3ccca8be25f164e 100644 (file)
@@ -632,18 +632,6 @@ let optimize_numerals p =
   replace_in_sigma (List.rev perm) p.sigma
 ;;
 
-let env_of_sigma freshno sigma should_explode =
- let rec aux n =
-  if n > freshno then
-   []
-  else
-   let e = aux (n+1) in
-   (try
-    e,Pure.lift (-n-1) (snd (List.find (fun (i,_) -> i = n) sigma)),[]
-   with
-    Not_found -> ([], Pure.V n, []) ) :: e
- in aux 0
-;;
 (* ************************************************************************** *)
 
 type result = [
@@ -694,8 +682,7 @@ let solve p =
  let ps = List.map scott_of_nf p.ps in
 
  let sigma' = List.map (fun (x,inst) -> x, scott_of_nf inst) sigma in
- let e' = env_of_sigma freshno sigma' false in
- let e'' = env_of_sigma freshno sigma' true in
+ let e' = Pure.env_of_sigma freshno sigma' in
 
  prerr_endline "--------<REDUCE>---------";
  (function
@@ -707,7 +694,7 @@ let solve p =
    | None -> ()) div;
  List.iter (fun n ->
   verbose ("_::: " ^ (Pure.print n));
-  let t = Pure.mwhd (e'',n,[]) in
+  let t = Pure.mwhd (e',n,[]) in
   verbose ("_:: " ^ (Pure.print t));
   assert (not (Pure.diverged t))
  ) conv ;