]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/software/components/acic_procedural/proceduralTypes.ml
- cicInspect: relevant nodes count updated: letin nodes are not relevant
[helm.git] / helm / software / components / acic_procedural / proceduralTypes.ml
index ed198d99b6c66ebf7bafbf7a2f036a52668ed6c9..55516bf34aebd02241badb49501372493227f511 100644 (file)
@@ -86,6 +86,7 @@ type step = Note of note
          | Clear of hyp list * note
          | ClearBody of hyp * note
          | Branch of step list list * note
+          | Reflexivity of note
 
 (* annterm constructors *****************************************************)
 
@@ -225,6 +226,10 @@ let mk_clearbody id punctation =
    let tactic = G.ClearBody (floc, id) in
    mk_tactic tactic punctation
 
+let mk_reflexivity punctation =
+   let tactic = G.Reflexivity floc in
+   mk_tactic tactic punctation
+
 let mk_ob = 
    let punctation = G.Branch floc in
    mk_punctation punctation
@@ -258,10 +263,11 @@ let rec render_step sep a = function
    | ClearBody (n, s)          -> mk_clearbody n sep :: mk_tacnote s a
    | Branch ([], s)            -> a
    | Branch ([ps], s)          -> render_steps sep a ps
-   | Branch (ps :: pss, s)     ->      
+   | Branch (ps :: pss, s)     ->
       let a = mk_ob :: mk_tacnote s a in
       let a = List.fold_left (render_steps mk_vb) a (List.rev pss) in
       mk_punctation sep :: render_steps mk_cb a ps
+   | Reflexivity s             -> mk_reflexivity sep :: mk_tacnote s a
 
 and render_steps sep a = function
    | []                                          -> a
@@ -281,16 +287,21 @@ let rec count_step a = function
    | Note _
    | Statement _
    | Inductive _
-   | Qed _
-(* level 0 *)   
-   | Intros (Some 0, [], _)
+   | Qed _                  -> a
+(* level A0 *)   
+   | Branch (pps, _)        -> List.fold_left count_steps a pps
+   | Clear _
+   | ClearBody _
    | Id _
+   | Intros (Some 0, [], _)
+(* leval A1 *)   
    | Exact _
-   | Change _
-   | Clear _
-   | ClearBody _            -> a
-   | Branch (pps, _)        -> List.fold_left count_steps a pps
-(* level 1 *)   
+(* level B1 *)   
+   | Cut _
+   | LetIn _
+(* level B2 *)   
+   | Change _               -> a
+(* level C *)   
    | _                      -> succ a   
 
 and count_steps a = List.fold_left count_step a
@@ -302,6 +313,7 @@ let rec count_node a = function
    | Inductive _
    | Statement _
    | Qed _   
+   | Reflexivity _
    | Id _
    | Intros _
    | Clear _
@@ -317,3 +329,25 @@ let rec count_node a = function
    | Branch (ss, _)          -> List.fold_left count_nodes a ss
 
 and count_nodes a = List.fold_left count_node a
+
+(* helpers ******************************************************************)
+
+let rec note_of_step = function
+   | Note s
+   | Statement (_, _, _, _, s)
+   | Inductive (_, _, s)
+   | Qed s
+   | Exact (_, s)
+   | Id s
+   | Intros (_, _, s)
+   | Cut (_, _, s)
+   | LetIn (_, _, s)
+   | Rewrite (_, _, _, _, s)
+   | Elim (_, _, _, s)
+   | Cases (_, _, s)
+   | Apply (_, s)
+   | Change (_, _, _, _, s)
+   | Clear (_, s)
+   | ClearBody (_, s)
+   | Reflexivity s
+   | Branch (_, s)             -> s