Skip to content

Commit 1bada58

Browse files
committed
Adapt w.r.t. coq/coq#16004.
1 parent 506d298 commit 1bada58

File tree

14 files changed

+41
-2
lines changed

14 files changed

+41
-2
lines changed

examples/StateTMonad.v

+1-1
Original file line numberDiff line numberDiff 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 *)
1414
Definition foo : stateT unit option unit :=

theories/Core/Any.v

+1
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@ Polymorphic Definition RESOLVE (T : Type) : Type := T.
1010

1111
Existing Class RESOLVE.
1212

13+
#[global]
1314
Hint Extern 0 (RESOLVE _) => unfold RESOLVE : typeclass_instances.

theories/Data/Eq.v

+8
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
Set Implicit Arguments.
55
Set Strict Implicit.
66

7+
(** For backwards compatibility with hint locality attributes. *)
8+
Set Warnings "-unsupported-attributes".
9+
710
Create HintDb eq_rw discriminated.
811

912
Lemma eq_sym_eq
@@ -28,6 +31,7 @@ Lemma match_eq_sym_eq
2831
Proof.
2932
destruct pf. reflexivity.
3033
Defined.
34+
#[global]
3135
Hint Rewrite match_eq_sym_eq : eq_rw.
3236

3337
Lemma match_eq_sym_eq'
@@ -40,6 +44,7 @@ Lemma match_eq_sym_eq'
4044
Proof.
4145
destruct pf. reflexivity.
4246
Defined.
47+
#[global]
4348
Hint Rewrite match_eq_sym_eq' : eq_rw.
4449

4550

@@ -73,6 +78,7 @@ Lemma eq_Const_eq
7378
Proof.
7479
destruct pf. reflexivity.
7580
Defined.
81+
#[global]
7682
Hint Rewrite eq_Const_eq : eq_rw.
7783

7884
Lemma eq_Arr_eq
@@ -88,11 +94,13 @@ Lemma eq_Arr_eq
8894
Proof.
8995
destruct pf. reflexivity.
9096
Defined.
97+
#[global]
9198
Hint Rewrite eq_Arr_eq : eq_rw.
9299

93100
Lemma eq_sym_eq_sym : forall (T : Type) (a b : T) (pf : a = b),
94101
eq_sym (eq_sym pf) = pf.
95102
Proof. destruct pf. reflexivity. Defined.
103+
#[global]
96104
Hint Rewrite eq_sym_eq_sym : eq_rw.
97105

98106
Ltac autorewrite_eq_rw :=

theories/Data/ListFirstnSkipn.v

+5
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ Require Import Coq.Lists.List.
22
Require Import Coq.ZArith.ZArith.
33
Require Import Coq.micromega.Lia.
44

5+
(** For backwards compatibility with hint locality attributes. *)
6+
Set Warnings "-unsupported-attributes".
7+
58
Lemma firstn_app_L : forall T n (a b : list T),
69
n <= length a ->
710
firstn n (a ++ b) = firstn n a.
@@ -45,6 +48,7 @@ Proof.
4548
simpl. replace (n - 0) with n; [ | lia ]. reflexivity.
4649
Qed.
4750

51+
#[global]
4852
Hint Rewrite firstn_app_L firstn_app_R firstn_all firstn_0 firstn_cons using lia : list_rw.
4953

5054
Lemma skipn_app_R : forall T n (a b : list T),
@@ -90,4 +94,5 @@ Proof.
9094
simpl. replace (n - 0) with n; [ | lia ]. reflexivity.
9195
Qed.
9296

97+
#[global]
9398
Hint Rewrite skipn_app_L skipn_app_R skipn_0 skipn_all skipn_cons using lia : list_rw.

theories/Data/Option.v

+4
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ Require Import ExtLib.Tactics.Consider.
1414
Set Implicit Arguments.
1515
Set Strict Implicit.
1616

17+
(** For backwards compatibility with hint locality attributes. *)
18+
Set Warnings "-unsupported-attributes".
19+
1720
Global 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.
181184
Defined.
182185

186+
#[global]
183187
Hint Rewrite eq_option_eq : eq_rw.

theories/Data/PList.v

+1
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,7 @@ End pmap.
216216

217217
Polymorphic Definition Functor_plist@{i} : Functor@{i i} plist@{i} :=
218218
{| fmap := @fmap_plist@{i i} |}.
219+
#[global]
219220
Existing Instance Functor_plist.
220221

221222

theories/Data/POption.v

+2
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,11 @@ End poption_map.
8080

8181
Definition Functor_poption@{i} : Functor@{i i} poption@{i} :=
8282
{| fmap := @fmap_poption@{i i} |}.
83+
#[global]
8384
Existing Instance Functor_poption.
8485

