]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/ocaml/cic_notation/cicNotationUtil.ml
Better handling of idref propagation, no more Href hack, multiple idrefs are
[helm.git] / helm / ocaml / cic_notation / cicNotationUtil.ml
index 29edf6e7cb6354de9f4587cf360eed2473bdd384..966e0262626b2e6a636ea374c50ed487bb13edea 100644 (file)
@@ -63,8 +63,8 @@ let visit_ast ?(special_k = fun _ -> assert false) k =
     | Some term -> Some (k term)
   and aux_capture_variable (term, typ_opt) = k term, aux_opt typ_opt
   and aux_patterns patterns = List.map aux_pattern patterns
-  and aux_pattern ((head, vars), term) =
-    ((head, List.map aux_capture_variable vars), k term)
+  and aux_pattern ((head, hrefs, vars), term) =
+    ((head, hrefs, List.map aux_capture_variable vars), k term)
   and aux_subst (name, term) = (name, k term)
   and aux_substs substs = List.map aux_subst substs
   in
@@ -160,6 +160,12 @@ let rec strip_attributes t =
   in
   visit_ast ~special_k strip_attributes t
 
+let rec get_idrefs =
+  function
+  | Ast.AttributedTerm (`IdRef id, t) -> id :: get_idrefs t
+  | Ast.AttributedTerm (_, t) -> get_idrefs t
+  | _ -> []
+
 let meta_names_of_term term =
   let rec names = ref [] in
   let add_name n =
@@ -203,7 +209,7 @@ let meta_names_of_term term =
   and aux_branch (pattern, term) =
     aux_pattern pattern ;
     aux term
-  and aux_pattern (head, vars) = 
+  and aux_pattern (head, _, vars) = 
     List.iter aux_capture_var vars
   and aux_definition (var, term, i) =
     aux_capture_var var ;
@@ -297,7 +303,7 @@ let dressn ~sep:sauces =
   in
     aux
 
-let find_appl_pattern_uris ap =
+(* let find_appl_pattern_uris ap =
   let rec aux acc =
     function
     | Ast.UriPattern uri ->
@@ -309,7 +315,7 @@ let find_appl_pattern_uris ap =
     | Ast.VarPattern _ -> acc
     | Ast.ApplPattern apl -> List.fold_left aux acc apl
   in
-  aux [] ap
+  aux [] ap *)
 
 let rec find_branch =
   function