<keyword>rec</keyword>
<keyword>record</keyword>
<keyword>with</keyword>
-<!-- <keyword>using</keyword>-->
-<!-- <keyword>at</keyword>-->
+ <keyword>and</keyword>
+ <keyword>to</keyword>
+ <keyword>as</keyword>
+ <keyword>using</keyword>
</keyword-list>
<pattern-item _name = "Command [" style = "Keyword">
| TacticAst.Contradiction _ -> Tactics.contradiction
| TacticAst.Compare (_, term) -> Tactics.compare term
| TacticAst.Constructor (_, n) -> Tactics.constructor n
- | TacticAst.Cut (_, term) -> Tactics.cut term
+ | TacticAst.Cut (_, ident, term) ->
+ let names = match ident with None -> [] | Some id -> [id] in
+ Tactics.cut ~mk_fresh_name_callback:(namer_of names) term
| TacticAst.DecideEquality _ -> Tactics.decide_equality
| TacticAst.Decompose (_,term) -> Tactics.decompose term
| TacticAst.Discriminate (_,term) -> Tactics.discriminate term
status, TacticAst.Constructor (loc,n)
| TacticAst.Contradiction loc ->
status, TacticAst.Contradiction loc
- | TacticAst.Cut (loc, term) ->
+ | TacticAst.Cut (loc, ident, term) ->
let status, cic = disambiguate_term status term in
- status, TacticAst.Cut (loc, cic)
+ status, TacticAst.Cut (loc, ident, cic)
| TacticAst.DecideEquality loc ->
status, TacticAst.DecideEquality loc
| TacticAst.Decompose (loc,term) ->
connect_button tbar#transitivityButton
(tac_w_term (A.Transitivity (loc, hole)));
connect_button tbar#assumptionButton (tac (A.Assumption loc));
- connect_button tbar#cutButton (tac_w_term (A.Cut (loc, hole)));
+ connect_button tbar#cutButton (tac_w_term (A.Cut (loc, None, hole)));
connect_button tbar#autoButton (tac (A.Auto (loc,None,None)));
MatitaGtkMisc.toggle_widget_visibility
~widget:(self#main#tacticsButtonsHandlebox :> GObj.widget)
let _ =
List.iter (fun keyword -> Hashtbl.add keywords keyword ("", keyword))
[ "Prop"; "Type"; "Set"; "let"; "Let"; "rec"; "using"; "match"; "with";
- "in"; "and"; "to" ]
+ "in"; "and"; "to"; "as" ]
let error lexbuf msg =
raise (Error (Ulexing.lexeme_start lexbuf, Ulexing.lexeme_end lexbuf, msg))
TacticAst.Constructor (loc,int_of_string n)
| IDENT "contradiction" ->
TacticAst.Contradiction loc
- | IDENT "cut"; t = tactic_term ->
- TacticAst.Cut (loc, t)
+ | IDENT "cut"; t = tactic_term; ident = OPT [ "as"; id = IDENT -> id] ->
+ TacticAst.Cut (loc, ident, t)
| IDENT "decide"; IDENT "equality" ->
TacticAst.DecideEquality loc
| IDENT "decompose"; where = term ->
| Compare of loc * 'term
| Constructor of loc * int
| Contradiction of loc
- | Cut of loc * 'term
+ | Cut of loc * 'ident option * 'term
| DecideEquality of loc
| Decompose of loc * 'term
| Discriminate of loc * 'term
| Compare (_, term) -> countterm (current_size + 7) term
| Constructor (_, n) -> current_size + 12
| Contradiction _ -> current_size + 13
- | Cut (_, term) -> countterm (current_size + 4) term
+ | Cut (_, ident, term) ->
+ let id_size =
+ match ident with
+ None -> 0
+ | Some id -> String.length id + 4
+ in
+ countterm (current_size + 4 + id_size) term
| DecideEquality _ -> current_size + 15
| Decompose (_, term) ->
countterm (current_size + 11) term
Box.indent(ast2astBox term)])
| Constructor (_,n) -> Box.Text ([],"constructor " ^ string_of_int n)
| Contradiction _ -> Box.Text([],"contradiction")
- | Cut (_, term) ->
- Box.V([],[Box.Text([],"cut");
- Box.indent(ast2astBox term)])
| DecideEquality _ -> Box.Text([],"decide equality")
| Decompose (_, term) ->
Box.V([],[Box.Text([],"decompose");
| Compare (_,term) -> "compare " ^ pp_term_ast term
| Constructor (_,n) -> "constructor " ^ string_of_int n
| Contradiction _ -> "contradiction"
- | Cut (_, term) -> "cut " ^ pp_term_ast term
+ | Cut (_, ident, term) ->
+ "cut " ^ pp_term_ast term ^
+ (match ident with None -> "" | Some id -> " as " ^ id)
| DecideEquality _ -> "decide equality"
| Decompose (_, term) ->
sprintf "decompose %s" (pp_term_ast term)