diff --git a/iris/bi/big_op.v b/iris/bi/big_op.v index b2c883411a41b6878fc1c06573aa7d0db9d47c35..b7affdfdcde81325d24fbf8f3fbb9c867c562b9b 100644 --- a/iris/bi/big_op.v +++ b/iris/bi/big_op.v @@ -7,29 +7,29 @@ Import interface.bi derived_laws.bi derived_laws_later.bi. (** Notations for unary variants *) Notation "'[∗' 'list]' k ↦ x ∈ l , P" := - (big_opL bi_sep (λ k x, P) l) : bi_scope. + (big_opL bi_sep (λ k x, P%I) l) : bi_scope. Notation "'[∗' 'list]' x ∈ l , P" := - (big_opL bi_sep (λ _ x, P) l) : bi_scope. -Notation "'[∗]' Ps" := (big_opL bi_sep (λ _ x, x) Ps) : bi_scope. + (big_opL bi_sep (λ _ x, P%I) l) : bi_scope. +Notation "'[∗]' Ps" := (big_opL bi_sep (λ _ x, x) Ps%I) : bi_scope. Notation "'[∧' 'list]' k ↦ x ∈ l , P" := - (big_opL bi_and (λ k x, P) l) : bi_scope. + (big_opL bi_and (λ k x, P%I) l) : bi_scope. Notation "'[∧' 'list]' x ∈ l , P" := - (big_opL bi_and (λ _ x, P) l) : bi_scope. -Notation "'[∧]' Ps" := (big_opL bi_and (λ _ x, x) Ps) : bi_scope. + (big_opL bi_and (λ _ x, P%I) l) : bi_scope. +Notation "'[∧]' Ps" := (big_opL bi_and (λ _ x, x) Ps%I) : bi_scope. Notation "'[∨' 'list]' k ↦ x ∈ l , P" := - (big_opL bi_or (λ k x, P) l) : bi_scope. + (big_opL bi_or (λ k x, P%I) l) : bi_scope. Notation "'[∨' 'list]' x ∈ l , P" := - (big_opL bi_or (λ _ x, P) l) : bi_scope. -Notation "'[∨]' Ps" := (big_opL bi_or (λ _ x, x) Ps) : bi_scope. + (big_opL bi_or (λ _ x, P%I) l) : bi_scope. +Notation "'[∨]' Ps" := (big_opL bi_or (λ _ x, x) Ps%I) : bi_scope. -Notation "'[∗' 'map]' k ↦ x ∈ m , P" := (big_opM bi_sep (λ k x, P) m) : bi_scope. -Notation "'[∗' 'map]' x ∈ m , P" := (big_opM bi_sep (λ _ x, P) m) : bi_scope. +Notation "'[∗' 'map]' k ↦ x ∈ m , P" := (big_opM bi_sep (λ k x, P%I) m) : bi_scope. +Notation "'[∗' 'map]' x ∈ m , P" := (big_opM bi_sep (λ _ x, P%I) m) : bi_scope. -Notation "'[∗' 'set]' x ∈ X , P" := (big_opS bi_sep (λ x, P) X) : bi_scope. +Notation "'[∗' 'set]' x ∈ X , P" := (big_opS bi_sep (λ x, P%I) X) : bi_scope. -Notation "'[∗' 'mset]' x ∈ X , P" := (big_opMS bi_sep (λ x, P) X) : bi_scope. +Notation "'[∗' 'mset]' x ∈ X , P" := (big_opMS bi_sep (λ x, P%I) X) : bi_scope. (** Definitions and notations for binary variants *) (** A version of the separating big operator that ranges over two lists. This @@ -47,9 +47,9 @@ Global Instance: Params (@big_sepL2) 3 := {}. Global Arguments big_sepL2 {PROP A B} _ !_ !_ /. Typeclasses Opaque big_sepL2. Notation "'[∗' 'list]' k ↦ x1 ; x2 ∈ l1 ; l2 , P" := - (big_sepL2 (λ k x1 x2, P) l1 l2) : bi_scope. + (big_sepL2 (λ k x1 x2, P%I) l1 l2) : bi_scope. Notation "'[∗' 'list]' x1 ; x2 ∈ l1 ; l2 , P" := - (big_sepL2 (λ _ x1 x2, P) l1 l2) : bi_scope. + (big_sepL2 (λ _ x1 x2, P%I) l1 l2) : bi_scope. Definition big_sepM2_def {PROP : bi} `{Countable K} {A B} (Φ : K → A → B → PROP) (m1 : gmap K A) (m2 : gmap K B) : PROP := @@ -61,9 +61,9 @@ Global Arguments big_sepM2 {PROP K _ _ A B} _ _ _. Definition big_sepM2_eq : @big_sepM2 = _ := big_sepM2_aux.(seal_eq). Global Instance: Params (@big_sepM2) 6 := {}. Notation "'[∗' 'map]' k ↦ x1 ; x2 ∈ m1 ; m2 , P" := - (big_sepM2 (λ k x1 x2, P) m1 m2) : bi_scope. + (big_sepM2 (λ k x1 x2, P%I) m1 m2) : bi_scope. Notation "'[∗' 'map]' x1 ; x2 ∈ m1 ; m2 , P" := - (big_sepM2 (λ _ x1 x2, P) m1 m2) : bi_scope. + (big_sepM2 (λ _ x1 x2, P%I) m1 m2) : bi_scope. (** * Properties *) Section big_op. diff --git a/iris/bi/interface.v b/iris/bi/interface.v index 5447c68eda4f7a0b43edd8fe4fc15f1f03a6074b..70fe83bd7df2e08324797cf89c2334bd9764e7ee 100644 --- a/iris/bi/interface.v +++ b/iris/bi/interface.v @@ -249,9 +249,9 @@ Infix "∗" := bi_sep : bi_scope. Notation "(∗)" := bi_sep (only parsing) : bi_scope. Notation "P -∗ Q" := (bi_wand P Q) : bi_scope. Notation "∀ x .. y , P" := - (bi_forall (λ x, .. (bi_forall (λ y, P)) ..)%I) : bi_scope. + (bi_forall (λ x, .. (bi_forall (λ y, P%I)) ..)) : bi_scope. Notation "∃ x .. y , P" := - (bi_exist (λ x, .. (bi_exist (λ y, P)) ..)%I) : bi_scope. + (bi_exist (λ x, .. (bi_exist (λ y, P%I)) ..)) : bi_scope. Notation "'<pers>' P" := (bi_persistently P) : bi_scope. Notation "â–· P" := (bi_later P) : bi_scope. diff --git a/tests/proofmode_iris.v b/tests/proofmode_iris.v index f88ea6e87be6ceb6deede51eaec6331a50a3f178..0d1c96a3a02f43e9f777bec66c71c33c9e7c9a79 100644 --- a/tests/proofmode_iris.v +++ b/tests/proofmode_iris.v @@ -15,6 +15,16 @@ Section base_logic_tests. Definition use_plainly_uPred (n : nat) : uPred M := â– |==> ∃ m : nat , ⌜ n = 2 âŒ. + (* Test scopes inside big-ops *) + Definition big_op_scope_1 (xs : list nat) : uPred M := + [∗ list] _ ↦ x ∈ xs, True. + Definition big_op_scope_2 (xs : list nat) : uPred M := + [∗ list] x; y ∈ xs; xs, True. + Definition big_op_scope_3 (m : gmap nat nat) : uPred M := + [∗ map] _ ↦ x ∈ m, True. + Definition big_op_scope_4 (m : gmap nat nat) : uPred M := + [∗ map] x; y ∈ m; m, True. + Lemma test_random_stuff (P1 P2 P3 : nat → uPred M) : ⊢ ∀ (x y : nat) a b, x ≡ y →