MatitaTacticals.solve_tactics
~tactics:(List.map (fun t -> "", tactical_of_ast (l+1) t) tacticals)
- | GrafiteAst.Skip loc -> MatitaTacticals.skip
- | GrafiteAst.Dot loc -> MatitaTacticals.dot
- | GrafiteAst.Semicolon loc -> MatitaTacticals.semicolon
- | GrafiteAst.Branch loc -> MatitaTacticals.branch
- | GrafiteAst.Shift loc -> MatitaTacticals.shift
- | GrafiteAst.Pos (loc, i) -> MatitaTacticals.pos i
- | GrafiteAst.Merge loc -> MatitaTacticals.merge
- | GrafiteAst.Focus (loc, goals) -> MatitaTacticals.focus goals
- | GrafiteAst.Unfocus loc -> MatitaTacticals.unfocus
+ | GrafiteAst.Skip _loc -> MatitaTacticals.skip
+ | GrafiteAst.Dot _loc -> MatitaTacticals.dot
+ | GrafiteAst.Semicolon _loc -> MatitaTacticals.semicolon
+ | GrafiteAst.Branch _loc -> MatitaTacticals.branch
+ | GrafiteAst.Shift _loc -> MatitaTacticals.shift
+ | GrafiteAst.Pos (_loc, i) -> MatitaTacticals.pos i
+ | GrafiteAst.Merge _loc -> MatitaTacticals.merge
+ | GrafiteAst.Focus (_loc, goals) -> MatitaTacticals.focus goals
+ | GrafiteAst.Unfocus _loc -> MatitaTacticals.unfocus
+ | GrafiteAst.Wildcard _loc -> MatitaTacticals.wildcard
in
let status, _, _ = tactical_of_ast 0 tac (status, ~-1) in
let status = (* is proof completed? *)
| Branch
| Shift
- | Pos of int
+ | Pos of int list
+ | Wildcard
| Merge
| Focus of goal list
| Semicolon
| Branch
| Shift
- | Pos of int
+ | Pos of int list
+ | Wildcard
| Merge
| Focus of goal list
| Unfocus
| 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))
(([ loc ], t @+ filter_open g, [],`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 ], [], [],`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) 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
+ ((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
new_stack
- (([ loc_i ], [], [],`BranchTag)
- :: (g', t' @+ filter_open g, k', tag) :: s)
+ ((l_js, [], [],`BranchTag)
+ :: (g' @- l_js, t' @+ filter_open g, 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, _ -> 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")