diff options
author | Cyprien Mangin <cyprien.mangin@m4x.org> | 2016-06-03 10:24:36 +0200 |
---|---|---|
committer | Cyprien Mangin <cyprien.mangin@m4x.org> | 2016-06-14 06:21:31 +0200 |
commit | 98ed04803e022e66e17f91526ef708484fd17217 (patch) | |
tree | bc123047c60c6a9fee3a90d832824d6df62bffee /intf | |
parent | 9356f42d5f84f9b325f71bab041d1b8184384a21 (diff) |
Goal selectors are now tacticals and can be used as such.
This allows to write things like this:
split; 2: intro _; exact I
or like this:
eexists ?[x]; ?[x]: exact 0; trivial
This has the side-effect on making the '?' before '[x]' mandatory.
Diffstat (limited to 'intf')
-rw-r--r-- | intf/tacexpr.mli | 7 | ||||
-rw-r--r-- | intf/vernacexpr.mli | 2 |
2 files changed, 8 insertions, 1 deletions
diff --git a/intf/tacexpr.mli b/intf/tacexpr.mli index 379dd59d3..c15ef0dd4 100644 --- a/intf/tacexpr.mli +++ b/intf/tacexpr.mli @@ -34,6 +34,12 @@ type clear_flag = bool option (* true = clear hyp, false = keep hyp, None = use type debug = Debug | Info | Off (* for trivial / auto / eauto ... *) +type goal_selector = + | SelectNth of int + | SelectList of (int * int) list + | SelectId of Id.t + | SelectAll + type 'a core_induction_arg = | ElimOnConstr of 'a | ElimOnIdent of Id.t located @@ -269,6 +275,7 @@ and 'a gen_tactic_expr = ('p,'a gen_tactic_expr) match_rule list | TacFun of 'a gen_tactic_fun_ast | TacArg of 'a gen_tactic_arg located + | TacSelect of goal_selector * 'a gen_tactic_expr (* For ML extensions *) | TacML of Loc.t * ml_tactic_entry * 'a gen_tactic_arg list (* For syntax extensions *) diff --git a/intf/vernacexpr.mli b/intf/vernacexpr.mli index 029ee8a48..8bae8fcb6 100644 --- a/intf/vernacexpr.mli +++ b/intf/vernacexpr.mli @@ -27,7 +27,7 @@ type class_rawexpr = FunClass | SortClass | RefClass of reference or_by_notation to print a goal that is out of focus (or already solved) it doesn't make sense to apply a tactic to it. Hence it the types may look very similar, they do not seem to mean the same thing. *) -type goal_selector = +type goal_selector = Tacexpr.goal_selector = | SelectNth of int | SelectList of (int * int) list | SelectId of Id.t |