]> matita.cs.unibo.it Git - helm.git/commitdiff
bugfix in clearing the replaced variable: a relocation was missing
authorFerruccio Guidi <ferruccio.guidi@unibo.it>
Fri, 25 Nov 2011 15:24:29 +0000 (15:24 +0000)
committerFerruccio Guidi <ferruccio.guidi@unibo.it>
Fri, 25 Nov 2011 15:24:29 +0000 (15:24 +0000)
matita/components/ng_tactics/nDestructTac.ml

index daa80fd8f08690e2964db8e1469d5e21ca38f8c3..be991484079afe4510396a93d27bde7d237f55cc 100644 (file)
@@ -471,7 +471,7 @@ 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
+          let name,_ = List.nth context (var+cur_eq-1) in
          HLog.warn (Printf.sprintf "destruct: trying to remove variable: %s" name);
          [name]
       | _ -> []
@@ -497,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);
 ]@