Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
Actris
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Iris
Actris
Commits
91af156d
Commit
91af156d
authored
4 years ago
by
Daniël Louwrink
Committed by
Jonas Kastberg
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
add some derived copyability rules
parent
860d808b
No related branches found
No related tags found
1 merge request
!14
Derived rules about copying
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
theories/logrel/subtyping_rules.v
+41
-4
41 additions, 4 deletions
theories/logrel/subtyping_rules.v
with
41 additions
and
4 deletions
theories/logrel/subtyping_rules.v
+
41
−
4
View file @
91af156d
...
@@ -61,7 +61,7 @@ Section subtyping_rules.
...
@@ -61,7 +61,7 @@ Section subtyping_rules.
Lemma
lty_copyable_copy
A
:
⊢@
{
iPropI
Σ
}
lty_copyable
(
copy
A
)
.
Lemma
lty_copyable_copy
A
:
⊢@
{
iPropI
Σ
}
lty_copyable
(
copy
A
)
.
Proof
.
iIntros
(
v
)
"!> #Hv !>"
.
iFrame
"Hv"
.
Qed
.
Proof
.
iIntros
(
v
)
"!> #Hv !>"
.
iFrame
"Hv"
.
Qed
.
Lemma
lty_le_copy_inv
A
B
:
A
<:
B
-∗
copy
-
A
<:
copy
-
B
.
Lemma
lty_le_copy_inv
_mono
A
B
:
A
<:
B
-∗
copy
-
A
<:
copy
-
B
.
Proof
.
Proof
.
iIntros
"#Hle !>"
(
v
)
"#HA"
.
iApply
(
coreP_wand
(
ltty_car
A
v
)
with
"[] HA"
)
.
iIntros
"#Hle !>"
(
v
)
"#HA"
.
iApply
(
coreP_wand
(
ltty_car
A
v
)
with
"[] HA"
)
.
iIntros
"{HA} !> !>"
.
iApply
"Hle"
.
iIntros
"{HA} !> !>"
.
iApply
"Hle"
.
...
@@ -72,6 +72,13 @@ Section subtyping_rules.
...
@@ -72,6 +72,13 @@ Section subtyping_rules.
Proof
.
iIntros
(
v
)
"!> #H"
.
iApply
(
coreP_elim
with
"H"
)
.
Qed
.
Proof
.
iIntros
(
v
)
"!> #H"
.
iApply
(
coreP_elim
with
"H"
)
.
Qed
.
Lemma
lty_copyable_copy_inv
A
:
⊢
lty_copyable
(
copy
-
A
)
.
Lemma
lty_copyable_copy_inv
A
:
⊢
lty_copyable
(
copy
-
A
)
.
Proof
.
iIntros
(
v
)
"!> #Hv !>"
.
iFrame
"Hv"
.
Qed
.
Proof
.
iIntros
(
v
)
"!> #Hv !>"
.
iFrame
"Hv"
.
Qed
.
Lemma
lty_le_copy_inv_elim_copyable
A
:
lty_copyable
A
-∗
copy
-
A
<:
A
.
Proof
.
iIntros
"#Hcp"
.
iApply
lty_le_trans
.
-
iApply
lty_le_copy_inv_mono
.
iApply
"Hcp"
.
-
iApply
lty_le_copy_inv_elim
.
Qed
.
Lemma
lty_copyable_unit
:
⊢@
{
iPropI
Σ
}
lty_copyable
()
.
Lemma
lty_copyable_unit
:
⊢@
{
iPropI
Σ
}
lty_copyable
()
.
Proof
.
iIntros
(
v
)
"!> #Hv !>"
.
iFrame
"Hv"
.
Qed
.
Proof
.
iIntros
(
v
)
"!> #Hv !>"
.
iFrame
"Hv"
.
Qed
.
...
@@ -94,6 +101,10 @@ Section subtyping_rules.
...
@@ -94,6 +101,10 @@ Section subtyping_rules.
▷
(
A21
<:
A11
)
-∗
▷
(
A12
<:
A22
)
-∗
▷
(
A21
<:
A11
)
-∗
▷
(
A12
<:
A22
)
-∗
(
A11
→
A12
)
<:
(
A21
→
A22
)
.
(
A11
→
A12
)
<:
(
A21
→
A22
)
.
Proof
.
iIntros
"#H1 #H2"
(
v
)
"!> #H !>"
.
by
iApply
lty_le_arr
.
Qed
.
Proof
.
iIntros
"#H1 #H2"
(
v
)
"!> #H !>"
.
by
iApply
lty_le_arr
.
Qed
.
(* This rule is really trivial, since → is syntactic sugar for copy (... ⊸ ...),
but we include it anyway for completeness' sake. *)
Lemma
lty_copyable_arr_copy
A
B
:
⊢@
{
iPropI
Σ
}
lty_copyable
(
A
→
B
)
.
Proof
.
iApply
lty_copyable_copy
.
Qed
.
Lemma
lty_le_prod
A11
A12
A21
A22
:
Lemma
lty_le_prod
A11
A12
A21
A22
:
▷
(
A11
<:
A21
)
-∗
▷
(
A12
<:
A22
)
-∗
▷
(
A11
<:
A21
)
-∗
▷
(
A12
<:
A22
)
-∗
...
@@ -104,7 +115,7 @@ Section subtyping_rules.
...
@@ -104,7 +115,7 @@ Section subtyping_rules.
iDestruct
(
"H1"
with
"H1'"
)
as
"$"
.
iDestruct
(
"H1"
with
"H1'"
)
as
"$"
.
by
iDestruct
(
"H2"
with
"H2'"
)
as
"$"
.
by
iDestruct
(
"H2"
with
"H2'"
)
as
"$"
.
Qed
.
Qed
.
(* TODO(COPY): Show derived rules about copyability of products, sums, etc. *)
Lemma
lty_le_prod_copy
A
B
:
Lemma
lty_le_prod_copy
A
B
:
⊢
copy
A
*
copy
B
<:>
copy
(
A
*
B
)
.
⊢
copy
A
*
copy
B
<:>
copy
(
A
*
B
)
.
Proof
.
Proof
.
...
@@ -113,6 +124,16 @@ Section subtyping_rules.
...
@@ -113,6 +124,16 @@ Section subtyping_rules.
-
iExists
v1
,
v2
.
iSplit
;
[
done
|]
.
auto
.
-
iExists
v1
,
v2
.
iSplit
;
[
done
|]
.
auto
.
Qed
.
Qed
.
Lemma
lty_copyable_prod
A
B
:
lty_copyable
A
-∗
lty_copyable
B
-∗
lty_copyable
(
A
*
B
)
.
Proof
.
iIntros
"#HcpA #HcpB"
.
rewrite
/
lty_copyable
/
tc_opaque
.
iApply
lty_le_r
;
last
by
iApply
lty_le_prod_copy
.
iApply
lty_le_prod
.
-
iApply
"HcpA"
.
-
iApply
"HcpB"
.
Qed
.
Lemma
lty_le_sum
A11
A12
A21
A22
:
Lemma
lty_le_sum
A11
A12
A21
A22
:
▷
(
A11
<:
A21
)
-∗
▷
(
A12
<:
A22
)
-∗
▷
(
A11
<:
A21
)
-∗
▷
(
A12
<:
A22
)
-∗
A11
+
A12
<:
A21
+
A22
.
A11
+
A12
<:
A21
+
A22
.
...
@@ -128,6 +149,15 @@ Section subtyping_rules.
...
@@ -128,6 +149,15 @@ Section subtyping_rules.
iDestruct
1
as
"#[Hv|Hv]"
;
iDestruct
"Hv"
as
(
w
?)
"Hw"
;
iDestruct
1
as
"#[Hv|Hv]"
;
iDestruct
"Hv"
as
(
w
?)
"Hw"
;
try
iModIntro
;
first
[
iLeft
;
by
auto
|
iRight
;
by
auto
]
.
try
iModIntro
;
first
[
iLeft
;
by
auto
|
iRight
;
by
auto
]
.
Qed
.
Qed
.
Lemma
lty_copyable_sum
A
B
:
lty_copyable
A
-∗
lty_copyable
B
-∗
lty_copyable
(
A
+
B
)
.
Proof
.
iIntros
"#HcpA #HcpB"
.
rewrite
/
lty_copyable
/
tc_opaque
.
iApply
lty_le_r
;
last
by
iApply
lty_le_sum_copy
.
iApply
lty_le_sum
.
-
iApply
"HcpA"
.
-
iApply
"HcpB"
.
Qed
.
Lemma
lty_le_forall
C1
C2
:
Lemma
lty_le_forall
C1
C2
:
▷
(
∀
A
,
C1
A
<:
C2
A
)
-∗
▷
(
∀
A
,
C1
A
<:
C2
A
)
-∗
...
@@ -156,9 +186,16 @@ Section subtyping_rules.
...
@@ -156,9 +186,16 @@ Section subtyping_rules.
iSplit
;
iIntros
"!>"
(
v
);
iDestruct
1
as
(
A
)
"#Hv"
;
iSplit
;
iIntros
"!>"
(
v
);
iDestruct
1
as
(
A
)
"#Hv"
;
iExists
A
;
repeat
iModIntro
;
iApply
"Hv"
.
iExists
A
;
repeat
iModIntro
;
iApply
"Hv"
.
Qed
.
Qed
.
Lemma
lty_copyable_exist
{
k
}
(
Mlow
Mup
:
lty
Σ
k
)
C
:
▷
(
∀
M
,
Mlow
<:
M
-∗
M
<:
Mup
-∗
lty_copyable
(
C
M
))
-∗
lty_copyable
(
lty_exist
Mlow
Mup
C
)
.
Proof
.
iIntros
"#Hle"
.
rewrite
/
lty_copyable
/
tc_opaque
.
iApply
lty_le_r
;
last
by
iApply
lty_le_exist_copy
.
iApply
lty_le_exist
;
try
(
iAssumption
||
iApply
lty_le_refl
)
.
Qed
.
(* TODO(COPY): Commuting rule for μ, allowing `copy` to move outside the μ *)
(* TODO(COPY): Commuting rule for μ, allowing `copy` to move outside the μ *)
Lemma
lty_
rec_
copy
C
`{
!
Contractive
C
}
:
Lemma
lty_copy
able_rec
C
`{
!
Contractive
C
}
:
(
∀
A
,
▷
lty_copyable
A
-∗
lty_copyable
(
C
A
))
-∗
lty_copyable
(
lty_rec
C
)
.
(
∀
A
,
▷
lty_copyable
A
-∗
lty_copyable
(
C
A
))
-∗
lty_copyable
(
lty_rec
C
)
.
Proof
.
Proof
.
iIntros
"#Hcopy"
.
iIntros
"#Hcopy"
.
...
@@ -237,7 +274,7 @@ Section subtyping_rules.
...
@@ -237,7 +274,7 @@ Section subtyping_rules.
▷
(
A2
<:
A1
)
-∗
▷
(
S1
<:
S2
)
-∗
▷
(
A2
<:
A1
)
-∗
▷
(
S1
<:
S2
)
-∗
(
<!!>
TY
A1
;
S1
)
<:
(
<!!>
TY
A2
;
S2
)
.
(
<!!>
TY
A1
;
S1
)
<:
(
<!!>
TY
A2
;
S2
)
.
Proof
.
Proof
.
iIntros
"#HAle #HSle !>"
(
v
)
"H"
.
iExists
v
.
iIntros
"#HAle #HSle !>"
(
v
)
"H"
.
iExists
v
.
iDestruct
(
"HAle"
with
"H"
)
as
"$"
.
by
iModIntro
.
iDestruct
(
"HAle"
with
"H"
)
as
"$"
.
by
iModIntro
.
Qed
.
Qed
.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment