]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/software/components/tactics/declarative.ml
The rewritingstep declarative command now takes also a list of arguments
[helm.git] / helm / software / components / tactics / declarative.ml
index 242d6e3fe6476dab2d100f6253ea72d6d502215a..7e276a8bcef73f63b273e9ed00ae3f61541f7d09 100644 (file)
@@ -148,9 +148,18 @@ let rewritingstep ~dbd ~universe lhs rhs just conclude =
    CicTypeChecker.type_of_aux' metasenv context rhs CicUniv.empty_ugraph in
   let just =
    match just with
-      None ->
-       Tactics.auto ~dbd ~params:["paramodulation","1"; "timeout","3"] ~universe
-    | Some just -> Tactics.apply just 
+      `Auto params ->
+        let params =
+         if not (List.exists (fun (k,_) -> k = "paramodulation") params) then
+          ("paramodulation","1")::params
+         else params in
+        let params =
+         if not (List.exists (fun (k,_) -> k = "timeout") params) then
+          ("timeout","3")::params
+         else params
+        in
+         Tactics.auto ~dbd ~params ~universe
+    | `Term just -> Tactics.apply just 
   in
    match lhs with
       None ->
@@ -175,7 +184,9 @@ let rewritingstep ~dbd ~universe lhs rhs just conclude =
                 ~continuations:
                   [ Tactics.apply prhs ;
                     Tactics.apply (Cic.Rel 1) ;
-                    just]) status
+                    Tacticals.then_
+                     ~start:(Tactics.clear ~hyps:[last_hyp_name])
+                     ~continuation:just]) status
           | Some name ->
              let mk_fresh_name_callback =
              fun metasenv context _ ~typ ->
@@ -193,7 +204,9 @@ let rewritingstep ~dbd ~universe lhs rhs just conclude =
                       ~continuations:
                         [ Tactics.apply prhs ;
                           Tactics.apply (Cic.Rel 1) ;
-                          just]
+                          Tacticals.then_
+                           ~start:(Tactics.clear ~hyps:[last_hyp_name])
+                           ~continuation:just]
                    ]) status)
     | Some lhs ->
        match conclude with
@@ -237,10 +250,12 @@ let case id ~params =
 
 let thesisbecomes t =
 let ty = None in
- (*BUG here: missing check on t *)
  match ty with
-    None -> Tacticals.id_tac
+    None ->
+     Tactics.change ~pattern:(None,[],Some (Cic.Implicit (Some `Hole)))
+      (fun _ metasenv ugraph -> t,metasenv,ugraph)
   | Some ty ->
+     (*BUG here: missing check on t *)
      Tactics.change ~pattern:(None,[],Some (Cic.Implicit (Some `Hole)))
       (fun _ metasenv ugraph -> ty,metasenv,ugraph)
 ;;