Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Adapt w.r.t. coq/coq#16004. #127

Merged
merged 2 commits into from
Jul 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 12 additions & 21 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,29 +61,20 @@ workflows:
test:
jobs:
- build:
name: "Coq 8.8"
coq: "coqorg/coq:8.8"
name: "Coq 8.11"
coq: "coqorg/coq:8.11"
- build:
name: "Coq 8.9"
coq: "coqorg/coq:8.9"
name: "Coq 8.12"
coq: "coqorg/coq:8.12"
- build:
name: "Coq 8.10"
coq: "coqorg/coq:8.10"
name: "Coq 8.13"
coq: "coqorg/coq:8.13"
- build:
name: "Coq 8.11-ocaml-4.11-flambda"
coq: "coqorg/coq:8.11-ocaml-4.11-flambda"
name: "Coq 8.14"
coq: "coqorg/coq:8.14"
- build:
name: "Coq 8.12-ocaml-4.11-flambda"
coq: "coqorg/coq:8.12-ocaml-4.11-flambda"
name: "Coq 8.15"
coq: "coqorg/coq:8.15"
- build:
name: "Coq 8.13-ocaml-4.12-flambda"
coq: "coqorg/coq:8.13-ocaml-4.12-flambda"
- build:
name: "Coq 8.14-ocaml-4.12-flambda"
coq: "coqorg/coq:8.14-ocaml-4.12-flambda"
- build:
name: "Coq 8.15-ocaml-4.12-flambda"
coq: "coqorg/coq:8.15-ocaml-4.12-flambda"
- build:
name: "Coq dev-ocaml-4.12-flambda"
coq: "coqorg/coq:dev-ocaml-4.12-flambda"
name: "Coq dev"
coq: "coqorg/coq:dev"
2 changes: 1 addition & 1 deletion examples/StateTMonad.v
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Fail Definition foo : stateT unit option unit :=
ret tt.

(** Use [Existing Instance] to bring the Local [Monad_stateT] instance into context *)
Existing Instance Monad_stateT.
#[global] Existing Instance Monad_stateT.

(** Now the definition succeeds *)
Definition foo : stateT unit option unit :=
Expand Down
15 changes: 6 additions & 9 deletions meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,12 @@ supported_coq_versions:
opam: '{ >= "8.8" }'

tested_coq_opam_versions:
- version: '8.8'
- version: '8.9'
- version: '8.10'
- version: '8.11-ocaml-4.11-flambda'
- version: '8.12-ocaml-4.11-flambda'
- version: '8.13-ocaml-4.12-flambda'
- version: '8.14-ocaml-4.12-flambda'
- version: '8.15-ocaml-4.12-flambda'
- version: 'dev-ocaml-4.12-flambda'
- version: '8.11'
- version: '8.12'
- version: '8.13'
- version: '8.14'
- version: '8.15'
- version: 'dev'

make_target: theories
test_target: examples
Expand Down
1 change: 1 addition & 0 deletions theories/Core/Any.v
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ Polymorphic Definition RESOLVE (T : Type) : Type := T.

Existing Class RESOLVE.

#[global]
Hint Extern 0 (RESOLVE _) => unfold RESOLVE : typeclass_instances.
8 changes: 8 additions & 0 deletions theories/Data/Eq.v
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
Set Implicit Arguments.
Set Strict Implicit.

(** For backwards compatibility with hint locality attributes. *)
Set Warnings "-unsupported-attributes".

Create HintDb eq_rw discriminated.

Lemma eq_sym_eq
Expand All @@ -28,6 +31,7 @@ Lemma match_eq_sym_eq
Proof.
destruct pf. reflexivity.
Defined.
#[global]
Hint Rewrite match_eq_sym_eq : eq_rw.

Lemma match_eq_sym_eq'
Expand All @@ -40,6 +44,7 @@ Lemma match_eq_sym_eq'
Proof.
destruct pf. reflexivity.
Defined.
#[global]
Hint Rewrite match_eq_sym_eq' : eq_rw.


Expand Down Expand Up @@ -73,6 +78,7 @@ Lemma eq_Const_eq
Proof.
destruct pf. reflexivity.
Defined.
#[global]
Hint Rewrite eq_Const_eq : eq_rw.

Lemma eq_Arr_eq
Expand All @@ -88,11 +94,13 @@ Lemma eq_Arr_eq
Proof.
destruct pf. reflexivity.
Defined.
#[global]
Hint Rewrite eq_Arr_eq : eq_rw.

Lemma eq_sym_eq_sym : forall (T : Type) (a b : T) (pf : a = b),
eq_sym (eq_sym pf) = pf.
Proof. destruct pf. reflexivity. Defined.
#[global]
Hint Rewrite eq_sym_eq_sym : eq_rw.

Ltac autorewrite_eq_rw :=
Expand Down
5 changes: 5 additions & 0 deletions theories/Data/ListFirstnSkipn.v
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ Require Import Coq.Lists.List.
Require Import Coq.ZArith.ZArith.
Require Import Coq.micromega.Lia.

(** For backwards compatibility with hint locality attributes. *)
Set Warnings "-unsupported-attributes".

