]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/ocaml/cic_notation/cicNotationFwd.ml
snapshort
[helm.git] / helm / ocaml / cic_notation / cicNotationFwd.ml
index b200de2efdfc6de6429523c4f3aa83e6ee1d8443..10bab9e36fb3bcaedd333aec34ec64610077164d 100644 (file)
@@ -26,7 +26,9 @@
 open CicNotationEnv
 open CicNotationPt
 
-let meta_names_of term =
+(* XXX ZACK: switched to CicNotationUtil.names_of_term, commented code below to
+ * be removes as soon as we believe implementation are equivalent *)
+(* let meta_names_of term =
   let rec names = ref [] in
   let add_name n =
     if List.mem n !names then ()
@@ -90,7 +92,7 @@ let meta_names_of term =
     | _ -> assert false
   in
   aux term ;
-  !names
+  !names *)
 
 let unopt_names names env =
   let rec aux acc = function
@@ -188,7 +190,7 @@ let instantiate_level2 env term =
     | Ascription (term, name) -> assert false
   and aux_magic env = function
     | Default (some_pattern, none_pattern) ->
-        (match meta_names_of some_pattern with
+        (match CicNotationUtil.names_of_term some_pattern with
         | [] -> assert false (* some pattern must contain at least 1 name *)
         | (name :: _) as names ->
             (match lookup_value env name with
@@ -202,7 +204,8 @@ let instantiate_level2 env term =
     | Fold (`Left, base_pattern, names, rec_pattern) ->
         let acc_name = List.hd names in (* names can't be empty, cfr. parser *)
         let meta_names =
-          List.filter ((<>) acc_name) (meta_names_of rec_pattern)
+          List.filter ((<>) acc_name)
+            (CicNotationUtil.names_of_term rec_pattern)
         in
         (match meta_names with
         | [] -> assert false (* as above *)
@@ -222,7 +225,8 @@ let instantiate_level2 env term =
     | Fold (`Right, base_pattern, names, rec_pattern) ->
         let acc_name = List.hd names in (* names can't be empty, cfr. parser *)
         let meta_names =
-          List.filter ((<>) acc_name) (meta_names_of rec_pattern)
+          List.filter ((<>) acc_name)
+            (CicNotationUtil.names_of_term rec_pattern)
         in
         (match meta_names with
         | [] -> assert false (* as above *)