diff options
| author | Pierre-Marie Pédrot | 2016-02-29 17:24:05 +0100 |
|---|---|---|
| committer | Pierre-Marie Pédrot | 2016-06-03 16:51:09 +0200 |
| commit | 64637ffc5054199459d9fc7f07b84a99da71c6f1 (patch) | |
| tree | b5b5c4774e217aa1df50f5921dfa2e445b799b62 /ltac | |
| parent | 2c01bd7b446c1151922ad0a01c3dc6b85f5bea54 (diff) | |
Removing "intro" from the tactic AST.
Note that this breaks the compatibility, in a beneficial way I believe. Tactics
defined in strict mode (i.e. through Ltac foo := ...) may not do an introduction
on a local identifier anymore. They must use the "fresh" primitive instead.
Diffstat (limited to 'ltac')
| -rw-r--r-- | ltac/coretactics.ml4 | 14 | ||||
| -rw-r--r-- | ltac/tacintern.ml | 3 | ||||
| -rw-r--r-- | ltac/tacinterp.ml | 10 | ||||
| -rw-r--r-- | ltac/tacsubst.ml | 1 |
4 files changed, 13 insertions, 15 deletions
diff --git a/ltac/coretactics.ml4 b/ltac/coretactics.ml4 index 63b5463c49..efabdc4ad7 100644 --- a/ltac/coretactics.ml4 +++ b/ltac/coretactics.ml4 @@ -197,6 +197,19 @@ TACTIC EXTEND intros_until [ "intros" "until" quantified_hypothesis(h) ] -> [ Tactics.intros_until h ] END +TACTIC EXTEND intro +| [ "intro" ] -> [ Tactics.intro_move None MoveLast ] +| [ "intro" ident(id) ] -> [ Tactics.intro_move (Some id) MoveLast ] +| [ "intro" ident(id) "at" "top" ] -> [ Tactics.intro_move (Some id) MoveFirst ] +| [ "intro" ident(id) "at" "bottom" ] -> [ Tactics.intro_move (Some id) MoveLast ] +| [ "intro" ident(id) "after" hyp(h) ] -> [ Tactics.intro_move (Some id) (MoveAfter h) ] +| [ "intro" ident(id) "before" hyp(h) ] -> [ Tactics.intro_move (Some id) (MoveBefore h) ] +| [ "intro" "at" "top" ] -> [ Tactics.intro_move None MoveFirst ] +| [ "intro" "at" "bottom" ] -> [ Tactics.intro_move None MoveLast ] +| [ "intro" "after" hyp(h) ] -> [ Tactics.intro_move None (MoveAfter h) ] +| [ "intro" "before" hyp(h) ] -> [ Tactics.intro_move None (MoveBefore h) ] +END + (** Move *) TACTIC EXTEND move @@ -287,7 +300,6 @@ let initial_atomic () = "hnf", TacReduce(Hnf,nocl); "simpl", TacReduce(Simpl (Redops.all_flags,None),nocl); "compute", TacReduce(Cbv Redops.all_flags,nocl); - "intro", TacIntroMove(None,MoveLast); "intros", TacIntroPattern []; ] in diff --git a/ltac/tacintern.ml b/ltac/tacintern.ml index 0f827755a6..bd48ffb723 100644 --- a/ltac/tacintern.ml +++ b/ltac/tacintern.ml @@ -481,9 +481,6 @@ let rec intern_atomic lf ist x = (* Basic tactics *) | TacIntroPattern l -> TacIntroPattern (List.map (intern_intro_pattern lf ist) l) - | TacIntroMove (ido,hto) -> - TacIntroMove (Option.map (intern_ident lf ist) ido, - intern_move_location ist hto) | TacExact c -> TacExact (intern_constr ist c) | TacApply (a,ev,cb,inhyp) -> TacApply (a,ev,List.map (intern_constr_with_bindings_arg ist) cb, diff --git a/ltac/tacinterp.ml b/ltac/tacinterp.ml index f6f988ee23..c8fa9367f3 100644 --- a/ltac/tacinterp.ml +++ b/ltac/tacinterp.ml @@ -1644,16 +1644,6 @@ and interp_atomic ist tac : unit Proofview.tactic = expected behaviour. *) (Tactics.intro_patterns l')) sigma end } - | TacIntroMove (ido,hto) -> - Proofview.Goal.enter { enter = begin fun gl -> - let env = Proofview.Goal.env gl in - let sigma = project gl in - let mloc = interp_move_location ist env sigma hto in - let ido = Option.map (interp_ident ist env sigma) ido in - name_atomic ~env - (TacIntroMove(ido,mloc)) - (Tactics.intro_move ido mloc) - end } | TacExact c -> (* spiwack: until the tactic is in the monad *) Proofview.Trace.name_tactic (fun () -> Pp.str"<exact>") begin diff --git a/ltac/tacsubst.ml b/ltac/tacsubst.ml index 71dd718e87..1e974d6f5d 100644 --- a/ltac/tacsubst.ml +++ b/ltac/tacsubst.ml @@ -137,7 +137,6 @@ let rec subst_match_goal_hyps subst = function let rec subst_atomic subst (t:glob_atomic_tactic_expr) = match t with (* Basic tactics *) | TacIntroPattern l -> TacIntroPattern (List.map (subst_intro_pattern subst) l) - | TacIntroMove _ as x -> x | TacExact c -> TacExact (subst_glob_constr subst c) | TacApply (a,ev,cb,cl) -> TacApply (a,ev,List.map (subst_glob_with_bindings_arg subst) cb,cl) |
