X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fsoftware%2Fcomponents%2Facic_content%2FcicNotationUtil.ml;h=b426863cf613e7f77d1123bb89cf747fe4ac18cf;hb=7f9e313fe5ae4200f080f481a6b8b795a0618093;hp=1ddd5c9c3b1572c74034fb70b4f2563867ee6786;hpb=cf9b09a0c18200c1052648eeace74dc2915706d5;p=helm.git diff --git a/helm/software/components/acic_content/cicNotationUtil.ml b/helm/software/components/acic_content/cicNotationUtil.ml index 1ddd5c9c3..b426863cf 100644 --- a/helm/software/components/acic_content/cicNotationUtil.ml +++ b/helm/software/components/acic_content/cicNotationUtil.ml @@ -62,6 +62,7 @@ let visit_ast ?(special_k = fun _ -> assert false) | Ast.Magic _ | Ast.Variable _) as t -> special_k t | (Ast.Ident _ + | Ast.NRef _ | Ast.Implicit | Ast.Num _ | Ast.Sort _ @@ -99,6 +100,7 @@ let visit_layout k = function | Ast.Group terms -> Ast.Group (List.map k terms) | Ast.Mstyle (l, term) -> Ast.Mstyle (l, List.map k term) | Ast.Mpadded (l, term) -> Ast.Mpadded (l, List.map k term) + | Ast.Maction terms -> Ast.Maction (List.map k terms) let visit_magic k = function | Ast.List0 (t, l) -> Ast.List0 (k t, l) @@ -325,13 +327,21 @@ let dressn ~sep:sauces = let find_appl_pattern_uris ap = let rec aux acc = function - | Ast.UriPattern uri -> uri :: acc + | Ast.UriPattern uri -> `Uri uri :: acc + | Ast.NRefPattern nref -> `NRef nref :: acc | Ast.ImplicitPattern | Ast.VarPattern _ -> acc | Ast.ApplPattern apl -> List.fold_left aux acc apl in let uris = aux [] ap in - HExtlib.list_uniq (List.fast_sort UriManager.compare uris) + 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) let rec find_branch = function @@ -361,7 +371,8 @@ let fresh_id () = !fresh_index (* TODO ensure that names generated by fresh_var do not clash with user's *) -let fresh_name () = "η" ^ string_of_int (fresh_id ()) + (* FG: "η" is not an identifier (it is rendered, but not be parsed) *) +let fresh_name () = "eta" ^ string_of_int (fresh_id ()) let rec freshen_term ?(index = ref 0) term = let freshen_term = freshen_term ~index in