]> matita.cs.unibo.it Git - helm.git/blobdiff - matita/components/ng_tactics/nDestructTac.ml
unpatched version for the new CamplP5
[helm.git] / matita / components / ng_tactics / nDestructTac.ml
index 12a1efd7ed32cc8a6ba2fd37c78a02de3a1a5ec7..be991484079afe4510396a93d27bde7d237f55cc 100644 (file)
@@ -469,6 +469,13 @@ let subst_tac ~context ~dir skip cur_eq =
       | NCic.Rel var ->
         cascade_select_in_ctx status ~subst:(get_subst status) context skip (var+cur_eq)
       | _ -> cascade_select_in_ctx status ~subst:(get_subst status) context skip cur_eq in
+    let varname = match var with
+      | NCic.Rel var -> 
+          let name,_ = List.nth context (var+cur_eq-1) in
+         HLog.warn (Printf.sprintf "destruct: trying to remove variable: %s" name);
+         [name]
+      | _ -> []
+    in      
     let names_to_gen = List.filter (fun n -> n <> eq_name) names_to_gen in
     if (List.exists (fun x -> List.mem x skip) names_to_gen)
       then oldstatus
@@ -487,7 +494,12 @@ let subst_tac ~context ~dir skip cur_eq =
                    ~what:("",0,mk_id eq_name) ~where:default_pattern;
 (*                 NTactics.reduce_tac ~reduction:(`Normalize true)
                    ~where:default_pattern;*)
+                 (* XXX: temo che la clear multipla funzioni bene soltanto se
+                  * gli identificatori sono nell'ordine giusto.
+                  * Per non saper né leggere né scrivere, usiamo due clear
+                  * invece di una *)
                  NTactics.try_tac (NTactics.clear_tac [eq_name]);
+                NTactics.try_tac (NTactics.clear_tac varname);
 ]@
                  (List.map NTactics.intro_tac (List.rev names_to_gen))) status
 ;;