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

Tweaking.

parent 7ca6ecc9
No related branches found
No related tags found
No related merge requests found
...@@ -199,6 +199,26 @@ Infix "<++>" := iProto_app (at level 60) : proto_scope. ...@@ -199,6 +199,26 @@ Infix "<++>" := iProto_app (at level 60) : proto_scope.
Definition proto_eq_next {Σ} (p : iProto Σ) : laterO (iProto Σ) -n> iPropO Σ := Definition proto_eq_next {Σ} (p : iProto Σ) : laterO (iProto Σ) -n> iPropO Σ :=
OfeMor (sbi_internal_eq (Next p)). OfeMor (sbi_internal_eq (Next p)).
(*
The definition [iProto_le] generalizes the following inductive definition
for subtyping on session types:
p1 <: p2 p1 <: p2
---------- ---------------- ----------------
end <: end !A.p1 <: !A.p2 ?A.p1 <: ?A.p2
p1 <: !B.p3 ?A.p3 <: p2
----------------------------
?A.p1 <: !B.p2
Example:
!R <: !R ?Q <: ?Q ?Q <: ?Q
------------------- --------------
?Q.!R <: !R.?Q ?P.?Q <: ?P.?Q
------------------------------------
?P.?Q.!R <: !R.?P.?Q
*)
Definition iProto_le_pre {Σ} Definition iProto_le_pre {Σ}
(rec : iProto Σ iProto Σ iProp Σ) (p1 p2 : iProto Σ) : iProp Σ := (rec : iProto Σ iProto Σ iProp Σ) (p1 p2 : iProto Σ) : iProp Σ :=
(p1 proto_end p2 proto_end) (p1 proto_end p2 proto_end)
...@@ -760,12 +780,12 @@ Section proto. ...@@ -760,12 +780,12 @@ Section proto.
rewrite !proto_interp_unfold. iIntros "[H|[H|H]]". rewrite !proto_interp_unfold. iIntros "[H|[H|H]]".
- iClear "IH". iDestruct "H" as (p -> ->) "[Hp Hp'] /=". - iClear "IH". iDestruct "H" as (p -> ->) "[Hp Hp'] /=".
iLeft. iExists (iProto_dual p). rewrite involutive. iFrame; auto. iLeft. iExists (iProto_dual p). rewrite involutive. iFrame; auto.
- iDestruct "H" as (vl vsl' pc' pr' ->) "(Hpr & Hpc' & Hinterp)". - iDestruct "H" as (vl vsl' pc' pr' ->) "(Hpr & Hpc' & H)".
iRight; iRight. iExists vl, vsl', pc', pr'. iSplit; [done|]; iFrame. iRight; iRight. iExists vl, vsl', pc', pr'. iSplit; [done|]; iFrame.
iApply ("IH" with "[%] [//] Hinterp"); simpl; lia. iApply ("IH" with "[%] [//] H"); simpl; lia.
- iDestruct "H" as (vr vsr' pc' pl' ->) "(Hpl & Hpc' & Hinterp)". - iDestruct "H" as (vr vsr' pc' pl' ->) "(Hpl & Hpc' & H)".
iRight; iLeft. iExists vr, vsr', pc', pl'. iSplit; [done|]; iFrame. iRight; iLeft. iExists vr, vsr', pc', pl'. iSplit; [done|]; iFrame.
iApply ("IH" with "[%] [//] Hinterp"); simpl; lia. iApply ("IH" with "[%] [//] H"); simpl; lia.
Qed. Qed.
Lemma proto_interp_le_l vsl vsr pl pl' pr : Lemma proto_interp_le_l vsl vsr pl pl' pr :
...@@ -777,18 +797,18 @@ Section proto. ...@@ -777,18 +797,18 @@ Section proto.
- iClear "IH". iDestruct "H" as (p -> ->) "[Hp Hp'] /=". - iClear "IH". iDestruct "H" as (p -> ->) "[Hp Hp'] /=".
iLeft. iExists p. do 2 (iSplit; [done|]). iFrame "Hp'". iLeft. iExists p. do 2 (iSplit; [done|]). iFrame "Hp'".
by iApply (iProto_le_trans with "Hp"). by iApply (iProto_le_trans with "Hp").
- iDestruct "H" as (vl vsl' pc' pr' ->) "(Hpr & Hpc' & Hinterp)". - iDestruct "H" as (vl vsl' pc' pr' ->) "(Hpr & Hpc' & H)".
iRight; iLeft. iExists vl, vsl', pc', pr'. iSplit; [done|]; iFrame. iRight; iLeft. iExists vl, vsl', pc', pr'. iSplit; [done|]; iFrame.
iApply ("IH" with "[%] [//] Hinterp Hle"); simpl; lia. iApply ("IH" with "[%] [//] H Hle"); simpl; lia.
- iClear "IH". iDestruct "H" as (vr vsr' pc' pl'' ->) "(Hpl & Hpc' & Hinterp)". - iClear "IH". iDestruct "H" as (vr vsr' pc' pl'' ->) "(Hpl & Hpc' & H)".
iRight; iRight. iExists vr, vsr', pc', pl''. iSplit; [done|]; iFrame. iRight; iRight. iExists vr, vsr', pc', pl''. iSplit; [done|]; iFrame.
by iApply (iProto_le_trans with "Hpl"). by iApply (iProto_le_trans with "Hpl").
Qed. Qed.
Lemma proto_interp_le_r vsl vsr pl pr pr' : Lemma proto_interp_le_r vsl vsr pl pr pr' :
proto_interp vsl vsr pl pr -∗ iProto_le pr pr' -∗ proto_interp vsl vsr pl pr'. proto_interp vsl vsr pl pr -∗ iProto_le pr pr' -∗ proto_interp vsl vsr pl pr'.
Proof. Proof.
iIntros "Hinterp Hle". iApply proto_interp_flip. iIntros "H Hle". iApply proto_interp_flip.
iApply (proto_interp_le_l with "[Hinterp] Hle"). by iApply proto_interp_flip. iApply (proto_interp_le_l with "[H] Hle"). by iApply proto_interp_flip.
Qed. Qed.
(* (*
......
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