Unverified Commit 2e426d3f authored by Maxime Dénès's avatar Maxime Dénès
Browse files

Make trivial instances explicit

This is in preparation for coq/coq#9274.
parent 455fec93
Pipeline #13992 passed with stage
in 20 minutes and 26 seconds
......@@ -51,10 +51,10 @@ Section definitions.
Proof. apply _. Qed.
End definitions.
Instance: Params (@sts_inv) 4.
Instance: Params (@sts_ownS) 4.
Instance: Params (@sts_own) 5.
Instance: Params (@sts_ctx) 6.
Instance: Params (@sts_inv) 4 := {}.
Instance: Params (@sts_ownS) 4 := {}.
Instance: Params (@sts_own) 5 := {}.
Instance: Params (@sts_ctx) 6 := {}.
Section sts.
Context `{invG Σ, stsG Σ sts}.
......
......@@ -6,7 +6,7 @@ Definition vs `{invG Σ} (E1 E2 : coPset) (P Q : iProp Σ) : iProp Σ :=
( (P - |={E1,E2}=> Q))%I.
Arguments vs {_ _} _ _ _%I _%I.
Instance: Params (@vs) 4.
Instance: Params (@vs) 4 := {}.
Notation "P ={ E1 , E2 }=> Q" := (vs E1 E2 P Q)
(at level 99, E1,E2 at level 50, Q at level 200,
format "P ={ E1 , E2 }=> Q") : bi_scope.
......
......@@ -39,18 +39,18 @@ Definition ownI `{invG Σ} (i : positive) (P : iProp Σ) : iProp Σ :=
own invariant_name ( {[ i := invariant_unfold P ]}).
Arguments ownI {_ _} _ _%I.
Typeclasses Opaque ownI.
Instance: Params (@invariant_unfold) 1.
Instance: Params (@ownI) 3.
Instance: Params (@invariant_unfold) 1 := {}.
Instance: Params (@ownI) 3 := {}.
Definition ownE `{invG Σ} (E : coPset) : iProp Σ :=
own enabled_name (CoPset E).
Typeclasses Opaque ownE.
Instance: Params (@ownE) 3.
Instance: Params (@ownE) 3 := {}.
Definition ownD `{invG Σ} (E : gset positive) : iProp Σ :=
own disabled_name (GSet E).
Typeclasses Opaque ownD.
Instance: Params (@ownD) 3.
Instance: Params (@ownD) 3 := {}.
Definition wsat `{invG Σ} : iProp Σ :=
locked ( I : gmap positive (iProp Σ),
......
......@@ -56,7 +56,7 @@ Record uPred (M : ucmraT) : Type := UPred {
Bind Scope bi_scope with uPred.
Arguments uPred_holds {_} _%I _ _ : simpl never.
Add Printing Constructor uPred.
Instance: Params (@uPred_holds) 3.
Instance: Params (@uPred_holds) 3 := {}.
Section cofe.
Context {M : ucmraT}.
......
......@@ -15,7 +15,7 @@ Fixpoint big_sepL2 {PROP : bi} {A B}
| x1 :: l1, x2 :: l2 => Φ 0 x1 x2 big_sepL2 (λ n, Φ (S n)) l1 l2
| _, _ => False
end%I.
Instance: Params (@big_sepL2) 3.
Instance: Params (@big_sepL2) 3 := {}.
Arguments big_sepL2 {PROP A B} _ !_ !_ /.
Typeclasses Opaque big_sepL2.
......
......@@ -3,24 +3,24 @@ From iris.algebra Require Import monoid.
Definition bi_iff {PROP : bi} (P Q : PROP) : PROP := ((P Q) (Q P))%I.
Arguments bi_iff {_} _%I _%I : simpl never.
Instance: Params (@bi_iff) 1.
Instance: Params (@bi_iff) 1 := {}.
Infix "↔" := bi_iff : bi_scope.
Definition bi_wand_iff {PROP : bi} (P Q : PROP) : PROP :=
((P - Q) (Q - P))%I.
Arguments bi_wand_iff {_} _%I _%I : simpl never.
Instance: Params (@bi_wand_iff) 1.
Instance: Params (@bi_wand_iff) 1 := {}.
Infix "∗-∗" := bi_wand_iff : bi_scope.
Class Persistent {PROP : bi} (P : PROP) := persistent : P <pers> P.
Arguments Persistent {_} _%I : simpl never.
Arguments persistent {_} _%I {_}.
Hint Mode Persistent + ! : typeclass_instances.
Instance: Params (@Persistent) 1.
Instance: Params (@Persistent) 1 := {}.
Definition bi_affinely {PROP : bi} (P : PROP) : PROP := (emp P)%I.
Arguments bi_affinely {_} _%I : simpl never.
Instance: Params (@bi_affinely) 1.
Instance: Params (@bi_affinely) 1 := {}.
Typeclasses Opaque bi_affinely.
Notation "'<affine>' P" := (bi_affinely P) : bi_scope.
......@@ -39,7 +39,7 @@ Hint Mode BiPositive ! : typeclass_instances.
Definition bi_absorbingly {PROP : bi} (P : PROP) : PROP := (True P)%I.
Arguments bi_absorbingly {_} _%I : simpl never.
Instance: Params (@bi_absorbingly) 1.
Instance: Params (@bi_absorbingly) 1 := {}.
Typeclasses Opaque bi_absorbingly.
Notation "'<absorb>' P" := (bi_absorbingly P) : bi_scope.
......@@ -51,28 +51,28 @@ Hint Mode Absorbing + ! : typeclass_instances.
Definition bi_persistently_if {PROP : bi} (p : bool) (P : PROP) : PROP :=
(if p then <pers> P else P)%I.
Arguments bi_persistently_if {_} !_ _%I /.
Instance: Params (@bi_persistently_if) 2.
Instance: Params (@bi_persistently_if) 2 := {}.
Typeclasses Opaque bi_persistently_if.
Notation "'<pers>?' p P" := (bi_persistently_if p P) : bi_scope.
Definition bi_affinely_if {PROP : bi} (p : bool) (P : PROP) : PROP :=
(if p then <affine> P else P)%I.
Arguments bi_affinely_if {_} !_ _%I /.
Instance: Params (@bi_affinely_if) 2.
Instance: Params (@bi_affinely_if) 2 := {}.
Typeclasses Opaque bi_affinely_if.
Notation "'<affine>?' p P" := (bi_affinely_if p P) : bi_scope.
Definition bi_intuitionistically {PROP : bi} (P : PROP) : PROP :=
(<affine> <pers> P)%I.
Arguments bi_intuitionistically {_} _%I : simpl never.
Instance: Params (@bi_intuitionistically) 1.
Instance: Params (@bi_intuitionistically) 1 := {}.
Typeclasses Opaque bi_intuitionistically.
Notation "□ P" := (bi_intuitionistically P) : bi_scope.
Definition bi_intuitionistically_if {PROP : bi} (p : bool) (P : PROP) : PROP :=
(if p then P else P)%I.
Arguments bi_intuitionistically_if {_} !_ _%I /.
Instance: Params (@bi_intuitionistically_if) 2.
Instance: Params (@bi_intuitionistically_if) 2 := {}.
Typeclasses Opaque bi_intuitionistically_if.
Notation "'□?' p P" := (bi_intuitionistically_if p P) : bi_scope.
......@@ -82,21 +82,21 @@ Fixpoint sbi_laterN {PROP : sbi} (n : nat) (P : PROP) : PROP :=
| S n' => sbi_laterN n' P
end%I.
Arguments sbi_laterN {_} !_%nat_scope _%I.
Instance: Params (@sbi_laterN) 2.
Instance: Params (@sbi_laterN) 2 := {}.
Notation "▷^ n P" := (sbi_laterN n P) : bi_scope.
Notation "▷? p P" := (sbi_laterN (Nat.b2n p) P) : bi_scope.
Definition sbi_except_0 {PROP : sbi} (P : PROP) : PROP := ( False P)%I.
Arguments sbi_except_0 {_} _%I : simpl never.
Notation "◇ P" := (sbi_except_0 P) : bi_scope.
Instance: Params (@sbi_except_0) 1.
Instance: Params (@sbi_except_0) 1 := {}.
Typeclasses Opaque sbi_except_0.
Class Timeless {PROP : sbi} (P : PROP) := timeless : P P.
Arguments Timeless {_} _%I : simpl never.
Arguments timeless {_} _%I {_}.
Hint Mode Timeless + ! : typeclass_instances.
Instance: Params (@Timeless) 1.
Instance: Params (@Timeless) 1 := {}.
(** An optional precondition [mP] to [Q].
TODO: We may actually consider generalizing this to a list of preconditions,
......
......@@ -4,7 +4,7 @@ From iris.bi Require Import interface derived_laws_sbi big_op plainly updates.
Class Embed (A B : Type) := embed : A B.
Arguments embed {_ _ _} _%I : simpl never.
Notation "⎡ P ⎤" := (embed P) : bi_scope.
Instance: Params (@embed) 3.
Instance: Params (@embed) 3 := {}.
Typeclasses Opaque embed.
Hint Mode Embed ! - : typeclass_instances.
......
......@@ -171,17 +171,17 @@ Structure bi := Bi {
Coercion bi_ofeC (PROP : bi) : ofeT := OfeT PROP (bi_ofe_mixin PROP).
Canonical Structure bi_ofeC.
Instance: Params (@bi_entails) 1.
Instance: Params (@bi_emp) 1.
Instance: Params (@bi_pure) 1.
Instance: Params (@bi_and) 1.
Instance: Params (@bi_or) 1.
Instance: Params (@bi_impl) 1.
Instance: Params (@bi_forall) 2.
Instance: Params (@bi_exist) 2.
Instance: Params (@bi_sep) 1.
Instance: Params (@bi_wand) 1.
Instance: Params (@bi_persistently) 1.
Instance: Params (@bi_entails) 1 := {}.
Instance: Params (@bi_emp) 1 := {}.
Instance: Params (@bi_pure) 1 := {}.
Instance: Params (@bi_and) 1 := {}.
Instance: Params (@bi_or) 1 := {}.
Instance: Params (@bi_impl) 1 := {}.
Instance: Params (@bi_forall) 2 := {}.
Instance: Params (@bi_exist) 2 := {}.
Instance: Params (@bi_sep) 1 := {}.
Instance: Params (@bi_wand) 1 := {}.
Instance: Params (@bi_persistently) 1 := {}.
Arguments bi_car : simpl never.
Arguments bi_dist : simpl never.
......@@ -224,8 +224,8 @@ Structure sbi := Sbi {
sbi_persistently sbi_internal_eq sbi_later;
}.
Instance: Params (@sbi_later) 1.
Instance: Params (@sbi_internal_eq) 1.
Instance: Params (@sbi_later) 1 := {}.
Instance: Params (@sbi_internal_eq) 1 := {}.
Arguments sbi_later {PROP} _%I : simpl never, rename.
Arguments sbi_internal_eq {PROP _} _ _ : simpl never, rename.
......@@ -256,7 +256,7 @@ Arguments sbi_internal_eq {PROP _} _ _ : simpl never, rename.
Arguments sbi_later {PROP} _%I : simpl never, rename.
Hint Extern 0 (bi_entails _ _) => reflexivity : core.
Instance bi_rewrite_relation (PROP : bi) : RewriteRelation (@bi_entails PROP).
Instance bi_rewrite_relation (PROP : bi) : RewriteRelation (@bi_entails PROP) := {}.
Instance bi_inhabited {PROP : bi} : Inhabited PROP := populate (bi_pure True).
Notation "P ⊢ Q" := (bi_entails P%I Q%I) : stdpp_scope.
......
......@@ -10,7 +10,7 @@ Definition coreP `{!BiPlainly PROP} (P : PROP) : PROP :=
(* TODO: Looks like we want notation for affinely-plainly; that lets us avoid
using conjunction/implication here. *)
( Q : PROP, <affine> (Q - <pers> Q) - <affine> (P - Q) - Q)%I.
Instance: Params (@coreP) 1.
Instance: Params (@coreP) 1 := {}.
Typeclasses Opaque coreP.
Section core.
......
......@@ -357,7 +357,7 @@ Class Objective {I : biIndex} {PROP : bi} (P : monPred I PROP) :=
Arguments Objective {_ _} _%I.
Arguments objective_at {_ _} _%I {_}.
Hint Mode Objective + + ! : typeclass_instances.
Instance: Params (@Objective) 2.
Instance: Params (@Objective) 2 := {}.
(** Primitive facts that cannot be deduced from the BI structure. *)
......
......@@ -4,7 +4,7 @@ Import interface.bi derived_laws_bi.bi derived_laws_sbi.bi.
Class Plainly (A : Type) := plainly : A A.
Hint Mode Plainly ! : typeclass_instances.
Instance: Params (@plainly) 2.
Instance: Params (@plainly) 2 := {}.
Notation "■ P" := (plainly P) : bi_scope.
(* Mixins allow us to create instances easily without having to use Program *)
......@@ -87,12 +87,12 @@ Class Plain `{BiPlainly PROP} (P : PROP) := plain : P ⊢ ■ P.
Arguments Plain {_ _} _%I : simpl never.
Arguments plain {_ _} _%I {_}.
Hint Mode Plain + - ! : typeclass_instances.
Instance: Params (@Plain) 1.
Instance: Params (@Plain) 1 := {}.
Definition plainly_if `{!BiPlainly PROP} (p : bool) (P : PROP) : PROP :=
(if p then P else P)%I.
Arguments plainly_if {_ _} !_ _%I /.
Instance: Params (@plainly_if) 2.
Instance: Params (@plainly_if) 2 := {}.
Typeclasses Opaque plainly_if.
Notation "■? p P" := (plainly_if p P) : bi_scope.
......
......@@ -118,17 +118,17 @@ Module bi_reflection. Section bi_reflection.
Proof. intros. rewrite /= comm. by apply split_l. Qed.
Class Quote (Σ1 Σ2 : list PROP) (P : PROP) (e : expr) := {}.
Global Instance quote_True Σ : Quote Σ Σ emp%I EEmp.
Global Instance quote_True Σ : Quote Σ Σ emp%I EEmp := {}.
Global Instance quote_var Σ1 Σ2 P i:
rlist.QuoteLookup Σ1 Σ2 P i Quote Σ1 Σ2 P (EVar i) | 1000.
rlist.QuoteLookup Σ1 Σ2 P i Quote Σ1 Σ2 P (EVar i) | 1000 := {}.
Global Instance quote_sep Σ1 Σ2 Σ3 P1 P2 e1 e2 :
Quote Σ1 Σ2 P1 e1 Quote Σ2 Σ3 P2 e2 Quote Σ1 Σ3 (P1 P2)%I (ESep e1 e2).
Quote Σ1 Σ2 P1 e1 Quote Σ2 Σ3 P2 e2 Quote Σ1 Σ3 (P1 P2)%I (ESep e1 e2) := {}.
Class QuoteArgs (Σ : list PROP) (Ps : list PROP) (ns : list nat) := {}.
Global Instance quote_args_nil Σ : QuoteArgs Σ nil nil.
Global Instance quote_args_nil Σ : QuoteArgs Σ nil nil := {}.
Global Instance quote_args_cons Σ Ps P ns n :
rlist.QuoteLookup Σ Σ P n
QuoteArgs Σ Ps ns QuoteArgs Σ (P :: Ps) (n :: ns).
QuoteArgs Σ Ps ns QuoteArgs Σ (P :: Ps) (n :: ns) := {}.
End bi_reflection.
Ltac quote :=
......
......@@ -5,7 +5,7 @@ Import interface.bi derived_laws_bi.bi derived_laws_sbi.bi.
(* We first define operational type classes for the notations, and then later
bundle these operational type classes with the laws. *)
Class BUpd (PROP : Type) : Type := bupd : PROP PROP.
Instance : Params (@bupd) 2.
Instance : Params (@bupd) 2 := {}.
Hint Mode BUpd ! : typeclass_instances.
Notation "|==> Q" := (bupd Q) : bi_scope.
......@@ -13,7 +13,7 @@ Notation "P ==∗ Q" := (P ⊢ |==> Q) (only parsing) : stdpp_scope.
Notation "P ==∗ Q" := (P - |==> Q)%I : bi_scope.
Class FUpd (PROP : Type) : Type := fupd : coPset coPset PROP PROP.
Instance: Params (@fupd) 4.
Instance: Params (@fupd) 4 := {}.
Hint Mode FUpd ! : typeclass_instances.
Notation "|={ E1 , E2 }=> Q" := (fupd E1 E2 Q) : bi_scope.
......
......@@ -30,12 +30,12 @@ to pick a default value depending on [A]. *)
Class Wp (Λ : language) (PROP A : Type) :=
wp : A coPset expr Λ (val Λ PROP) PROP.
Arguments wp {_ _ _ _} _ _ _%E _%I.
Instance: Params (@wp) 7.
Instance: Params (@wp) 7 := {}.
Class Twp (Λ : language) (PROP A : Type) :=
twp : A coPset expr Λ (val Λ PROP) PROP.
Arguments twp {_ _ _ _} _ _ _%E _%I.
Instance: Params (@twp) 7.
Instance: Params (@twp) 7 := {}.
(** Notations for partial weakest preconditions *)
(** Notations without binder -- only parsing because they overlap with the
......
......@@ -6,7 +6,7 @@ Set Default Proof Using "Type".
Definition ht `{irisG Λ Σ} (s : stuckness) (E : coPset) (P : iProp Σ)
(e : expr Λ) (Φ : val Λ iProp Σ) : iProp Σ :=
( (P - WP e @ s; E {{ Φ }}))%I.
Instance: Params (@ht) 5.
Instance: Params (@ht) 5 := {}.
Notation "{{ P } } e @ s ; E {{ Φ } }" := (ht s E P%I e%E Φ%I)
(at level 20, P, e, Φ at level 200,
......
......@@ -35,7 +35,7 @@ Definition ownP `{ownPG Λ Σ} (σ : state Λ) : iProp Σ :=
own ownP_name ( (Excl' σ)).
Typeclasses Opaque ownP.
Instance: Params (@ownP) 3.
Instance: Params (@ownP) 3 := {}.
(* Adequacy *)
Theorem ownP_adequacy Σ `{ownPPreG Λ Σ} s e σ φ :
......
......@@ -998,7 +998,7 @@ Proof. by rewrite /FromForall -embed_forall => <-. Qed.
(** IntoInv *)
Global Instance into_inv_embed {PROP' : bi} `{BiEmbed PROP PROP'} P N :
IntoInv P N IntoInv P N.
IntoInv P N IntoInv P N := {}.
(** ElimModal *)
Global Instance elim_modal_wand φ p p' P P' Q Q' R :
......
......@@ -10,8 +10,8 @@ Inductive env (A : Type) : Type :=
| Esnoc : env A ident A env A.
Arguments Enil {_}.
Arguments Esnoc {_} _ _ _.
Instance: Params (@Enil) 1.
Instance: Params (@Esnoc) 1.
Instance: Params (@Enil) 1 := {}.
Instance: Params (@Esnoc) 1 := {}.
Fixpoint env_lookup {A} (i : ident) (Γ : env A) : option A :=
match Γ with
......@@ -37,7 +37,7 @@ Inductive env_wf {A} : env A → Prop :=
Fixpoint env_to_list {A} (E : env A) : list A :=
match E with Enil => [] | Esnoc Γ _ x => x :: env_to_list Γ end.
Coercion env_to_list : env >-> list.
Instance: Params (@env_to_list) 1.
Instance: Params (@env_to_list) 1 := {}.
Fixpoint env_dom {A} (Γ : env A) : list ident :=
match Γ with Enil => [] | Esnoc Γ i _ => i :: env_dom Γ end.
......@@ -228,7 +228,7 @@ Record envs_wf {PROP} (Δ : envs PROP) := {
Definition of_envs {PROP} (Δ : envs PROP) : PROP :=
(envs_wf Δ⌝ [] env_intuitionistic Δ [] env_spatial Δ)%I.
Instance: Params (@of_envs) 1.
Instance: Params (@of_envs) 1 := {}.
Arguments of_envs : simpl never.
(* We seal [envs_entails], so that it does not get unfolded by the
......@@ -238,7 +238,7 @@ Proof. by eexists. Qed.
Definition envs_entails := envs_entails_aux.(unseal).
Definition envs_entails_eq : envs_entails = _ := envs_entails_aux.(seal_eq).
Arguments envs_entails {PROP} Δ Q%I : rename.
Instance: Params (@envs_entails) 1.
Instance: Params (@envs_entails) 1 := {}.
Record envs_Forall2 {PROP : bi} (R : relation PROP) (Δ1 Δ2 : envs PROP) := {
env_intuitionistic_Forall2 : env_Forall2 R (env_intuitionistic Δ1) (env_intuitionistic Δ2);
......
......@@ -1616,15 +1616,15 @@ Class CopyDestruct {PROP : bi} (P : PROP).
Arguments CopyDestruct {_} _%I.
Hint Mode CopyDestruct + ! : typeclass_instances.
Instance copy_destruct_forall {PROP : bi} {A} (Φ : A PROP) : CopyDestruct ( x, Φ x).
Instance copy_destruct_forall {PROP : bi} {A} (Φ : A PROP) : CopyDestruct ( x, Φ x) := {}.
Instance copy_destruct_impl {PROP : bi} (P Q : PROP) :
CopyDestruct Q CopyDestruct (P Q).
CopyDestruct Q CopyDestruct (P Q) := {}.
Instance copy_destruct_wand {PROP : bi} (P Q : PROP) :
CopyDestruct Q CopyDestruct (P - Q).
CopyDestruct Q CopyDestruct (P - Q) := {}.
Instance copy_destruct_affinely {PROP : bi} (P : PROP) :
CopyDestruct P CopyDestruct (<affine> P).
CopyDestruct P CopyDestruct (<affine> P) := {}.
Instance copy_destruct_persistently {PROP : bi} (P : PROP) :
CopyDestruct P CopyDestruct (<pers> P).
CopyDestruct P CopyDestruct (<pers> P) := {}.
Tactic Notation "iDestructCore" open_constr(lem) "as" constr(p) tactic(tac) :=
let ident :=
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment