]> matita.cs.unibo.it Git - helm.git/blobdiff - matita/components/ng_tactics/nDestructTac.ml
Inversion principles generation falls back to cases tactic when elim is not
[helm.git] / matita / components / ng_tactics / nDestructTac.ml
index c9e46dc2af1b8523109f4b594705afb33c7435f7..be991484079afe4510396a93d27bde7d237f55cc 100644 (file)
@@ -471,7 +471,9 @@ let subst_tac ~context ~dir skip 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 in [name]
+          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
@@ -495,7 +497,7 @@ let subst_tac ~context ~dir skip cur_eq =
                  (* 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 *)              
+                  * invece di una *)
                  NTactics.try_tac (NTactics.clear_tac [eq_name]);
                 NTactics.try_tac (NTactics.clear_tac varname);
 ]@