Lemma firstn_app_L : forall T n (a b : list T),
n <= length a ->
firstn n (a ++ b) = firstn n a.
Expand Down Expand Up @@ -45,6 +48,7 @@ Proof.
simpl. replace (n - 0) with n; [ | lia ]. reflexivity.
Qed.

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

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

#[global]
Hint Rewrite skipn_app_L skipn_app_R skipn_0 skipn_all skipn_cons using lia : list_rw.
4 changes: 4 additions & 0 deletions theories/Data/Option.v
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ Require Import ExtLib.Tactics.Consider.
Set Implicit Arguments.
Set Strict Implicit.

(** For backwards compatibility with hint locality attributes. *)
Set Warnings "-unsupported-attributes".

Global Instance Foldable_option {T} : Foldable (option T) T :=
fun _ f d v =>
match v with
Expand Down Expand Up @@ -180,4 +183,5 @@ Proof.
destruct pf. destruct val; reflexivity.
Defined.

#[global]
Hint Rewrite eq_option_eq : eq_rw.
1 change: 1 addition & 0 deletions theories/Data/PList.v
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ End pmap.

Polymorphic Definition Functor_plist@{i} : Functor@{i i} plist@{i} :=
{| fmap := @fmap_plist@{i i} |}.
#[global]
Existing Instance Functor_plist.


Expand Down
2 changes: 2 additions & 0 deletions theories/Data/POption.v
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,11 @@ End poption_map.

Definition Functor_poption@{i} : Functor@{i i} poption@{i} :=
{| fmap := @fmap_poption@{i i} |}.
#[global]
Existing Instance Functor_poption.

Definition Applicative_poption@{i} : Applicative@{i i} poption@{i} :=
{| pure := @pSome@{i}
; ap := @ap_poption |}.
#[global]
Existing Instance Applicative_poption.
4 changes: 4 additions & 0 deletions theories/Data/SigT.v
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ Set Implicit Arguments.
Set Strict Implicit.
Set Printing Universes.

(** For backwards compatibility with hint locality attributes. *)
Set Warnings "-unsupported-attributes".

Section injective.
Variable T : Type.
Variable F : T -> Type.
Expand Down Expand Up @@ -39,4 +42,5 @@ Lemma eq_sigT_rw
end.
Proof. destruct pf. destruct s; reflexivity. Qed.

#[global]
Hint Rewrite eq_sigT_rw : eq_rw.
2 changes: 2 additions & 0 deletions theories/Generic/Ind.v
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,9 @@ Ltac all_resolve :=
| |- _ => solve [ eauto with typeclass_instances ]
end.

#[global]
Hint Extern 0 (ProductResolve _ _) => all_resolve : typeclass_instances.
#[global]
Hint Extern 0 (VariantResolve _ _) => all_resolve : typeclass_instances.

Definition comma_before (b : bool) (s : showM) : showM :=
Expand Down
1 change: 1 addition & 0 deletions theories/Programming/Eqv.v
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Class EqvWF T :=
{ eqvWFEqv :> Eqv T
; eqvWFEquivalence :> Equivalence eqv
}.
#[global]
Instance EqvWF_Build {T} {E:Eqv T} {EV:Equivalence eqv} : EqvWF T :=
{ eqvWFEqv := E ; eqvWFEquivalence := EV }.

Expand Down
3 changes: 3 additions & 0 deletions theories/Programming/Injection.v
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,13 @@ Polymorphic Class Injection (x : Type) (t : Type) := inject : x -> t.
Class Projection x t := { project : t -> x ; pmodify : (x -> x) -> (t -> t) }.
*)

#[global]
Polymorphic Instance Injection_refl {T : Type} : Injection T T :=
{ inject := @id T }.

#[global]
Instance Injection_ascii_string : Injection ascii string :=
{ inject a := String a EmptyString }.
#[global]
Instance Injection_ascii_string_cons : Injection ascii (string -> string) :=
{ inject := String }.
3 changes: 3 additions & 0 deletions theories/Programming/Le.v
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@ Definition neg_lte {T} {L:Lte T} (x:T) (y:T) : Prop := not (lte x y).
Definition lt {T} {L:Lte T} x y := lte x y /\ ~lte y x.
Definition neg_lt {T} {L:Lte T} x y := not (lt x y).

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

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

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

Expand Down
6 changes: 5 additions & 1 deletion theories/Tactics/BoolTac.v
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ Require Import Coq.Bool.Bool.
Set Implicit Arguments.
Set Strict Implicit.

(** For backwards compatibility with hint locality attributes. *)
Set Warnings "-unsupported-attributes".

#[global]
Hint Rewrite negb_orb negb_andb negb_involutive if_negb : bool_rw.

Lemma negb_true : forall a, negb a = true -> a = false.
Expand Down Expand Up @@ -56,4 +60,4 @@ Proof.
intros.
do_bool.
Abort.
*)
*)
1 change: 1 addition & 0 deletions theories/Tactics/Consider.v
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ Section from_rel_dec.
Qed.
End from_rel_dec.

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

Expand Down