| NCases of loc * CicNotationPt.term * npattern
| NCase1 of loc * string
| NChange of loc * npattern * CicNotationPt.term
+ | NConstructor of loc * int option
| NElim of loc * CicNotationPt.term * npattern
| NGeneralize of loc * npattern
| NId of loc
| NApply (_,t) -> "napply " ^ CicNotationPp.pp_term t
| NCases (_,what,where) -> "ncases " ^ CicNotationPp.pp_term what ^
assert false ^ " " ^ assert false
+ | NConstructor (_,None) -> "@"
+ | NConstructor (_,Some x) -> "@" ^ string_of_int x
| NCase1 (_,n) -> "*" ^ n ^ ":"
| NChange (_,what,wwhat) -> "nchange " ^ assert false ^
" with " ^ CicNotationPp.pp_term wwhat
| GrafiteAst.NChange (_loc, pat, ww) ->
NTactics.change_tac
~where:(text,prefix_len,pat) ~with_what:(text,prefix_len,ww)
+ | GrafiteAst.NConstructor (_loc,num) -> NTactics.constructor_tac ?num
| GrafiteAst.NDot _ -> NTactics.dot_tac
| GrafiteAst.NElim (_loc, what, where) ->
NTactics.elim_tac
G.NCases (loc, what, where)
| IDENT "nchange"; what = pattern_spec; "with"; with_what = tactic_term ->
G.NChange (loc, what, with_what)
+ | SYMBOL "@"; num = OPT NUMBER ->
+ G.NConstructor (loc,
+ match num with None -> None | Some x -> Some (int_of_string x))
| IDENT "nelim"; what = tactic_term ; where = pattern_spec ->
G.NElim (loc, what, where)
| IDENT "ngeneralize"; p=pattern_spec ->
if name = "_clearme" then clear_tac ["_clearme"] else id_tac ]
;;
+let constructor ?(num=1) status goal =
+ if num < 1 then fail (lazy "constructor numbers begin with 1");
+ let gty = get_goalty status goal in
+ let status, (r,_,_,_) = analyse_indty status gty in
+ let ref = NReference.mk_constructor num r in
+ exec (apply_tac ("",0,Ast.NRef ref)) status goal
+;;
+
+let constructor_tac ?num = distribute_tac (constructor ?num);;
+
let assert0_tac (hyps,concl) = distribute_tac (fun status goal ->
let gty = get_goalty status goal in
let eq status ctx t1 t2 =
val auto_tac:
params:(NTacStatus.tactic_term list * (string * string) list) ->
's NTacStatus.tactic
+
+val constructor_tac : ?num:int -> 's NTacStatus.tactic