X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Focaml%2Fcic_notation%2FcicNotationUtil.ml;h=887f5bf0564f1e1c20cbec279b91c46e0f0cbb81;hb=4167cea65ca58897d1a3dbb81ff95de5074700cc;hp=426846877617a054fade73112c31944aaf03673f;hpb=98d5d40127827a5c40e58cb0c9654066f940b0ea;p=helm.git diff --git a/helm/ocaml/cic_notation/cicNotationUtil.ml b/helm/ocaml/cic_notation/cicNotationUtil.ml index 426846877..887f5bf05 100644 --- a/helm/ocaml/cic_notation/cicNotationUtil.ml +++ b/helm/ocaml/cic_notation/cicNotationUtil.ml @@ -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 = @@ -300,16 +306,13 @@ let dressn ~sep:sauces = let find_appl_pattern_uris ap = let rec aux acc = function - | Ast.UriPattern uri -> - (try - ignore (List.find (fun uri' -> UriManager.eq uri uri') acc); - acc - with Not_found -> uri :: acc) + | Ast.UriPattern uri -> uri :: acc | Ast.ImplicitPattern | Ast.VarPattern _ -> acc | Ast.ApplPattern apl -> List.fold_left aux acc apl in - aux [] ap + let uris = aux [] ap in + HExtlib.list_uniq (List.fast_sort UriManager.compare uris) let rec find_branch = function