TacticAst.Fourier loc
| IDENT "fwd"; t = term ->
TacticAst.FwdSimpl (loc, t)
- | IDENT "generalize"; t = tactic_term; p = OPT [ pattern_spec ] ->
+ | IDENT "generalize"; t = tactic_term;
+ id = OPT [ "as" ; id = IDENT -> id ];
+ p = OPT [ pattern_spec ] ->
let p = match p with None -> [], None | Some p -> p in
- TacticAst.Generalize (loc,t,p)
+ TacticAst.Generalize (loc,t,id,p)
| IDENT "goal"; n = NUM ->
TacticAst.Goal (loc, int_of_string n)
| IDENT "injection"; t = term ->
| Fold of loc * reduction_kind * 'term
| Fourier of loc
| FwdSimpl of loc * 'term
- | Generalize of loc * 'term * ('term, 'ident) pattern
+ | Generalize of loc * 'term * 'ident option * ('term, 'ident) pattern
| Goal of loc * int (* change current goal, argument is goal number 1-based *)
| Injection of loc * 'term
| Intros of loc * int option * 'ident list
| Exists _ -> "exists"
| Fold (_, kind, term) ->
sprintf "fold %s %s" (pp_reduction_kind kind) (pp_term_ast term)
- | Generalize (_, term, pattern) ->
- sprintf "generalize %s %s" (pp_term_ast term) (pp_pattern pattern)
+ | Generalize (_, term, ident, pattern) ->
+ sprintf "generalize %s%s %s" (pp_term_ast term)
+ (match ident with None -> "" | Some id -> " as " ^ id)
+ (pp_pattern pattern)
| Goal (_, n) -> "goal " ^ string_of_int n
| Fourier _ -> "fourier"
| Injection (_, term) -> "injection " ^ pp_term_ast term