X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fsoftware%2Fcomponents%2Facic_procedural%2FproceduralHelpers.ml;h=94ef413c1042207a4058f6429e7cc02e4c8f4e72;hb=fa2319814d744d3e374490fe4e4746d9a5c84f1f;hp=39607fefd7186fa04552131f59fda270d84f408e;hpb=c465c17581bf606e0330cbd89b238279c184ad35;p=helm.git diff --git a/helm/software/components/acic_procedural/proceduralHelpers.ml b/helm/software/components/acic_procedural/proceduralHelpers.ml index 39607fefd..94ef413c1 100644 --- a/helm/software/components/acic_procedural/proceduralHelpers.ml +++ b/helm/software/components/acic_procedural/proceduralHelpers.ml @@ -31,6 +31,7 @@ module TC = CicTypeChecker module PEH = ProofEngineHelpers module E = CicEnvironment module UM = UriManager +module D = Deannotate (* fresh name generator *****************************************************) @@ -48,7 +49,7 @@ let split name = let join (s, i) = C.Name (if i < 0 then s else s ^ string_of_int i) -let mk_fresh_name context name = +let mk_fresh_name context (name, k) = let rec aux i = function | [] -> name, i | Some (C.Name s, _) :: entries -> @@ -56,11 +57,11 @@ let mk_fresh_name context name = if m = name && j >= i then aux (succ j) entries else aux i entries | _ :: entries -> aux i entries in - join (aux (-1) context) + join (aux k context) let mk_fresh_name context = function | C.Anonymous -> C.Anonymous - | C.Name s -> mk_fresh_name context s + | C.Name s -> mk_fresh_name context (split s) (* helper functions *********************************************************) @@ -116,6 +117,8 @@ let is_not_atomic = function | C.MutConstruct _ -> false | _ -> true +let is_atomic t = not (is_not_atomic t) + let get_ind_type uri tyno = match E.get_obj Un.empty_ugraph uri with | C.InductiveDefinition (tys, _, lpsno, _), _ -> lpsno, List.nth tys tyno @@ -149,3 +152,5 @@ let get_ind_parameters c t = | _ -> assert false in ps, disp + +let cic = D.deannotate_term