X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fsoftware%2Fcomponents%2Ftactics%2Fcontinuationals.ml;h=6bb419c03f9db57dcbeb6a69ba4f3d3d1b45642e;hb=4b2d808b3297a307395d19fcf1502b4687e9120d;hp=4c00fd704f19709dc67b9abb4a098dde46831ddd;hpb=5d2d801149383671c5ed9ed98fa5e85cc86a63fc;p=helm.git diff --git a/helm/software/components/tactics/continuationals.ml b/helm/software/components/tactics/continuationals.ml index 4c00fd704..6bb419c03 100644 --- a/helm/software/components/tactics/continuationals.ml +++ b/helm/software/components/tactics/continuationals.ml @@ -180,6 +180,8 @@ sig val mk_tactic : (input_status -> output_status) -> tactic val apply_tactic : tactic -> input_status -> output_status + val get_status: input_status -> ProofEngineTypes.status + val get_proof: output_status -> ProofEngineTypes.proof 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 @@ -205,7 +207,8 @@ sig | Branch | Shift - | Pos of int + | Pos of int list + | Wildcard | Merge | Focus of goal list @@ -233,7 +236,8 @@ struct | Semicolon | Branch | Shift - | Pos of int + | Pos of int list + | Wildcard | Merge | Focus of goal list | Unfocus @@ -245,7 +249,8 @@ struct | Semicolon -> "Semicolon" | Branch -> "Branch" | Shift -> "Shift" - | Pos i -> "Pos " ^ string_of_int i + | Pos i -> "Pos " ^ (String.concat "," (List.map string_of_int i)) + | Wildcard -> "Wildcard" | Merge -> "Merge" | Focus gs -> sprintf "Focus [%s]" (String.concat "; " (List.map string_of_int gs)) @@ -299,7 +304,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, ([], _, [], _) :: _ -> @@ -324,21 +329,22 @@ 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, ([ loc ], [], [],`BranchTag) :: (g', t', k', tag) :: s + | Pos i_s, ([ loc ], t, [],`BranchTag) :: (g', t', k', tag) :: s when is_fresh loc -> - let loc_i, g' = extract_pos i g' in + let l_js = List.filter (fun (i, _) -> List.mem i i_s) ([loc] @+ g') in new_stack - (([ loc_i ], [], [],`BranchTag) - :: ([ loc ] @+ g', t', k', tag) :: s) - | Pos i, (g, t, k,`BranchTag) :: (g', t', k', tag) :: s -> - let loc_i, g' = extract_pos i g' in - new_stack - (([ loc_i ], [], [],`BranchTag) - :: (g', t' @+ filter_open g, k', tag) :: s) + ((l_js, t , [],`BranchTag) + :: (([ loc ] @+ g') @- l_js, t', k', tag) :: s) | Pos _, _ -> fail (lazy "can't use relative positioning here") + | 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) | Merge, _ -> fail (lazy "can't merge goals here")