X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=matita%2Fcomponents%2Fcontent%2FnotationUtil.ml;h=3d80e8fd51427a0d091335a95e186b1b4553d91f;hb=59e3ddd15ee1983027e8929c073b06a80d523875;hp=52abe456442dd097152a9f5e8c54f6dca9568755;hpb=0d2bfb98d8343b4e6cefdb506a813b7cb5749630;p=helm.git diff --git a/matita/components/content/notationUtil.ml b/matita/components/content/notationUtil.ml index 52abe4564..3d80e8fd5 100644 --- a/matita/components/content/notationUtil.ml +++ b/matita/components/content/notationUtil.ml @@ -328,21 +328,13 @@ let dressn ~sep:sauces = let find_appl_pattern_uris ap = let rec aux acc = function - | Ast.UriPattern uri -> `Uri uri :: acc - | Ast.NRefPattern nref -> `NRef nref :: acc + | Ast.NRefPattern nref -> nref :: acc | Ast.ImplicitPattern | Ast.VarPattern _ -> acc | Ast.ApplPattern apl -> List.fold_left aux acc apl in let uris = aux [] ap in - let cmp u1 u2 = - match u1,u2 with - `Uri u1, `Uri u2 -> UriManager.compare u1 u2 - | `NRef r1, `NRef r2 -> NReference.compare r1 r2 - | `Uri _,`NRef _ -> -1 - | `NRef _, `Uri _ -> 1 - in - HExtlib.list_uniq (List.fast_sort cmp uris) + HExtlib.list_uniq (List.fast_sort NReference.compare uris) let rec find_branch = function @@ -405,3 +397,19 @@ let freshen_obj obj = let freshen_term = freshen_term ?index:None +let rec refresh_uri_in_term ~refresh_uri_in_term:refresh_in_cic + ~refresh_uri_in_reference += + function + NotationPt.NRef ref -> NotationPt.NRef (refresh_uri_in_reference ref) + | NotationPt.NCic t -> NotationPt.NCic (refresh_in_cic t) + | t -> + visit_ast + (refresh_uri_in_term ~refresh_uri_in_term:refresh_in_cic + ~refresh_uri_in_reference) t + ~special_k:(fun x -> x) + ~map_xref_option:(function Some ref -> Some (refresh_uri_in_reference ref) + | x -> x) + ~map_case_indty:(function (Some (s,Some ref)) -> Some (s, Some + (refresh_uri_in_reference ref)) | x -> x) +;;