Skip to content
Snippets Groups Projects
Commit 7d15511a authored by Robbert Krebbers's avatar Robbert Krebbers
Browse files

Bump Iris.

parent 4e438d85
No related branches found
No related tags found
No related merge requests found
Pipeline #71002 passed
...@@ -6,7 +6,7 @@ bug-reports: "https://gitlab.mpi-sws.org/dfrumin/reloc/issues" ...@@ -6,7 +6,7 @@ bug-reports: "https://gitlab.mpi-sws.org/dfrumin/reloc/issues"
dev-repo: "git+https://gitlab.mpi-sws.org/dfrumin/reloc.git" dev-repo: "git+https://gitlab.mpi-sws.org/dfrumin/reloc.git"
depends: [ depends: [
"coq-iris-heap-lang" { (= "dev.2022-08-03.0.949ab7bc") | (= "dev") } "coq-iris-heap-lang" { (= "dev.2022-08-12.4.9245c4c0") | (= "dev") }
"coq-autosubst" { = "dev" } "coq-autosubst" { = "dev" }
] ]
......
...@@ -29,11 +29,11 @@ Ltac Zify.zify_post_hook ::= Z.to_euclidean_division_equations. ...@@ -29,11 +29,11 @@ Ltac Zify.zify_post_hook ::= Z.to_euclidean_division_equations.
Require Import Arith ZArith ZifyClasses ZifyInst Lia. Require Import Arith ZArith ZifyClasses ZifyInst Lia.
Global Program Instance Op_Nat_mod : BinOp Nat.modulo := Global Program Instance Op_Nat_mod : BinOp Nat.modulo :=
{| TBOp := Z.modulo ; TBOpInj := Nat2Z_inj_mod |}. {| TBOp := Z.modulo ; TBOpInj := Nat2Z.inj_mod |}.
Add Zify BinOp Op_Nat_mod. Add Zify BinOp Op_Nat_mod.
Global Program Instance Op_Nat_div : BinOp Nat.div := Global Program Instance Op_Nat_div : BinOp Nat.div :=
{| TBOp := Z.div ; TBOpInj := Nat2Z_inj_div |}. {| TBOp := Z.div ; TBOpInj := Nat2Z.inj_div |}.
Add Zify BinOp Op_Nat_div. Add Zify BinOp Op_Nat_div.
(* lia now works with Nat.modulo nad Nat.div. *) (* lia now works with Nat.modulo nad Nat.div. *)
...@@ -737,12 +737,12 @@ Section queue_refinement. ...@@ -737,12 +737,12 @@ Section queue_refinement.
rel_bind_l (! _)%E. rel_bind_l (! _)%E.
rel_apply_l refines_wp_l. rel_apply_l refines_wp_l.
assert ((Z.of_nat pushTicket `rem` Z.of_nat q)%Z = Z.of_nat (pushTicket `mod` q)) as ->. assert ((Z.of_nat pushTicket `rem` Z.of_nat q)%Z = Z.of_nat (pushTicket `mod` q)) as ->.
{ rewrite Nat2Z_inj_mod. apply Z.rem_mod_nonneg; lia. } { rewrite Nat2Z.inj_mod. apply Z.rem_mod_nonneg; lia. }
wp_apply (wp_load_offset with "arrPts"). wp_apply (wp_load_offset with "arrPts").
{ rewrite list_lookup_fmap. rewrite Hattss. reflexivity. } { rewrite list_lookup_fmap. rewrite Hattss. reflexivity. }
iIntros "arrPts". iIntros "arrPts".
rewrite Z.quot_div_nonneg; [|lia|lia]. rewrite Z.quot_div_nonneg; [|lia|lia].
rewrite -Nat2Z_inj_div. rewrite -Nat2Z.inj_div.
rel_apply_l refines_wp_l. rel_apply_l refines_wp_l.
wp_apply (enqueueWithTicket_spec' _ (R _ q (pushTicket `mod` q)) with "[-]"). wp_apply (enqueueWithTicket_spec' _ (R _ q (pushTicket `mod` q)) with "[-]").
2: { iIntros. rel_values. } 2: { iIntros. rel_values. }
...@@ -790,12 +790,12 @@ Section queue_refinement. ...@@ -790,12 +790,12 @@ Section queue_refinement.
rel_bind_l (! _)%E. rel_bind_l (! _)%E.
rel_apply_l refines_wp_l. rel_apply_l refines_wp_l.
assert ((Z.of_nat pushTicket `rem` Z.of_nat q)%Z = Z.of_nat (pushTicket `mod` q)) as ->. assert ((Z.of_nat pushTicket `rem` Z.of_nat q)%Z = Z.of_nat (pushTicket `mod` q)) as ->.
{ rewrite Nat2Z_inj_mod. apply Z.rem_mod_nonneg; lia. } { rewrite Nat2Z.inj_mod. apply Z.rem_mod_nonneg; lia. }
wp_apply (wp_load_offset with "arrPts"). wp_apply (wp_load_offset with "arrPts").
{ rewrite list_lookup_fmap. rewrite Hattss. reflexivity. } { rewrite list_lookup_fmap. rewrite Hattss. reflexivity. }
iIntros "arrPts". iIntros "arrPts".
rewrite Z.quot_div_nonneg; [|lia|lia]. rewrite Z.quot_div_nonneg; [|lia|lia].
rewrite -Nat2Z_inj_div. rewrite -Nat2Z.inj_div.
rel_apply_l refines_wp_l. rel_apply_l refines_wp_l.
wp_apply (enqueueWithTicket_spec' _ (R _ q (pushTicket `mod` q)) with "[-]"). wp_apply (enqueueWithTicket_spec' _ (R _ q (pushTicket `mod` q)) with "[-]").
2: { iIntros. rel_values. } 2: { iIntros. rel_values. }
...@@ -866,14 +866,14 @@ Section queue_refinement. ...@@ -866,14 +866,14 @@ Section queue_refinement.
rel_pures_l. rel_pures_l.
assert ((Z.of_nat popTicket `rem` Z.of_nat q)%Z = Z.of_nat (popTicket `mod` q)) as ->. assert ((Z.of_nat popTicket `rem` Z.of_nat q)%Z = Z.of_nat (popTicket `mod` q)) as ->.
{ rewrite Nat2Z_inj_mod. apply Z.rem_mod_nonneg; lia. } { rewrite Nat2Z.inj_mod. apply Z.rem_mod_nonneg; lia. }
rel_apply_l refines_wp_l. rel_apply_l refines_wp_l.
wp_apply (wp_load_offset with "arrPts"). wp_apply (wp_load_offset with "arrPts").
{ rewrite list_lookup_fmap. rewrite Hattss. reflexivity. } { rewrite list_lookup_fmap. rewrite Hattss. reflexivity. }
iIntros "arrPts". iIntros "arrPts".
rewrite Z.quot_div_nonneg; [|lia|lia]. rewrite Z.quot_div_nonneg; [|lia|lia].
rewrite -Nat2Z_inj_div. rewrite -Nat2Z.inj_div.
iApply wp_fupd. iApply wp_fupd.
simpl. simpl.
wp_apply (dequeueWithTicket_spec2 _ (R _ q (popTicket `mod` q)) with "[-Htok]"). wp_apply (dequeueWithTicket_spec2 _ (R _ q (popTicket `mod` q)) with "[-Htok]").
...@@ -953,13 +953,13 @@ Section queue_refinement. ...@@ -953,13 +953,13 @@ Section queue_refinement.
rel_bind_l (! _)%E. rel_bind_l (! _)%E.
rel_apply_l refines_wp_l. rel_apply_l refines_wp_l.
assert ((Z.of_nat popTicket `rem` Z.of_nat q)%Z = Z.of_nat (popTicket `mod` q)) as ->. assert ((Z.of_nat popTicket `rem` Z.of_nat q)%Z = Z.of_nat (popTicket `mod` q)) as ->.
{ rewrite Nat2Z_inj_mod. apply Z.rem_mod_nonneg; lia. } { rewrite Nat2Z.inj_mod. apply Z.rem_mod_nonneg; lia. }
wp_apply (wp_load_offset with "arrPts"). wp_apply (wp_load_offset with "arrPts").
{ rewrite list_lookup_fmap. rewrite Hattss. reflexivity. } { rewrite list_lookup_fmap. rewrite Hattss. reflexivity. }
iIntros "arrPts". iIntros "arrPts".
rewrite Z.quot_div_nonneg; [|lia|lia]. rewrite Z.quot_div_nonneg; [|lia|lia].
rewrite -Nat2Z_inj_div. rewrite -Nat2Z.inj_div.
rel_apply_l refines_wp_l. rel_apply_l refines_wp_l.
wp_apply (dequeueWithTicket_spec' _ (R _ q (popTicket `mod` q)) with "[-]"). wp_apply (dequeueWithTicket_spec' _ (R _ q (popTicket `mod` q)) with "[-]").
{ iFrame "#∗". } { iFrame "#∗". }
......
...@@ -122,7 +122,7 @@ Section spec. ...@@ -122,7 +122,7 @@ Section spec.
iDestruct "Hc'" as (ℓ1' ?) "Hc'". iDestruct "Hc'" as (ℓ1' ?) "Hc'".
simplify_eq/=. simplify_eq/=.
iCombine "ℓPts Hc'" as "ℓPts". iCombine "ℓPts Hc'" as "ℓPts".
iDestruct (mapsto_valid_2 with "ℓPts Hc") as %[?%Qp_not_add_le_l _]. iDestruct (mapsto_valid_2 with "ℓPts Hc") as %[?%Qp.not_add_le_l _].
done. } done. }
wp_load. wp_load.
iDestruct (mapsto_agree with "ℓPts Hc") as %[= Heq]. iDestruct (mapsto_agree with "ℓPts Hc") as %[= Heq].
...@@ -136,11 +136,11 @@ Section spec. ...@@ -136,11 +136,11 @@ Section spec.
iDestruct "Hc'" as (ℓ1' ?) "Hc'". iDestruct "Hc'" as (ℓ1' ?) "Hc'".
simplify_eq/=. simplify_eq/=.
iCombine "ℓPts Hc'" as "ℓPts". iCombine "ℓPts Hc'" as "ℓPts".
iDestruct (mapsto_valid_2 with "ℓPts Hc") as %[?%Qp_not_add_le_l _]. iDestruct (mapsto_valid_2 with "ℓPts Hc") as %[?%Qp.not_add_le_l _].
done. } done. }
iDestruct (mapsto_combine with "ℓPts Hc") as "[ℓPts %Heq]". iDestruct (mapsto_combine with "ℓPts Hc") as "[ℓPts %Heq]".
simplify_eq/=. simplify_eq/=.
rewrite dfrac_op_own Qp_half_half. rewrite dfrac_op_own Qp.half_half.
wp_store. wp_store.
assert ((n + 1)%Z = (n + 1)%nat) as ->. { lia. } assert ((n + 1)%Z = (n + 1)%nat) as ->. { lia. }
iDestruct "ℓPts" as "[ℓPts ℓPts']". iDestruct "ℓPts" as "[ℓPts ℓPts']".
......
...@@ -141,7 +141,7 @@ Section offer_theory. ...@@ -141,7 +141,7 @@ Section offer_theory.
iIntros "O P". iIntros "O P".
iDestruct (offer_agree with "O P") as %<-. iDestruct (offer_agree with "O P") as %<-.
iMod (own_update_2 _ _ _ (Cinl (Excl ())) with "O P") as "O". iMod (own_update_2 _ _ _ (Cinl (Excl ())) with "O P") as "O".
{ rewrite -Cinr_op -pair_op frac_op Qp_half_half. { rewrite -Cinr_op -pair_op frac_op Qp.half_half.
apply cmra_update_exclusive. done. } apply cmra_update_exclusive. done. }
iModIntro. iFrame. done. iModIntro. iFrame. done.
Qed. Qed.
...@@ -150,7 +150,7 @@ Section offer_theory. ...@@ -150,7 +150,7 @@ Section offer_theory.
Proof. Proof.
iIntros "O". iIntros "O".
iMod (no_offer_to_offer with "O") as "O". iMod (no_offer_to_offer with "O") as "O".
rewrite -{1}Qp_three_quarter_quarter. rewrite -{1}Qp.three_quarter_quarter.
iDestruct (offer_split with "O") as "[Hhalf Hhalf']". iDestruct (offer_split with "O") as "[Hhalf Hhalf']".
iModIntro. iFrame. iModIntro. iFrame.
Qed. Qed.
...@@ -163,7 +163,7 @@ Section proofs. ...@@ -163,7 +163,7 @@ Section proofs.
Definition offer_token γ q := own γ (q : frac). Definition offer_token γ q := own γ (q : frac).
Lemma offer_token_split γ : own γ 1%Qp ⊣⊢ own γ (1/2)%Qp own γ (1/2)%Qp. Lemma offer_token_split γ : own γ 1%Qp ⊣⊢ own γ (1/2)%Qp own γ (1/2)%Qp.
Proof. rewrite -{1}Qp_half_half. rewrite -own_op. done. Qed. Proof. rewrite -{1}Qp.half_half. rewrite -own_op. done. Qed.
(* The specification thread `k` is about to run a flip. *) (* The specification thread `k` is about to run a flip. *)
Definition tp_flip k bf lk := (refines_right k (blueFlip #bf lk))%I. Definition tp_flip k bf lk := (refines_right k (blueFlip #bf lk))%I.
...@@ -369,7 +369,7 @@ Section proofs. ...@@ -369,7 +369,7 @@ Section proofs.
iDestruct "Hdisj" as "[(_ & Htok & Hoff) | Hdisj]". iDestruct "Hdisj" as "[(_ & Htok & Hoff) | Hdisj]".
2: { iDestruct "Hdisj" as (?) "[[% _]|[% _]]"; by subst. } 2: { iDestruct "Hdisj" as (?) "[[% _]|[% _]]"; by subst. }
iMod (no_offer_to_offer _ k with "Hoff") as "Hoff". iMod (no_offer_to_offer _ k with "Hoff") as "Hoff".
iEval (rewrite -Qp_half_half) in "Hoff". iEval (rewrite -Qp.half_half) in "Hoff".
iDestruct (offer_split with "Hoff") as "[Hoff Hoff']". iDestruct (offer_split with "Hoff") as "[Hoff Hoff']".
iMod ("Hclose" with "[-IH Hoff Htok]") as "_". iMod ("Hclose" with "[-IH Hoff Htok]") as "_".
{ iNext. iExists _. iFrame. iExists 1. iFrame. iRight. iExists k. iLeft. by iFrame. } { iNext. iExists _. iFrame. iExists 1. iFrame. iRight. iExists k. iLeft. by iFrame. }
...@@ -385,7 +385,7 @@ Section proofs. ...@@ -385,7 +385,7 @@ Section proofs.
iDestruct "Hdisj" as "[[% _] | Hdisj]"; first by subst. iDestruct "Hdisj" as "[[% _] | Hdisj]"; first by subst.
iDestruct "Hdisj" as (?) "[(% & Hoff' & Hj) | [% _]]"; last by subst. iDestruct "Hdisj" as (?) "[(% & Hoff' & Hj) | [% _]]"; last by subst.
iDestruct (offer_combine with "Hoff Hoff'") as "(<- & Hoff)". iDestruct (offer_combine with "Hoff Hoff'") as "(<- & Hoff)".
rewrite Qp_half_half. rewrite Qp.half_half.
iMod (offer_to_no_offer with "Hoff") as "Hoff". iMod (offer_to_no_offer with "Hoff") as "Hoff".
iMod ("Hclose" with "[-IH Hj]") as "_". iMod ("Hclose" with "[-IH Hj]") as "_".
{ iNext. iExists _. iFrame. iExists 0. iFrame. iLeft. by iFrame. } { iNext. iExists _. iFrame. iExists 0. iFrame. iLeft. by iFrame. }
...@@ -400,7 +400,7 @@ Section proofs. ...@@ -400,7 +400,7 @@ Section proofs.
iDestruct "Hdisj" as "[[Hoff' Hj] | Hoff']". iDestruct "Hdisj" as "[[Hoff' Hj] | Hoff']".
2: { 2: {
iDestruct (own_valid_2 with "Htok Hoff'") as %Hv. iDestruct (own_valid_2 with "Htok Hoff'") as %Hv.
by apply Qp_not_add_le_l in Hv. } by apply Qp.not_add_le_l in Hv. }
iDestruct (offer_combine with "Hoff Hoff'") as "(<- & Hoff)". iDestruct (offer_combine with "Hoff Hoff'") as "(<- & Hoff)".
iDestruct (offer_token_split with "Htok") as "[Htok Htok']". iDestruct (offer_token_split with "Htok") as "[Htok Htok']".
iMod ("Hclose" with "[-IH Hj Hoff Htok]") as "_". iMod ("Hclose" with "[-IH Hj Hoff Htok]") as "_".
...@@ -418,16 +418,16 @@ Section proofs. ...@@ -418,16 +418,16 @@ Section proofs.
{ iDestruct (no_offer_exclusive with "Hoff' Hoff") as %?. done. } { iDestruct (no_offer_exclusive with "Hoff' Hoff") as %?. done. }
iDestruct "Hdisj" as (?) "[(_ & Hoff' & _) | (% & Hdisj)]". iDestruct "Hdisj" as (?) "[(_ & Hoff' & _) | (% & Hdisj)]".
{ iDestruct (offer_combine with "Hoff Hoff'") as "(<- & Hoff)". { iDestruct (offer_combine with "Hoff Hoff'") as "(<- & Hoff)".
rewrite Qp_half_half. rewrite Qp.half_half.
iDestruct (own_offer_valid with "Hoff") as %Hle. iDestruct (own_offer_valid with "Hoff") as %Hle.
by apply Qp_not_add_le_l in Hle. } by apply Qp.not_add_le_l in Hle. }
iDestruct "Hdisj" as "[[Hoff' _] | Htok']". iDestruct "Hdisj" as "[[Hoff' _] | Htok']".
{ iDestruct (offer_combine with "Hoff Hoff'") as "(<- & Hoff)". { iDestruct (offer_combine with "Hoff Hoff'") as "(<- & Hoff)".
rewrite Qp_half_half. rewrite Qp.half_half.
iDestruct (own_offer_valid with "Hoff") as %Hle. iDestruct (own_offer_valid with "Hoff") as %Hle.
by apply Qp_not_add_le_l in Hle. } by apply Qp.not_add_le_l in Hle. }
iCombine "Htok Htok'" as "Htok". iCombine "Htok Htok'" as "Htok".
iEval (rewrite Qp_half_half) in "Hoff". iEval (rewrite Qp.half_half) in "Hoff".
iMod (offer_to_no_offer with "Hoff") as "Hoff". iMod (offer_to_no_offer with "Hoff") as "Hoff".
iMod ("Hclose" with "[-IH Hj]") as "_". iMod ("Hclose" with "[-IH Hj]") as "_".
{ iNext. iExists _. iFrame. iExists 0. iFrame. iLeft. iFrame. done. } { iNext. iExists _. iFrame. iExists 0. iFrame. iLeft. iFrame. done. }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment