aboutsummaryrefslogtreecommitdiff
path: root/theories/Init
diff options
context:
space:
mode:
authorJason Gross2019-12-05 14:39:03 -0500
committerJason Gross2019-12-26 13:31:02 -0500
commitd5b15b97afbdb324d708d24cb1032a1a15d0c680 (patch)
treec4ae974bcc12887cf2a03edf55eafc0d34a65f3b /theories/Init
parent7d1138657904e5fe8ce1899daa001972ba820545 (diff)
Add rew dependent Notations
This way when users `Import EqNotations`, we get pretty-printing for equality `match` statements too.
Diffstat (limited to 'theories/Init')
-rw-r--r--theories/Init/Logic.v59
1 files changed, 52 insertions, 7 deletions
diff --git a/theories/Init/Logic.v b/theories/Init/Logic.v
index 4d84d61f9f..8ba17e38c8 100644
--- a/theories/Init/Logic.v
+++ b/theories/Init/Logic.v
@@ -460,6 +460,58 @@ Module EqNotations.
Notation "'rew' -> [ P ] H 'in' H'" := (eq_rect _ P H' _ H)
(at level 10, H' at level 10, only parsing).
+ Notation "'rew' 'dependent' H 'in' H'"
+ := (match H with
+ | eq_refl => H'
+ end)
+ (at level 10, H' at level 10,
+ format "'[' 'rew' 'dependent' H in '/' H' ']'").
+ Notation "'rew' 'dependent' -> H 'in' H'"
+ := (match H with
+ | eq_refl => H'
+ end)
+ (at level 10, H' at level 10, only parsing).
+ Notation "'rew' 'dependent' <- H 'in' H'"
+ := (match eq_sym H with
+ | eq_refl => H'
+ end)
+ (at level 10, H' at level 10,
+ format "'[' 'rew' 'dependent' <- H in '/' H' ']'").
+ Notation "'rew' 'dependent' [ 'fun' y p => P ] H 'in' H'"
+ := (match H as p in (_ = y) return P with
+ | eq_refl => H'
+ end)
+ (at level 10, H' at level 10, y ident, p ident,
+ format "'[' 'rew' 'dependent' [ 'fun' y p => P ] '/ ' H in '/' H' ']'").
+ Notation "'rew' 'dependent' -> [ 'fun' y p => P ] H 'in' H'"
+ := (match H as p in (_ = y) return P with
+ | eq_refl => H'
+ end)
+ (at level 10, H' at level 10, y ident, p ident, only parsing).
+ Notation "'rew' 'dependent' <- [ 'fun' y p => P ] H 'in' H'"
+ := (match eq_sym H as p in (_ = y) return P with
+ | eq_refl => H'
+ end)
+ (at level 10, H' at level 10, y ident, p ident,
+ format "'[' 'rew' 'dependent' <- [ 'fun' y p => P ] '/ ' H in '/' H' ']'").
+ Notation "'rew' 'dependent' [ P ] H 'in' H'"
+ := (match H as p in (_ = y) return P y p with
+ | eq_refl => H'
+ end)
+ (at level 10, H' at level 10,
+ format "'[' 'rew' 'dependent' [ P ] '/ ' H in '/' H' ']'").
+ Notation "'rew' 'dependent' -> [ P ] H 'in' H'"
+ := (match H as p in (_ = y) return P y p with
+ | eq_refl => H'
+ end)
+ (at level 10, H' at level 10,
+ only parsing).
+ Notation "'rew' 'dependent' <- [ P ] H 'in' H'"
+ := (match eq_sym H as p in (_ = y) return P y p with
+ | eq_refl => H'
+ end)
+ (at level 10, H' at level 10,
+ format "'[' 'rew' 'dependent' <- [ P ] '/ ' H in '/' H' ']'").
End EqNotations.
Import EqNotations.
@@ -793,13 +845,6 @@ Qed.
Declare Left Step iff_stepl.
Declare Right Step iff_trans.
-Local Notation "'rew' 'dependent' H 'in' H'"
- := (match H with
- | eq_refl => H'
- end)
- (at level 10, H' at level 10,
- format "'[' 'rew' 'dependent' '/ ' H in '/' H' ']'").
-
(** Equality for [ex] *)
Section ex.
Local Unset Implicit Arguments.