]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/ocaml/tactics/discriminationTactics.ml
1. change_tac moved from PrimitiveTactics to ReductionTactics
[helm.git] / helm / ocaml / tactics / discriminationTactics.ml
index 96822d8e85af0511a90d1413a4632dfbbab522c7..901540b6f63685eb69c635ab15fe9a247e3b87b0 100644 (file)
@@ -163,28 +163,31 @@ and injection1_tac ~term ~i =
                              | _ -> raise (ProofEngineTypes.Fail "Injection: goal after cut is not correct")
                            in
                             ProofEngineTypes.apply_tactic 
-                            (P.change_tac
-                               ~what:new_t1'
-                               ~with_what:
-                                 (C.Appl [
-                                   C.Lambda (
-                                    C.Name "x", tty,
-                                    C.MutCase (
-                                     turi, typeno,
-                                     (C.Lambda (
-                                      (C.Name "x"),
-                                      (S.lift 1 tty),
-                                      (S.lift 2 tty'))),
-                                     (C.Rel 1), pattern
-                                    )
-                                   );
-                                   t1]
-                                 ))
+                            (ReductionTactics.change_tac
+                               ~pattern:(ProofEngineTypes.conclusion_pattern (Some new_t1'))
+                               (C.Appl [
+                                 C.Lambda (
+                                  C.Name "x", tty,
+                                  C.MutCase (
+                                   turi, typeno,
+                                   (C.Lambda (
+                                    (C.Name "x"),
+                                    (S.lift 1 tty),
+                                    (S.lift 2 tty'))),
+                                   (C.Rel 1), pattern
+                                  )
+                                 );
+                                 t1]
+                               ))
                         status
                        ))
                      ~continuation:
                        (T.then_
-                         ~start:(EqualityTactics.rewrite_simpl_tac ~term)
+                         ~start:
+                           (EqualityTactics.rewrite_simpl_tac
+                             ~direction:`LeftToRight
+                             ~pattern:(ProofEngineTypes.conclusion_pattern None)
+                             term)
                          ~continuation:EqualityTactics.reflexivity_tac
                        )
                    ])     
@@ -298,25 +301,28 @@ let discriminate'_tac ~term =
                            ProofEngineTypes.apply_tactic
                             (T.then_
                              ~start:
-                              (P.change_tac 
-                               ~what:gty' 
-                               ~with_what:
-                                (C.Appl [
-                                  C.Lambda (
-                                   C.Name "x", tty, 
-                                   C.MutCase (
-                                    turi, typeno,
-                                    (C.Lambda ((C.Name "x"),tty,(C.Sort C.Prop))),
-                                    (C.Rel 1), pattern
-                                   )
-                                  ); 
-                                  t2]
-                                )
+                              (ReductionTactics.change_tac 
+                               ~pattern:(ProofEngineTypes.conclusion_pattern (Some gty'))
+                               (C.Appl [
+                                 C.Lambda (
+                                  C.Name "x", tty, 
+                                  C.MutCase (
+                                   turi, typeno,
+                                   (C.Lambda ((C.Name "x"),tty,(C.Sort C.Prop))),
+                                   (C.Rel 1), pattern
+                                  )
+                                 ); 
+                                 t2]
+                               )
                               )
                              ~continuation:
                               (
                                  T.then_
-                                   ~start:(EqualityTactics.rewrite_back_simpl_tac ~term)
+                                   ~start:
+                                     (EqualityTactics.rewrite_simpl_tac
+                                       ~direction:`RightToLeft
+                                       ~pattern:(ProofEngineTypes.conclusion_pattern None)
+                                       term)
                                    ~continuation:(IntroductionTactics.constructor_tac ~n:1) 
                               ))
                              (proof',goal')