]> matita.cs.unibo.it Git - helm.git/commitdiff
Major code semplification and improvement:
authorClaudio Sacerdoti Coen <claudio.sacerdoticoen@unibo.it>
Thu, 17 Nov 2005 18:19:39 +0000 (18:19 +0000)
committerClaudio Sacerdoti Coen <claudio.sacerdoticoen@unibo.it>
Thu, 17 Nov 2005 18:19:39 +0000 (18:19 +0000)
 1. the proof term generated used to have a (Hletin) ...
    Now it has a (H) ...
 2. the code has been greatly simplified by renaming the old variable
    first and doing a letin later; I used to do the letin first and
    rename the new variable at the end

helm/ocaml/tactics/equalityTactics.ml

index 2b2afae67772bc73fd657288691e046ea97bc1dd..20dede31e902f3dc94d0a5c7aded2ecfac7f893a 100644 (file)
@@ -58,27 +58,19 @@ let rewrite_tac ~direction ~pattern equality =
             (Some (Cic.Name s,_))::_ -> s
           | _ -> assert false
        in
+        let dummy = "dummy" in
         Some arg,false,
          (fun ~term ->
            Tacticals.seq
             ~tactics:
-              [PT.letin_tac term;
-               PET.mk_tactic (fun status ->
-                PET.apply_tactic
-                 (ProofEngineStructuralRules.clearbody
-                   (last_hyp_name_of_status status)) status);
-               PET.mk_tactic (fun status ->
-                let hyp = last_hyp_name_of_status status in
-                 PET.apply_tactic
-                  (ReductionTactics.simpl_tac
-                    ~pattern:
-                      (None,[hyp,Cic.Implicit (Some `Hole)],Cic.Implicit None))
-                  status);
-               ProofEngineStructuralRules.clear name;
-               PET.mk_tactic (fun status ->
-                let hyp = last_hyp_name_of_status status in
-                 PET.apply_tactic
-                  (ProofEngineStructuralRules.rename hyp name) status)
+              [ProofEngineStructuralRules.rename name dummy;
+               PT.letin_tac
+                ~mk_fresh_name_callback:(fun _ _ _ ~typ -> Cic.Name name) term;
+               ProofEngineStructuralRules.clearbody name;
+               ReductionTactics.simpl_tac
+                ~pattern:
+                  (None,[name,Cic.Implicit (Some `Hole)],Cic.Implicit None);
+               ProofEngineStructuralRules.clear dummy
               ]),
          pat,gty
     | _ -> assert false (*CSC: not implemented yet!*)