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
ddd46702
Commit
ddd46702
authored
5 years ago
by
Daniël Louwrink
Browse files
Options
Downloads
Plain Diff
Merge branch 'master' into copying
parents
c610b7e9
f6985bbd
No related branches found
Branches containing commit
No related tags found
1 merge request
!9
Copying
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
theories/logrel/subtyping.v
+60
-59
60 additions, 59 deletions
theories/logrel/subtyping.v
with
60 additions
and
59 deletions
theories/logrel/subtyping.v
+
60
−
59
View file @
ddd46702
...
@@ -9,23 +9,41 @@ Definition lty_le {Σ} (A1 A2 : lty Σ) : iProp Σ :=
...
@@ -9,23 +9,41 @@ Definition lty_le {Σ} (A1 A2 : lty Σ) : iProp Σ :=
Arguments
lty_le
{_}
_
%
lty
_
%
lty
.
Arguments
lty_le
{_}
_
%
lty
_
%
lty
.
Infix
"<:"
:=
lty_le
(
at
level
70
)
.
Infix
"<:"
:=
lty_le
(
at
level
70
)
.
Instance
:
Params
(
@
lty_le
)
1
:=
{}
.
Instance
:
Params
(
@
lty_le
)
1
:=
{}
.
Instance
lty_le_ne
{
Σ
}
:
NonExpansive2
(
@
lty_le
Σ
)
.
Instance
lty_le_ne
{
Σ
}
:
NonExpansive2
(
@
lty_le
Σ
)
.
Proof
.
solve_proper
.
Qed
.
Proof
.
solve_proper
.
Qed
.
Instance
lty_le_proper
{
Σ
}
:
Proper
((
≡
)
==>
(
≡
)
==>
(
≡
))
(
@
lty_le
Σ
)
.
Instance
lty_le_proper
{
Σ
}
:
Proper
((
≡
)
==>
(
≡
)
==>
(
≡
))
(
@
lty_le
Σ
)
.
Proof
.
solve_proper
.
Qed
.
Proof
.
solve_proper
.
Qed
.
Definition
lty_bi_le
{
Σ
}
(
A1
A2
:
lty
Σ
)
:
iProp
Σ
:=
A1
<:
A2
∧
A2
<:
A1
.
Arguments
lty_bi_le
{_}
_
%
lty
_
%
lty
.
Infix
"<:>"
:=
lty_bi_le
(
at
level
70
)
.
Instance
:
Params
(
@
lty_bi_le
)
1
:=
{}
.
Instance
lty_bi_le_ne
{
Σ
}
:
NonExpansive2
(
@
lty_bi_le
Σ
)
.
Proof
.
solve_proper
.
Qed
.
Instance
lty_bi_le_proper
{
Σ
}
:
Proper
((
≡
)
==>
(
≡
)
==>
(
≡
))
(
@
lty_bi_le
Σ
)
.
Proof
.
solve_proper
.
Qed
.
Definition
lsty_le
{
Σ
}
(
P1
P2
:
lsty
Σ
)
:
iProp
Σ
:=
Definition
lsty_le
{
Σ
}
(
P1
P2
:
lsty
Σ
)
:
iProp
Σ
:=
□
iProto_le
P1
P2
.
□
iProto_le
P1
P2
.
Arguments
lsty_le
{_}
_
%
lsty
_
%
lsty
.
Arguments
lsty_le
{_}
_
%
lsty
_
%
lsty
.
Infix
"<s:"
:=
lsty_le
(
at
level
70
)
.
Infix
"<s:"
:=
lsty_le
(
at
level
70
)
.
Instance
:
Params
(
@
lsty_le
)
1
:=
{}
.
Instance
:
Params
(
@
lsty_le
)
1
:=
{}
.
Instance
lsty_le_ne
{
Σ
}
:
NonExpansive2
(
@
lsty_le
Σ
)
.
Instance
lsty_le_ne
{
Σ
}
:
NonExpansive2
(
@
lsty_le
Σ
)
.
Proof
.
solve_proper
.
Qed
.
Proof
.
solve_proper
.
Qed
.
Instance
lsty_le_proper
{
Σ
}
:
Proper
((
≡
)
==>
(
≡
)
==>
(
≡
))
(
@
lsty_le
Σ
)
.
Instance
lsty_le_proper
{
Σ
}
:
Proper
((
≡
)
==>
(
≡
)
==>
(
≡
))
(
@
lsty_le
Σ
)
.
Proof
.
solve_proper
.
Qed
.
Proof
.
solve_proper
.
Qed
.
Definition
lsty_bi_le
{
Σ
}
(
S1
S2
:
lsty
Σ
)
:
iProp
Σ
:=
S1
<
s
:
S2
∧
S2
<
s
:
S1
.
Arguments
lty_bi_le
{_}
_
%
lsty
_
%
lsty
.
Infix
"<s:>"
:=
lsty_bi_le
(
at
level
70
)
.
Instance
:
Params
(
@
lsty_bi_le
)
1
:=
{}
.
Instance
lsty_bi_le_ne
{
Σ
}
:
NonExpansive2
(
@
lsty_bi_le
Σ
)
.
Proof
.
solve_proper
.
Qed
.
Instance
lsty_bi_le_proper
{
Σ
}
:
Proper
((
≡
)
==>
(
≡
)
==>
(
≡
))
(
@
lsty_bi_le
Σ
)
.
Proof
.
solve_proper
.
Qed
.
Section
subtype
.
Section
subtype
.
Context
`{
heapG
Σ
,
chanG
Σ
}
.
Context
`{
heapG
Σ
,
chanG
Σ
}
.
Implicit
Types
A
:
lty
Σ
.
Implicit
Types
A
:
lty
Σ
.
...
@@ -33,10 +51,14 @@ Section subtype.
...
@@ -33,10 +51,14 @@ Section subtype.
Lemma
lty_le_refl
(
A
:
lty
Σ
)
:
⊢
A
<:
A
.
Lemma
lty_le_refl
(
A
:
lty
Σ
)
:
⊢
A
<:
A
.
Proof
.
by
iIntros
(
v
)
"!> H"
.
Qed
.
Proof
.
by
iIntros
(
v
)
"!> H"
.
Qed
.
Lemma
lty_le_trans
A1
A2
A3
:
A1
<:
A2
-∗
A2
<:
A3
-∗
A1
<:
A3
.
Lemma
lty_le_trans
A1
A2
A3
:
A1
<:
A2
-∗
A2
<:
A3
-∗
A1
<:
A3
.
Proof
.
iIntros
"#H1 #H2"
(
v
)
"!> H"
.
iApply
"H2"
.
by
iApply
"H1"
.
Qed
.
Proof
.
iIntros
"#H1 #H2"
(
v
)
"!> H"
.
iApply
"H2"
.
by
iApply
"H1"
.
Qed
.
Lemma
lty_bi_le_refl
A
:
⊢
A
<:>
A
.
Proof
.
iSplit
;
iApply
lty_le_refl
.
Qed
.
Lemma
lty_bi_le_trans
A1
A2
A3
:
⊢
A1
<:>
A2
-∗
A2
<:>
A3
-∗
A1
<:>
A3
.
Proof
.
iIntros
"#[H11 H12] #[H21 H22]"
.
iSplit
;
by
iApply
lty_le_trans
.
Qed
.
Lemma
lty_le_copy
A
:
⊢
copy
A
<:
A
.
Lemma
lty_le_copy
A
:
⊢
copy
A
<:
A
.
Proof
.
by
iIntros
(
v
)
"!> #H"
.
Qed
.
Proof
.
by
iIntros
(
v
)
"!> #H"
.
Qed
.
...
@@ -100,15 +122,12 @@ Section subtype.
...
@@ -100,15 +122,12 @@ Section subtype.
⊢
C
B
<:
∃
A
,
C
A
.
⊢
C
B
<:
∃
A
,
C
A
.
Proof
.
iIntros
"!>"
(
v
)
"Hle"
.
by
iExists
B
.
Qed
.
Proof
.
iIntros
"!>"
(
v
)
"Hle"
.
by
iExists
B
.
Qed
.
Lemma
lty_le_rec_
1
(
C
:
lty
Σ
→
lty
Σ
)
`{
!
Contractive
C
}
:
Lemma
lty_le_rec_
unfold
(
C
:
lty
Σ
→
lty
Σ
)
`{
!
Contractive
C
}
:
⊢
lty_rec
C
<:
C
(
lty_rec
C
)
.
⊢
lty_rec
C
<:
>
C
(
lty_rec
C
)
.
Proof
.
Proof
.
rewrite
{
1
}
/
lty_rec
{
1
}
fixpoint_unfold
{
1
}
/
lty_rec_aux
.
iApply
lty_le_refl
.
iSplit
.
Qed
.
-
rewrite
{
1
}
/
lty_rec
{
1
}
fixpoint_unfold
{
1
}
/
lty_rec_aux
.
iApply
lty_le_refl
.
Lemma
lty_le_rec_2
(
C
:
lty
Σ
→
lty
Σ
)
`{
!
Contractive
C
}
:
-
rewrite
{
2
}
/
lty_rec
{
1
}
fixpoint_unfold
{
1
}
/
lty_rec_aux
.
iApply
lty_le_refl
.
⊢
C
(
lty_rec
C
)
<:
lty_rec
C
.
Proof
.
rewrite
{
2
}
/
lty_rec
{
1
}
fixpoint_unfold
{
1
}
/
lty_rec_aux
.
iApply
lty_le_refl
.
Qed
.
Qed
.
Lemma
lty_le_rec
`{
Contractive
C1
,
Contractive
C2
}
:
Lemma
lty_le_rec
`{
Contractive
C1
,
Contractive
C2
}
:
...
@@ -172,10 +191,14 @@ Section subtype.
...
@@ -172,10 +191,14 @@ Section subtype.
Lemma
lsty_le_refl
(
S
:
lsty
Σ
)
:
⊢
S
<
s
:
S
.
Lemma
lsty_le_refl
(
S
:
lsty
Σ
)
:
⊢
S
<
s
:
S
.
Proof
.
iApply
iProto_le_refl
.
Qed
.
Proof
.
iApply
iProto_le_refl
.
Qed
.
Lemma
lsty_le_trans
S1
S2
S3
:
S1
<
s
:
S2
-∗
S2
<
s
:
S3
-∗
S1
<
s
:
S3
.
Lemma
lsty_le_trans
S1
S2
S3
:
S1
<
s
:
S2
-∗
S2
<
s
:
S3
-∗
S1
<
s
:
S3
.
Proof
.
iIntros
"#H1 #H2 !>"
.
by
iApply
iProto_le_trans
.
Qed
.
Proof
.
iIntros
"#H1 #H2 !>"
.
by
iApply
iProto_le_trans
.
Qed
.
Lemma
lsty_bi_le_refl
S
:
⊢
S
<
s
:>
S
.
Proof
.
iSplit
;
iApply
lsty_le_refl
.
Qed
.
Lemma
lsty_bi_le_trans
S1
S2
S3
:
⊢
S1
<
s
:>
S2
-∗
S2
<
s
:>
S3
-∗
S1
<
s
:>
S3
.
Proof
.
iIntros
"#[H11 H12] #[H21 H22]"
.
iSplit
;
by
iApply
lsty_le_trans
.
Qed
.
Lemma
lsty_le_send
A1
A2
S1
S2
:
Lemma
lsty_le_send
A1
A2
S1
S2
:
▷
(
A2
<:
A1
)
-∗
▷
(
S1
<
s
:
S2
)
-∗
▷
(
A2
<:
A1
)
-∗
▷
(
S1
<
s
:
S2
)
-∗
(
<!!>
A1
;
S1
)
<
s
:
(
<!!>
A2
;
S2
)
.
(
<!!>
A1
;
S1
)
<
s
:
(
<!!>
A2
;
S2
)
.
...
@@ -268,21 +291,14 @@ Section subtype.
...
@@ -268,21 +291,14 @@ Section subtype.
(
S11
<++>
S12
)
<
s
:
(
S21
<++>
S22
)
.
(
S11
<++>
S12
)
<
s
:
(
S21
<++>
S22
)
.
Proof
.
iIntros
"#H1 #H2 !>"
.
by
iApply
iProto_le_app
.
Qed
.
Proof
.
iIntros
"#H1 #H2 !>"
.
by
iApply
iProto_le_app
.
Qed
.
Lemma
lsty_le_app_assoc_l
S1
S2
S3
:
Lemma
lsty_le_app_assoc
S1
S2
S3
:
⊢
S1
<++>
(
S2
<++>
S3
)
<
s
:
(
S1
<++>
S2
)
<++>
S3
.
⊢
(
S1
<++>
S2
)
<++>
S3
<
s
:>
S1
<++>
(
S2
<++>
S3
)
.
Proof
.
rewrite
assoc
.
iApply
lsty_le_refl
.
Qed
.
Proof
.
rewrite
assoc
.
iApply
lsty_bi_le_refl
.
Qed
.
Lemma
lsty_le_app_assoc_r
S1
S2
S3
:
⊢
(
S1
<++>
S2
)
<++>
S3
<
s
:
S1
<++>
(
S2
<++>
S3
)
.
Lemma
lsty_le_app_id_l
S
:
⊢
(
END
<++>
S
)
<
s
:>
S
.
Proof
.
rewrite
assoc
.
iApply
lsty_le_refl
.
Qed
.
Proof
.
rewrite
left_id
.
iApply
lsty_bi_le_refl
.
Qed
.
Lemma
lsty_le_app_id_r
S
:
⊢
(
S
<++>
END
)
<
s
:>
S
.
Lemma
lsty_le_app_id_l_l
S
:
⊢
(
END
<++>
S
)
<
s
:
S
.
Proof
.
rewrite
right_id
.
iApply
lsty_bi_le_refl
.
Qed
.
Proof
.
rewrite
left_id
.
iApply
lsty_le_refl
.
Qed
.
Lemma
lsty_le_app_id_l_r
S
:
⊢
(
S
<++>
END
)
<
s
:
S
.
Proof
.
rewrite
right_id
.
iApply
lsty_le_refl
.
Qed
.
Lemma
lsty_le_app_id_r_l
S
:
⊢
S
<
s
:
(
END
<++>
S
)
.
Proof
.
rewrite
left_id
.
iApply
lsty_le_refl
.
Qed
.
Lemma
lsty_le_app_id_r_r
S
:
⊢
S
<
s
:
(
S
<++>
END
)
.
Proof
.
rewrite
right_id
.
iApply
lsty_le_refl
.
Qed
.
Lemma
lsty_le_dual
S1
S2
:
S2
<
s
:
S1
-∗
lsty_dual
S1
<
s
:
lsty_dual
S2
.
Lemma
lsty_le_dual
S1
S2
:
S2
<
s
:
S1
-∗
lsty_dual
S1
<
s
:
lsty_dual
S2
.
Proof
.
iIntros
"#H !>"
.
by
iApply
iProto_le_dual
.
Qed
.
Proof
.
iIntros
"#H !>"
.
by
iApply
iProto_le_dual
.
Qed
.
...
@@ -291,41 +307,26 @@ Section subtype.
...
@@ -291,41 +307,26 @@ Section subtype.
Lemma
lsty_le_dual_r
S1
S2
:
S2
<
s
:
lsty_dual
S1
-∗
S1
<
s
:
lsty_dual
S2
.
Lemma
lsty_le_dual_r
S1
S2
:
S2
<
s
:
lsty_dual
S1
-∗
S1
<
s
:
lsty_dual
S2
.
Proof
.
iIntros
"#H !>"
.
by
iApply
iProto_le_dual_r
.
Qed
.
Proof
.
iIntros
"#H !>"
.
by
iApply
iProto_le_dual_r
.
Qed
.
Lemma
lsty_le_dual_message_l
a
A
S
:
Lemma
lsty_le_dual_message
a
A
S
:
⊢
lsty_dual
(
lsty_message
a
A
S
)
<
s
:
lsty_message
(
action_dual
a
)
A
(
lsty_dual
S
)
.
⊢
lsty_dual
(
lsty_message
a
A
S
)
<
s
:>
Proof
.
lsty_message
(
action_dual
a
)
A
(
lsty_dual
S
)
.
iIntros
"!>"
.
rewrite
/
lsty_dual
iProto_dual_message_tele
.
iApply
iProto_le_refl
.
Qed
.
Lemma
lsty_le_dual_message_r
a
A
S
:
⊢
lsty_message
(
action_dual
a
)
A
(
lsty_dual
S
)
<
s
:
lsty_dual
(
lsty_message
a
A
S
)
.
Proof
.
iIntros
"!>"
.
rewrite
/
lsty_dual
iProto_dual_message_tele
.
iApply
iProto_le_refl
.
Qed
.
Lemma
lsty_le_dual_send_l
A
S
:
⊢
lsty_dual
(
<!!>
A
;
S
)
<
s
:
(
<
??
>
A
;
lsty_dual
S
)
.
Proof
.
apply
lsty_le_dual_message_l
.
Qed
.
Lemma
lsty_le_dual_send_r
A
S
:
⊢
(
<!!>
A
;
lsty_dual
S
)
<
s
:
lsty_dual
(
<
??
>
A
;
S
)
.
Proof
.
apply
:
lsty_le_dual_message_r
.
Qed
.
Lemma
lsty_le_dual_recv_l
A
S
:
⊢
lsty_dual
(
<
??
>
A
;
S
)
<
s
:
(
<!!>
A
;
lsty_dual
S
)
.
Proof
.
apply
lsty_le_dual_message_l
.
Qed
.
Lemma
lsty_le_dual_recv_r
A
S
:
⊢
(
<
??
>
A
;
lsty_dual
S
)
<
s
:
lsty_dual
(
<!!>
A
;
S
)
.
Proof
.
apply
:
lsty_le_dual_message_r
.
Qed
.
Lemma
lsty_le_dual_end_l
:
⊢
lsty_dual
(
Σ
:=
Σ
)
END
<
s
:
END
.
Proof
.
rewrite
/
lsty_dual
iProto_dual_end
=>
/=.
apply
lsty_le_refl
.
Qed
.
Lemma
lsty_le_dual_end_r
:
⊢
END
<
s
:
lsty_dual
(
Σ
:=
Σ
)
END
.
Proof
.
rewrite
/
lsty_dual
iProto_dual_end
=>
/=.
apply
lsty_le_refl
.
Qed
.
Lemma
lsty_le_rec_1
(
C
:
lsty
Σ
→
lsty
Σ
)
`{
!
Contractive
C
}
:
⊢
lsty_rec
C
<
s
:
C
(
lsty_rec
C
)
.
Proof
.
Proof
.
rewrite
{
1
}
/
lsty_
rec
{
1
}
fixpoint_unfold
{
1
}
/
lsty_rec1
.
iSplit
;
iIntros
"!>"
;
rewrite
/
lsty_
dual
iProto_dual_message_tele
;
iApply
lsty
_le_refl
.
iApply
iProto
_le_refl
.
Qed
.
Qed
.
Lemma
lsty_le_rec_2
(
C
:
lsty
Σ
→
lsty
Σ
)
`{
!
Contractive
C
}
:
Lemma
lsty_le_dual_send
A
S
:
⊢
lsty_dual
(
<!!>
A
;
S
)
<
s
:>
(
<
??
>
A
;
lsty_dual
S
)
.
⊢
C
(
lsty_rec
C
)
<
s
:
lsty_rec
C
.
Proof
.
apply
lsty_le_dual_message
.
Qed
.
Lemma
lsty_le_dual_recv
A
S
:
⊢
lsty_dual
(
<
??
>
A
;
S
)
<
s
:>
(
<!!>
A
;
lsty_dual
S
)
.
Proof
.
apply
lsty_le_dual_message
.
Qed
.
Lemma
lsty_le_dual_end
:
⊢
lsty_dual
(
Σ
:=
Σ
)
END
<
s
:>
END
.
Proof
.
rewrite
/
lsty_dual
iProto_dual_end
=>
/=.
apply
lsty_bi_le_refl
.
Qed
.
Lemma
lsty_le_rec_unfold
(
C
:
lsty
Σ
→
lsty
Σ
)
`{
!
Contractive
C
}
:
⊢
lsty_rec
C
<
s
:>
C
(
lsty_rec
C
)
.
Proof
.
Proof
.
rewrite
{
2
}
/
lsty_rec
{
1
}
fixpoint_unfold
{
1
}
/
lsty_rec1
.
iSplit
.
iApply
lsty_le_refl
.
-
rewrite
{
1
}
/
lsty_rec
{
1
}
fixpoint_unfold
{
1
}
/
lsty_rec1
.
iApply
lsty_le_refl
.
-
rewrite
{
2
}
/
lsty_rec
{
1
}
fixpoint_unfold
{
1
}
/
lsty_rec1
.
iApply
lsty_le_refl
.
Qed
.
Qed
.
Lemma
lsty_le_rec
`{
Contractive
C1
,
Contractive
C2
}
:
Lemma
lsty_le_rec
`{
Contractive
C1
,
Contractive
C2
}
:
...
...
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