]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/software/components/tactics/continuationals.ml
Bug fixed: a ~with_cast is now inserted when appropriate to avoid translation
[helm.git] / helm / software / components / tactics / continuationals.ml
index 7ea357e89679694087ce106e890559b4e028d686..d90e100194538c483397485d061c908e3f6170ec 100644 (file)
@@ -175,13 +175,10 @@ sig
   type output_status
 
   type tactic
-
-  val id_tactic : tactic
   val mk_tactic : (input_status -> output_status) -> tactic
   val apply_tactic : tactic -> input_status -> output_status
 
   val goals : output_status -> goal list * goal list (** opened, closed goals *)
-  val set_goals: goal list * goal list -> output_status -> output_status
   val get_stack : input_status -> Stack.t
   val set_stack : Stack.t -> output_status -> output_status
 
@@ -302,7 +299,7 @@ struct
           debug_print (lazy ("closed: "
             ^ String.concat " " (List.map string_of_int gcn)));
           let stack =
-            (zero_pos gon, t @~- gcn, k @~- gon, tag) :: deep_close gcn s
+            (zero_pos gon, t @~- gcn, k @~- gcn, tag) :: deep_close gcn s
           in
           sn, stack
       | Dot, ([], _, [], _) :: _ ->
@@ -327,26 +324,21 @@ struct
           | [] -> fail (lazy "no more goals to shift")
           | loc :: loc_tl ->
               new_stack
-                (([ loc ], t @+ filter_open g, [],`BranchTag)
+                (([ loc ], t @+ filter_open g @+ k, [],`BranchTag)
                 :: (loc_tl, t', k', tag) :: s))
       | Shift, _ -> fail (lazy "can't shift goals here")
-      | Pos i_s, ([ loc ], [], [],`BranchTag) :: (g', t', k', tag) :: s
+      | Pos i_s, ([ loc ], t, [],`BranchTag) :: (g', t', k', tag) :: s
         when is_fresh loc ->
-          let l_js = List.filter (fun (i, _) -> List.mem i i_s) g' in
-          new_stack
-            ((l_js, [], [],`BranchTag)
-             :: ([ loc ] @+ g' @- l_js, t', k', tag) :: s)
-      | Pos i_s, (g, t, k,`BranchTag) :: (g', t', k', tag) :: s ->
-          let l_js = List.filter (fun (i, _) -> List.mem i i_s) g' in
+          let l_js = List.filter (fun (i, _) -> List.mem i i_s) ([loc] @+ g') in
           new_stack
-            ((l_js, [], [],`BranchTag)
-             :: (g' @- l_js, t' @+ filter_open g, k', tag) :: s)
+            ((l_js, , [],`BranchTag)
+             :: (([ loc ] @+ g') @- l_js, t', k', tag) :: s)
       | Pos _, _ -> fail (lazy "can't use relative positioning here")
-      | Wildcard, (g, t, k, `BranchTag) :: (g', t', k', tag) :: s
-        when g = [] || is_fresh (List.hd g) ->
-          new_stack
-            ((g', [], [], `BranchTag)
-             :: ([], t' @+ filter_open g @+ k, k', tag) :: s)
+      | Wildcard, ([ loc ] , t, [], `BranchTag) :: (g', t', k', tag) :: s
+          when is_fresh loc ->
+            new_stack
+              (([loc] @+ g', t, [], `BranchTag)
+                :: ([], t', k', tag) :: s)
       | Wildcard, _ -> fail (lazy "can't use wildcard here")
       | Merge, (g, t, k,`BranchTag) :: (g', t', k', tag) :: s ->
           new_stack ((t @+ filter_open g @+ g' @+ k, t', k', tag) :: s)