File tree Expand file tree Collapse file tree 14 files changed +41
-2
lines changed
Expand file tree Collapse file tree 14 files changed +41
-2
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ Fail Definition foo : stateT unit option unit :=
88 ret tt.
99
1010(** Use [Existing Instance] to bring the Local [Monad_stateT] instance into context *)
11- Existing Instance Monad_stateT.
11+ #[global] Existing Instance Monad_stateT.
1212
1313(** Now the definition succeeds *)
1414Definition foo : stateT unit option unit :=
Original file line number Diff line number Diff line change @@ -10,4 +10,5 @@ Polymorphic Definition RESOLVE (T : Type) : Type := T.
1010
1111Existing Class RESOLVE.
1212
13+ #[global]
1314Hint Extern 0 (RESOLVE _) => unfold RESOLVE : typeclass_instances.
Original file line number Diff line number Diff line change 44Set Implicit Arguments .
55Set Strict Implicit .
66
7+ (** For backwards compatibility with hint locality attributes. *)
8+ Set Warnings "-unsupported-attributes".
9+
710Create HintDb eq_rw discriminated.
811
912Lemma eq_sym_eq
@@ -28,6 +31,7 @@ Lemma match_eq_sym_eq
2831Proof .
2932 destruct pf. reflexivity.
3033Defined .
34+ #[global]
3135Hint Rewrite match_eq_sym_eq : eq_rw.
3236
3337Lemma match_eq_sym_eq'
@@ -40,6 +44,7 @@ Lemma match_eq_sym_eq'
4044Proof .
4145 destruct pf. reflexivity.
4246Defined .
47+ #[global]
4348Hint Rewrite match_eq_sym_eq' : eq_rw.
4449
4550
@@ -73,6 +78,7 @@ Lemma eq_Const_eq
7378Proof .
7479 destruct pf. reflexivity.
7580Defined .
81+ #[global]
7682Hint Rewrite eq_Const_eq : eq_rw.
7783
7884Lemma eq_Arr_eq
@@ -88,11 +94,13 @@ Lemma eq_Arr_eq
8894Proof .
8995 destruct pf. reflexivity.
9096Defined .
97+ #[global]
9198Hint Rewrite eq_Arr_eq : eq_rw.
9299
93100Lemma eq_sym_eq_sym : forall (T : Type) (a b : T) (pf : a = b),
94101 eq_sym (eq_sym pf) = pf.
95102Proof . destruct pf. reflexivity. Defined .
103+ #[global]
96104Hint Rewrite eq_sym_eq_sym : eq_rw.
97105
98106Ltac autorewrite_eq_rw :=
Original file line number Diff line number Diff line change @@ -2,6 +2,9 @@ Require Import Coq.Lists.List.
22Require Import Coq.ZArith.ZArith.
33Require Import Coq.micromega.Lia.
44
5+ (** For backwards compatibility with hint locality attributes. *)
6+ Set Warnings "-unsupported-attributes".
7+
58Lemma firstn_app_L : forall T n (a b : list T),
69 n <= length a ->
710 firstn n (a ++ b) = firstn n a.
4548 simpl. replace (n - 0) with n; [ | lia ]. reflexivity.
4649Qed .
4750
51+ #[global]
4852Hint Rewrite firstn_app_L firstn_app_R firstn_all firstn_0 firstn_cons using lia : list_rw.
4953
5054Lemma skipn_app_R : forall T n (a b : list T),
9094 simpl. replace (n - 0) with n; [ | lia ]. reflexivity.
9195Qed .
9296
97+ #[global]
9398Hint Rewrite skipn_app_L skipn_app_R skipn_0 skipn_all skipn_cons using lia : list_rw.
Original file line number Diff line number Diff line change @@ -14,6 +14,9 @@ Require Import ExtLib.Tactics.Consider.
1414Set Implicit Arguments .
1515Set Strict Implicit .
1616
17+ (** For backwards compatibility with hint locality attributes. *)
18+ Set Warnings "-unsupported-attributes".
19+
1720Global Instance Foldable_option {T} : Foldable (option T) T :=
1821 fun _ f d v =>
1922 match v with
@@ -180,4 +183,5 @@ Proof.
180183 destruct pf. destruct val; reflexivity.
181184Defined .
182185
186+ #[global]
183187Hint Rewrite eq_option_eq : eq_rw.
Original file line number Diff line number Diff line change @@ -216,6 +216,7 @@ End pmap.
216216
217217Polymorphic Definition Functor_plist@{i} : Functor@{i i} plist@{i} :=
218218{| fmap := @fmap_plist@{i i} |}.
219+ #[global]
219220Existing Instance Functor_plist.
220221
221222
Original file line number Diff line number Diff line change @@ -80,9 +80,11 @@ End poption_map.
8080
8181Definition Functor_poption@{i} : Functor@{i i} poption@{i} :=
8282{| fmap := @fmap_poption@{i i} |}.
83+ #[global]
8384Existing Instance Functor_poption.
8485
8586Definition Applicative_poption@{i} : Applicative@{i i} poption@{i} :=
8687{| pure := @pSome@{i}
8788 ; ap := @ap_poption |}.
89+ #[global]
8890Existing Instance Applicative_poption.
Original file line number Diff line number Diff line change @@ -7,6 +7,9 @@ Set Implicit Arguments.
77Set Strict Implicit .
88Set Printing Universes .
99
10+ (** For backwards compatibility with hint locality attributes. *)
11+ Set Warnings "-unsupported-attributes".
12+
1013Section injective.
1114 Variable T : Type.
1215 Variable F : T -> Type.
@@ -39,4 +42,5 @@ Lemma eq_sigT_rw
3942 end .
4043Proof . destruct pf. destruct s; reflexivity. Qed .
4144
45+ #[global]
4246Hint Rewrite eq_sigT_rw : eq_rw.
Original file line number Diff line number Diff line change @@ -132,7 +132,9 @@ Ltac all_resolve :=
132132 | |- _ => solve [ eauto with typeclass_instances ]
133133 end .
134134
135+ #[global]
135136Hint Extern 0 (ProductResolve _ _) => all_resolve : typeclass_instances.
137+ #[global]
136138Hint Extern 0 (VariantResolve _ _) => all_resolve : typeclass_instances.
137139
138140Definition comma_before (b : bool) (s : showM) : showM :=
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ Class EqvWF T :=
99{ eqvWFEqv :> Eqv T
1010; eqvWFEquivalence :> Equivalence eqv
1111}.
12+ #[global]
1213Instance EqvWF_Build {T} {E:Eqv T} {EV:Equivalence eqv} : EqvWF T :=
1314 { eqvWFEqv := E ; eqvWFEquivalence := EV }.
1415
You can’t perform that action at this time.
0 commit comments