]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/software/components/acic_procedural/proceduralHelpers.ml
applyTransformation: added debugging information
[helm.git] / helm / software / components / acic_procedural / proceduralHelpers.ml
index 39607fefd7186fa04552131f59fda270d84f408e..94ef413c1042207a4058f6429e7cc02e4c8f4e72 100644 (file)
@@ -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