File tree 14 files changed +41
-2
lines changed
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 :=
8
8
ret tt.
9
9
10
10
(** Use [Existing Instance] to bring the Local [Monad_stateT] instance into context *)
11
- Existing Instance Monad_stateT.
11
+ #[global] Existing Instance Monad_stateT.
12
12
13
13
(** Now the definition succeeds *)
14
14
Definition 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.
10
10
11
11
Existing Class RESOLVE.
12
12
13
+ #[global]
13
14
Hint Extern 0 (RESOLVE _) => unfold RESOLVE : typeclass_instances.
Original file line number Diff line number Diff line change 4
4
Set Implicit Arguments .
5
5
Set Strict Implicit .
6
6
7
+ (** For backwards compatibility with hint locality attributes. *)
8
+ Set Warnings "-unsupported-attributes".
9
+
7
10
Create HintDb eq_rw discriminated.
8
11
9
12
Lemma eq_sym_eq
@@ -28,6 +31,7 @@ Lemma match_eq_sym_eq
28
31
Proof .
29
32
destruct pf. reflexivity.
30
33
Defined .
34
+ #[global]
31
35
Hint Rewrite match_eq_sym_eq : eq_rw.
32
36
33
37
Lemma match_eq_sym_eq'
@@ -40,6 +44,7 @@ Lemma match_eq_sym_eq'
40
44
Proof .
41
45
destruct pf. reflexivity.
42
46
Defined .
47
+ #[global]
43
48
Hint Rewrite match_eq_sym_eq' : eq_rw.
44
49
45
50
@@ -73,6 +78,7 @@ Lemma eq_Const_eq
73
78
Proof .
74
79
destruct pf. reflexivity.
75
80
Defined .
81
+ #[global]
76
82
Hint Rewrite eq_Const_eq : eq_rw.
77
83
78
84
Lemma eq_Arr_eq
@@ -88,11 +94,13 @@ Lemma eq_Arr_eq
88
94
Proof .
89
95
destruct pf. reflexivity.
90
96
Defined .
97
+ #[global]
91
98
Hint Rewrite eq_Arr_eq : eq_rw.
92
99
93
100
Lemma eq_sym_eq_sym : forall (T : Type) (a b : T) (pf : a = b),
94
101
eq_sym (eq_sym pf) = pf.
95
102
Proof . destruct pf. reflexivity. Defined .
103
+ #[global]
96
104
Hint Rewrite eq_sym_eq_sym : eq_rw.
97
105
98
106
Ltac autorewrite_eq_rw :=
Original file line number Diff line number Diff line change @@ -2,6 +2,9 @@ Require Import Coq.Lists.List.
2
2
Require Import Coq.ZArith.ZArith.
3
3
Require Import Coq.micromega.Lia.
4
4
5
+ (** For backwards compatibility with hint locality attributes. *)
6
+ Set Warnings "-unsupported-attributes".
7
+
5
8
Lemma firstn_app_L : forall T n (a b : list T),
6
9
n <= length a ->
7
10
firstn n (a ++ b) = firstn n a.
45
48
simpl. replace (n - 0) with n; [ | lia ]. reflexivity.
46
49
Qed .
47
50
51
+ #[global]
48
52
Hint Rewrite firstn_app_L firstn_app_R firstn_all firstn_0 firstn_cons using lia : list_rw.
49
53
50
54
Lemma skipn_app_R : forall T n (a b : list T),
90
94
simpl. replace (n - 0) with n; [ | lia ]. reflexivity.
91
95
Qed .
92
96
97
+ #[global]
93
98
Hint 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.
14
14
Set Implicit Arguments .
15
15
Set Strict Implicit .
16
16
17
+ (** For backwards compatibility with hint locality attributes. *)
18
+ Set Warnings "-unsupported-attributes".
19
+
17
20
Global Instance Foldable_option {T} : Foldable (option T) T :=
18
21
fun _ f d v =>
19
22
match v with
@@ -180,4 +183,5 @@ Proof.
180
183
destruct pf. destruct val; reflexivity.
181
184
Defined .
182
185
186
+ #[global]
183
187
Hint Rewrite eq_option_eq : eq_rw.
Original file line number Diff line number Diff line change @@ -216,6 +216,7 @@ End pmap.
216
216
217
217
Polymorphic Definition Functor_plist@{i} : Functor@{i i} plist@{i} :=
218
218
{| fmap := @fmap_plist@{i i} |}.
219
+ #[global]
219
220
Existing Instance Functor_plist.
220
221
221
222
Original file line number Diff line number Diff line change @@ -80,9 +80,11 @@ End poption_map.
80
80
81
81
Definition Functor_poption@{i} : Functor@{i i} poption@{i} :=
82
82
{| fmap := @fmap_poption@{i i} |}.
83
+ #[global]
83
84
Existing Instance Functor_poption.
84
85
85
86
Definition Applicative_poption@{i} : Applicative@{i i} poption@{i} :=
86
87
{| pure := @pSome@{i}
87
88
; ap := @ap_poption |}.
89
+ #[global]
88
90
Existing Instance Applicative_poption.
Original file line number Diff line number Diff line change @@ -7,6 +7,9 @@ Set Implicit Arguments.
7
7
Set Strict Implicit .
8
8
Set Printing Universes .
9
9
10
+ (** For backwards compatibility with hint locality attributes. *)
11
+ Set Warnings "-unsupported-attributes".
12
+
10
13
Section injective.
11
14
Variable T : Type.
12
15
Variable F : T -> Type.
@@ -39,4 +42,5 @@ Lemma eq_sigT_rw
39
42
end .
40
43
Proof . destruct pf. destruct s; reflexivity. Qed .
41
44
45
+ #[global]
42
46
Hint Rewrite eq_sigT_rw : eq_rw.
Original file line number Diff line number Diff line change @@ -132,7 +132,9 @@ Ltac all_resolve :=
132
132
| |- _ => solve [ eauto with typeclass_instances ]
133
133
end .
134
134
135
+ #[global]
135
136
Hint Extern 0 (ProductResolve _ _) => all_resolve : typeclass_instances.
137
+ #[global]
136
138
Hint Extern 0 (VariantResolve _ _) => all_resolve : typeclass_instances.
137
139
138
140
Definition comma_before (b : bool) (s : showM) : showM :=
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ Class EqvWF T :=
9
9
{ eqvWFEqv :> Eqv T
10
10
; eqvWFEquivalence :> Equivalence eqv
11
11
}.
12
+ #[global]
12
13
Instance EqvWF_Build {T} {E:Eqv T} {EV:Equivalence eqv} : EqvWF T :=
13
14
{ eqvWFEqv := E ; eqvWFEquivalence := EV }.
14
15
Original file line number Diff line number Diff line change @@ -9,10 +9,13 @@ Polymorphic Class Injection (x : Type) (t : Type) := inject : x -> t.
9
9
Class Projection x t := { project : t -> x ; pmodify : (x -> x) -> (t -> t) }.
10
10
*)
11
11
12
+ #[global]
12
13
Polymorphic Instance Injection_refl {T : Type } : Injection T T :=
13
14
{ inject := @id T }.
14
15
16
+ #[global]
15
17
Instance Injection_ascii_string : Injection ascii string :=
16
18
{ inject a := String a EmptyString }.
19
+ #[global]
17
20
Instance Injection_ascii_string_cons : Injection ascii (string -> string) :=
18
21
{ inject := String }.
Original file line number Diff line number Diff line change @@ -8,9 +8,11 @@ Definition neg_lte {T} {L:Lte T} (x:T) (y:T) : Prop := not (lte x y).
8
8
Definition lt {T} {L:Lte T} x y := lte x y /\ ~lte y x.
9
9
Definition neg_lt {T} {L:Lte T} x y := not (lt x y).
10
10
11
+ #[global]
11
12
Instance lt_RelDec {T} {L:Lte T} {RD:RelDec lte} : RelDec lt :=
12
13
{ rel_dec x y := (rel_dec x y && negb (rel_dec y x))%bool }.
13
14
15
+ #[global]
14
16
Instance lt_RelDecCorrect {T} {L:Lte T} {RD:RelDec lte} {RDC:RelDec_Correct RD}
15
17
: RelDec_Correct lt_RelDec.
16
18
Proof . constructor.
@@ -29,6 +31,7 @@ Class LteWF T :=
29
31
; lteWFPreOrder :> PreOrder lte
30
32
}.
31
33
34
+ #[global]
32
35
Instance LteWF_Build {T} {L:Lte T} {PO:PreOrder lte} : LteWF T :=
33
36
{ lteWFLte := L ; lteWFPreOrder := PO }.
34
37
Original file line number Diff line number Diff line change @@ -3,6 +3,10 @@ Require Import Coq.Bool.Bool.
3
3
Set Implicit Arguments .
4
4
Set Strict Implicit .
5
5
6
+ (** For backwards compatibility with hint locality attributes. *)
7
+ Set Warnings "-unsupported-attributes".
8
+
9
+ #[global]
6
10
Hint Rewrite negb_orb negb_andb negb_involutive if_negb : bool_rw.
7
11
8
12
Lemma negb_true : forall a, negb a = true -> a = false.
56
60
intros.
57
61
do_bool.
58
62
Abort.
59
- *)
63
+ *)
Original file line number Diff line number Diff line change @@ -101,6 +101,7 @@ Section from_rel_dec.
101
101
Qed .
102
102
End from_rel_dec.
103
103
104
+ #[global]
104
105
Hint Extern 10 (@Reflect (?f ?a ?b) _ _) =>
105
106
eapply (@Reflect_RelDecCorrect _ _ (@Build_RelDec _ _ f) _) : typeclass_instances.
106
107
You can’t perform that action at this time.
0 commit comments