8586
Definition Applicative_poption@{i} : Applicative@{i i} poption@{i} :=
8687
{| pure := @pSome@{i}
8788
; ap := @ap_poption |}.
89+
#[global]
8890
Existing Instance Applicative_poption.

theories/Data/SigT.v

+4
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ Set Implicit Arguments.
77
Set Strict Implicit.
88
Set Printing Universes.
99

10+
(** For backwards compatibility with hint locality attributes. *)
11+
Set Warnings "-unsupported-attributes".
12+
1013
Section injective.
1114
Variable T : Type.
1215
Variable F : T -> Type.
@@ -39,4 +42,5 @@ Lemma eq_sigT_rw
3942
end.
4043
Proof. destruct pf. destruct s; reflexivity. Qed.
4144

45+
#[global]
4246
Hint Rewrite eq_sigT_rw : eq_rw.

theories/Generic/Ind.v

+2
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,9 @@ Ltac all_resolve :=
132132
| |- _ => solve [ eauto with typeclass_instances ]
133133
end.
134134

135+
#[global]
135136
Hint Extern 0 (ProductResolve _ _) => all_resolve : typeclass_instances.
137+
#[global]
136138
Hint Extern 0 (VariantResolve _ _) => all_resolve : typeclass_instances.
137139

138140
Definition comma_before (b : bool) (s : showM) : showM :=

theories/Programming/Eqv.v

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Class EqvWF T :=
99
{ eqvWFEqv :> Eqv T
1010
; eqvWFEquivalence :> Equivalence eqv
1111
}.
12+
#[global]
1213
Instance EqvWF_Build {T} {E:Eqv T} {EV:Equivalence eqv} : EqvWF T :=
1314
{ eqvWFEqv := E ; eqvWFEquivalence := EV }.
1415

theories/Programming/Injection.v

+3
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,13 @@ Polymorphic Class Injection (x : Type) (t : Type) := inject : x -> t.
99
Class Projection x t := { project : t -> x ; pmodify : (x -> x) -> (t -> t) }.
1010
*)
1111

12+
#[global]
1213
Polymorphic Instance Injection_refl {T : Type} : Injection T T :=
1314
{ inject := @id T }.
1415

16+
#[global]
1517
Instance Injection_ascii_string : Injection ascii string :=
1618
{ inject a := String a EmptyString }.
19+
#[global]
1720
Instance Injection_ascii_string_cons : Injection ascii (string -> string) :=
1821
{ inject := String }.

theories/Programming/Le.v

+3
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,11 @@ Definition neg_lte {T} {L:Lte T} (x:T) (y:T) : Prop := not (lte x y).
88
Definition lt {T} {L:Lte T} x y := lte x y /\ ~lte y x.
99
Definition neg_lt {T} {L:Lte T} x y := not (lt x y).
1010

11+
#[global]
1112
Instance lt_RelDec {T} {L:Lte T} {RD:RelDec lte} : RelDec lt :=
1213
{ rel_dec x y := (rel_dec x y && negb (rel_dec y x))%bool }.
1314

15+
#[global]
1416
Instance lt_RelDecCorrect {T} {L:Lte T} {RD:RelDec lte} {RDC:RelDec_Correct RD}
1517
: RelDec_Correct lt_RelDec.
1618
Proof. constructor.
@@ -29,6 +31,7 @@ Class LteWF T :=
2931
; lteWFPreOrder :> PreOrder lte
3032
}.
3133

34+
#[global]
3235
Instance LteWF_Build {T} {L:Lte T} {PO:PreOrder lte} : LteWF T :=
3336
{ lteWFLte := L ; lteWFPreOrder := PO }.
3437

theories/Tactics/BoolTac.v

+5-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ Require Import Coq.Bool.Bool.
33
Set Implicit Arguments.
44
Set Strict Implicit.
55

6+
(** For backwards compatibility with hint locality attributes. *)
7+
Set Warnings "-unsupported-attributes".
8+
9+
#[global]
610
Hint Rewrite negb_orb negb_andb negb_involutive if_negb : bool_rw.
711

812
Lemma negb_true : forall a, negb a = true -> a = false.
@@ -56,4 +60,4 @@ Proof.
5660
intros.
5761
do_bool.
5862
Abort.
59-
*)
63+
*)

theories/Tactics/Consider.v

+1
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ Section from_rel_dec.
101101
Qed.
102102
End from_rel_dec.
103103

104+
#[global]
104105
Hint Extern 10 (@Reflect (?f ?a ?b) _ _) =>
105106
eapply (@Reflect_RelDecCorrect _ _ (@Build_RelDec _ _ f) _) : typeclass_instances.
106107

0 commit comments

Comments
 (0)