aboutsummaryrefslogtreecommitdiffhomepage
path: root/printing
diff options
context:
space:
mode:
authorGravatar Hugo Herbelin <Hugo.Herbelin@inria.fr>2015-12-18 07:32:15 +0100
committerGravatar Hugo Herbelin <Hugo.Herbelin@inria.fr>2016-06-18 13:07:22 +0200
commita34c17e0e4600d0c466f19b64c3dfb39376981fd (patch)
tree06aeab8a503b8892d2a1fc4d66bd5add15038dd0 /printing
parent42cbdfccf0c0500935d619dccaa00476690229f8 (diff)
Adding eintros to respect the e- prefix policy.
In pat%constr, creating new evars is now allowed only if "eintros" is given, i.e. "intros" checks that no evars are created, and similarly e.g. for "injection ... as ... pat%constr". The form "eintros [...]" or "eintros ->" with the case analysis or rewrite creating evars is now also supported. This is not a commitment to say that it is good to have an e- modifier to tactics. It is just to be consistent with the existing convention. It seems to me that the "no e-" variants are good for beginners. However, expert might prefer to use the e-variants by default. Opinions from teachers and users would be useful. To be possibly done: do that [= ...] work on hypotheses with side conditions or parameters based on the idea that they apply the full injection and not only the restriction of it to goals which are exactly an equality, as it is today.
Diffstat (limited to 'printing')
-rw-r--r--printing/pptactic.ml9
1 files changed, 5 insertions, 4 deletions
diff --git a/printing/pptactic.ml b/printing/pptactic.ml
index f8b34e249..bc39c9304 100644
--- a/printing/pptactic.ml
+++ b/printing/pptactic.ml
@@ -845,17 +845,18 @@ module Make
(* Printing tactics as arguments *)
let rec pr_atom0 a = tag_atom a (match a with
- | TacIntroPattern [] -> primitive "intros"
+ | TacIntroPattern (false,[]) -> primitive "intros"
+ | TacIntroPattern (true,[]) -> primitive "eintros"
| t -> str "(" ++ pr_atom1 t ++ str ")"
)
(* Main tactic printer *)
and pr_atom1 a = tag_atom a (match a with
(* Basic tactics *)
- | TacIntroPattern [] as t ->
+ | TacIntroPattern (ev,[]) as t ->
pr_atom0 t
- | TacIntroPattern (_::_ as p) ->
- hov 1 (primitive "intros" ++ spc () ++
+ | TacIntroPattern (ev,(_::_ as p)) ->
+ hov 1 (primitive (if ev then "eintros" else "intros") ++ spc () ++
prlist_with_sep spc (Miscprint.pr_intro_pattern pr.pr_dconstr) p)
| TacApply (a,ev,cb,inhyp) ->
hov 1 (