diff --git a/opam b/opam index 1a3c4b01a3845faf9d7f24f1627dcf524cf74059..e8c09aef1b4905336031a6b6233bd565936ba500 100644 --- a/opam +++ b/opam @@ -11,5 +11,5 @@ install: [make "install"] remove: ["rm" "-rf" "%{lib}%/coq/user-contrib/iris"] depends: [ "coq" { (>= "8.7.1" & < "8.9~") | (= "dev") } - "coq-stdpp" { (= "dev.2018-05-23.0.a8f65af5") | (= "dev") } + "coq-stdpp" { (= "dev.2018-05-24.0.de797b31") | (= "dev") } ] diff --git a/theories/program_logic/ectx_lifting.v b/theories/program_logic/ectx_lifting.v index 1105a2e11104e202ca16c4760167de1627328f83..e0ec8c01d5c1037e3f07498161beb5a7c7f8cb61 100644 --- a/theories/program_logic/ectx_lifting.v +++ b/theories/program_logic/ectx_lifting.v @@ -68,7 +68,7 @@ Lemma wp_lift_atomic_head_step {s E Φ} e1 : ⌜head_reducible e1 σ1⌠∗ ▷ ∀ e2 σ2 efs, ⌜head_step e1 σ1 e2 σ2 efs⌠={E}=∗ state_interp σ2 ∗ - default False (to_val e2) Φ ∗ [∗ list] ef ∈ efs, WP ef @ s; ⊤ {{ _, True }}) + from_option Φ False (to_val e2) ∗ [∗ list] ef ∈ efs, WP ef @ s; ⊤ {{ _, True }}) ⊢ WP e1 @ s; E {{ Φ }}. Proof. iIntros (?) "H". iApply wp_lift_atomic_step; eauto. @@ -82,7 +82,7 @@ Lemma wp_lift_atomic_head_step_no_fork {s E Φ} e1 : (∀ σ1, state_interp σ1 ={E}=∗ ⌜head_reducible e1 σ1⌠∗ ▷ ∀ e2 σ2 efs, ⌜head_step e1 σ1 e2 σ2 efs⌠={E}=∗ - ⌜efs = []⌠∗ state_interp σ2 ∗ default False (to_val e2) Φ) + ⌜efs = []⌠∗ state_interp σ2 ∗ from_option Φ False (to_val e2)) ⊢ WP e1 @ s; E {{ Φ }}. Proof. iIntros (?) "H". iApply wp_lift_atomic_head_step; eauto. diff --git a/theories/program_logic/lifting.v b/theories/program_logic/lifting.v index b014954d09bc41a3792f848e13262537f58ca76c..8ddf09130437c36c936d6973154e5fa9b2131604 100644 --- a/theories/program_logic/lifting.v +++ b/theories/program_logic/lifting.v @@ -71,7 +71,7 @@ Lemma wp_lift_atomic_step {s E Φ} e1 : ⌜if s is NotStuck then reducible e1 σ1 else True⌠∗ ▷ ∀ e2 σ2 efs, ⌜prim_step e1 σ1 e2 σ2 efs⌠={E}=∗ state_interp σ2 ∗ - default False (to_val e2) Φ ∗ [∗ list] ef ∈ efs, WP ef @ s; ⊤ {{ _, True }}) + from_option Φ False (to_val e2) ∗ [∗ list] ef ∈ efs, WP ef @ s; ⊤ {{ _, True }}) ⊢ WP e1 @ s; E {{ Φ }}. Proof. iIntros (?) "H". iApply (wp_lift_step s E _ e1)=>//; iIntros (σ1) "Hσ1". diff --git a/theories/program_logic/ownp.v b/theories/program_logic/ownp.v index 538e822924dfa974bfd4de2cf2216499d02b27b9..f31ade3336b8ca858acee445b15e122bb506ec14 100644 --- a/theories/program_logic/ownp.v +++ b/theories/program_logic/ownp.v @@ -138,7 +138,7 @@ Section lifting. Lemma ownP_lift_atomic_step {s E Φ} e1 σ1 : (if s is NotStuck then reducible e1 σ1 else to_val e1 = None) → (▷ ownP σ1 ∗ ▷ ∀ e2 σ2 efs, ⌜prim_step e1 σ1 e2 σ2 efs⌠-∗ ownP σ2 -∗ - default False (to_val e2) Φ ∗ [∗ list] ef ∈ efs, WP ef @ s; ⊤ {{ _, True }}) + from_option Φ False (to_val e2) ∗ [∗ list] ef ∈ efs, WP ef @ s; ⊤ {{ _, True }}) ⊢ WP e1 @ s; E {{ Φ }}. Proof. iIntros (?) "[Hσ H]"; iApply ownP_lift_step. @@ -240,7 +240,7 @@ Section ectx_lifting. head_reducible e1 σ1 → ▷ ownP σ1 ∗ ▷ (∀ e2 σ2 efs, ⌜head_step e1 σ1 e2 σ2 efs⌠-∗ ownP σ2 -∗ - default False (to_val e2) Φ ∗ [∗ list] ef ∈ efs, WP ef @ s; ⊤ {{ _, True }}) + from_option Φ False (to_val e2) ∗ [∗ list] ef ∈ efs, WP ef @ s; ⊤ {{ _, True }}) ⊢ WP e1 @ s; E {{ Φ }}. Proof. iIntros (?) "[? H]". iApply ownP_lift_atomic_step; eauto. diff --git a/theories/program_logic/total_ectx_lifting.v b/theories/program_logic/total_ectx_lifting.v index a78740646b2970d56b138c81114236f3251a4c26..e5d1af45e6fc89383ef3199de3dda66078d0532e 100644 --- a/theories/program_logic/total_ectx_lifting.v +++ b/theories/program_logic/total_ectx_lifting.v @@ -43,7 +43,7 @@ Lemma twp_lift_atomic_head_step {s E Φ} e1 : ⌜head_reducible e1 σ1⌠∗ ∀ e2 σ2 efs, ⌜head_step e1 σ1 e2 σ2 efs⌠={E}=∗ state_interp σ2 ∗ - default False (to_val e2) Φ ∗ [∗ list] ef ∈ efs, WP ef @ s; ⊤ [{ _, True }]) + from_option Φ False (to_val e2) ∗ [∗ list] ef ∈ efs, WP ef @ s; ⊤ [{ _, True }]) ⊢ WP e1 @ s; E [{ Φ }]. Proof. iIntros (?) "H". iApply twp_lift_atomic_step; eauto. @@ -56,7 +56,7 @@ Lemma twp_lift_atomic_head_step_no_fork {s E Φ} e1 : (∀ σ1, state_interp σ1 ={E}=∗ ⌜head_reducible e1 σ1⌠∗ ∀ e2 σ2 efs, ⌜head_step e1 σ1 e2 σ2 efs⌠={E}=∗ - ⌜efs = []⌠∗ state_interp σ2 ∗ default False (to_val e2) Φ) + ⌜efs = []⌠∗ state_interp σ2 ∗ from_option Φ False (to_val e2)) ⊢ WP e1 @ s; E [{ Φ }]. Proof. iIntros (?) "H". iApply twp_lift_atomic_head_step; eauto. diff --git a/theories/program_logic/total_lifting.v b/theories/program_logic/total_lifting.v index 7b7b1b2528a1c65704ac7274bc6baf91dbf5064a..b9c62e0714dd6c9e4afcb544c676b8ced2c6c33d 100644 --- a/theories/program_logic/total_lifting.v +++ b/theories/program_logic/total_lifting.v @@ -45,7 +45,7 @@ Lemma twp_lift_atomic_step {s E Φ} e1 : ⌜if s is NotStuck then reducible e1 σ1 else True⌠∗ ∀ e2 σ2 efs, ⌜prim_step e1 σ1 e2 σ2 efs⌠={E}=∗ state_interp σ2 ∗ - default False (to_val e2) Φ ∗ [∗ list] ef ∈ efs, WP ef @ s; ⊤ [{ _, True }]) + from_option Φ False (to_val e2) ∗ [∗ list] ef ∈ efs, WP ef @ s; ⊤ [{ _, True }]) ⊢ WP e1 @ s; E [{ Φ }]. Proof. iIntros (?) "H". iApply (twp_lift_step _ E _ e1)=>//; iIntros (σ1) "Hσ1". diff --git a/theories/proofmode/classes.v b/theories/proofmode/classes.v index 4878055e57ed2f2c2e2cda6543645c376f94669f..e990414e669bf3308c402b863f6c74bc3e3504b0 100644 --- a/theories/proofmode/classes.v +++ b/theories/proofmode/classes.v @@ -526,7 +526,7 @@ Hint Mode IntoInv + ! - : typeclass_instances. instances to recognize the [emp] case and make it look nicer. *) Definition accessor {PROP : bi} {X : Type} (M1 M2 : PROP → PROP) (α β : X → PROP) (mγ : X → option PROP) : PROP := - M1 (∃ x, α x ∗ (β x -∗ M2 (default emp (mγ x) id)))%I. + M1 (∃ x, α x ∗ (β x -∗ M2 (from_option id emp (mγ x))))%I. (* Typeclass for assertions around which accessors can be elliminated. Inputs: [Q], [E1], [E2], [α], [β], [γ] @@ -582,7 +582,7 @@ Hint Mode IntoAcc + - ! - - - - - - - : typeclass_instances. Class ElimInv {PROP : bi} {X : Type} (φ : Prop) (Pinv Pin : PROP) (Pout : X → PROP) (mPclose : option (X → PROP)) (Q : PROP) (Q' : X → PROP) := - elim_inv : φ → Pinv ∗ Pin ∗ (∀ x, Pout x ∗ (default (λ _, emp) mPclose id) x -∗ Q' x) ⊢ Q. + elim_inv : φ → Pinv ∗ Pin ∗ (∀ x, Pout x ∗ (from_option id (λ _, emp) mPclose) x -∗ Q' x) ⊢ Q. Arguments ElimInv {_} {_} _ _%I _%I _%I _%I _%I _%I : simpl never. Arguments elim_inv {_} {_} _ _%I _%I _%I _%I _%I _%I {_}. Hint Mode ElimInv + - - ! - - ! ! - : typeclass_instances. diff --git a/theories/proofmode/coq_tactics.v b/theories/proofmode/coq_tactics.v index 65b3d2961ddd4d0c786ead804caf46090064ca71..8ea775935d74fb9532ca29d930836ea6d456308d 100644 --- a/theories/proofmode/coq_tactics.v +++ b/theories/proofmode/coq_tactics.v @@ -445,7 +445,7 @@ Proof. Qed. Lemma maybe_wand_sound (mP : option PROP) Q : - maybe_wand mP Q ⊣⊢ (default emp mP id -∗ Q). + maybe_wand mP Q ⊣⊢ (from_option id emp mP -∗ Q). Proof. destruct mP; simpl; first done. rewrite emp_wand //. Qed. Global Instance envs_Forall2_refl (R : relation PROP) :