aboutsummaryrefslogtreecommitdiff
path: root/theories
diff options
context:
space:
mode:
authorPierre-Marie Pédrot2017-08-05 14:46:18 +0200
committerPierre-Marie Pédrot2017-08-05 15:08:31 +0200
commitdbaf8dd6b150619ac04b33ae4d581432cb5cefe0 (patch)
treeed076a8ff6e12613f714d31f5186bf42751ef52d /theories
parent1f2de88e09c7bb1c0aa111db0d7d50b83f8a62d4 (diff)
More notations for basic tactics.
Diffstat (limited to 'theories')
-rw-r--r--theories/Notations.v17
1 files changed, 13 insertions, 4 deletions
diff --git a/theories/Notations.v b/theories/Notations.v
index 4ce9fc0dbd..4bba9a7495 100644
--- a/theories/Notations.v
+++ b/theories/Notations.v
@@ -139,6 +139,18 @@ Ltac2 Notation "edestruct"
use(thunk(opt(seq("using", constr, bindings)))) :=
destruct0 true ic use.
+Ltac2 default_on_concl cl :=
+match cl with
+| None => { Std.on_hyps := Some []; Std.on_concl := Std.AllOccurrences }
+| Some cl => cl
+end.
+
+Ltac2 Notation "red" cl(opt(clause)) :=
+ Std.red (default_on_concl cl).
+
+Ltac2 Notation "hnf" cl(opt(clause)) :=
+ Std.hnf (default_on_concl cl).
+
Ltac2 rewrite0 ev rw cl tac :=
let tac := match tac with
| None => None
@@ -146,10 +158,7 @@ Ltac2 rewrite0 ev rw cl tac :=
let ((_, tac)) := p in
Some tac
end in
- let cl := match cl with
- | None => { Std.on_hyps := Some []; Std.on_concl := Std.AllOccurrences }
- | Some cl => cl
- end in
+ let cl := default_on_concl cl in
Std.rewrite ev rw cl tac.
Ltac2 Notation "rewrite"