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
Package Registry
Model registry
Operate
Environments
Terraform modules
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
tlsomers
Actris
Commits
87186104
Commit
87186104
authored
4 years ago
by
Jonas Kastberg
Browse files
Options
Downloads
Patches
Plain Diff
Nits
parent
83280c7b
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
theories/logrel/examples/subtyping.v
+5
-8
5 additions, 8 deletions
theories/logrel/examples/subtyping.v
theories/logrel/subtyping_rules.v
+15
-11
15 additions, 11 deletions
theories/logrel/subtyping_rules.v
with
20 additions
and
19 deletions
theories/logrel/examples/subtyping.v
+
5
−
8
View file @
87186104
...
...
@@ -19,10 +19,8 @@ Section basics.
Definition
prot1
:=
lty_rec
prot1_aux
.
Definition
prot1'_aux
(
rec
:
lsty
Σ
)
:
lsty
Σ
:=
<!!
X
Y
>
TY
(
X
⊸
Y
);
<!!>
TY
X
;
<
??
>
TY
Y
;
<!!
X
Y
>
TY
(
X
⊸
Y
);
<!!>
TY
X
;
<
??
>
TY
Y
;
rec
.
<!!
X
Y
>
TY
(
X
⊸
Y
);
<!!>
TY
X
;
<
??
>
TY
Y
;
<!!
X
Y
>
TY
(
X
⊸
Y
);
<!!>
TY
X
;
<
??
>
TY
Y
;
rec
.
Instance
prot1'_aux_contractive
:
Contractive
prot1'_aux
.
Proof
.
solve_proto_contractive
.
Qed
.
Definition
prot1'
:=
lty_rec
prot1'_aux
.
...
...
@@ -39,13 +37,12 @@ Section basics.
Proof
.
iApply
(
lty_le_trans
_
prot1'
)
.
{
iLöb
as
"IH"
.
iEval
(
rewrite
/
prot1
/
prot1'
)
.
iDestruct
(
lty_le_rec_unfold
(
prot1_aux
))
as
"[H1 _]"
.
iDestruct
(
lty_le_rec_unfold
(
prot1'_aux
))
as
"[_ H2]"
.
iApply
(
lty_le_trans
with
"H1"
)
.
iApply
(
lty_le_trans
with
"[] H2"
)
.
iIntros
(
X
Y
)
.
iExists
X
,
Y
.
do
3
iModIntro
.
iIntros
(
X
Y
)
.
iExists
X
,
Y
.
iIntros
"!>!>!>"
.
iApply
(
lty_le_trans
with
"H1"
)
.
iIntros
(
X'
Y'
)
.
iExists
X'
,
Y'
.
do
3
iModIntro
.
iIntros
(
X'
Y'
)
.
iExists
X'
,
Y'
.
iIntros
"!>!>!>"
.
iApply
"IH"
.
}
iApply
lty_le_rec
.
iIntros
(
S1
S2
)
"#Hrec"
.
...
...
@@ -56,6 +53,6 @@ Section basics.
<!!>
TY
Y
;
<
??
>
TY
lty_int
;
S2
))
.
{
iApply
lty_le_swap_recv_send
.
}
iModIntro
.
iApply
lty_le_swap_recv_send
.
}
iModIntro
.
iExists
Y
,
lty_int
.
by
do
3
iModIntro
.
iModIntro
.
iExists
Y
,
lty_int
.
by
iIntros
"!>!>!>"
.
Qed
.
End
basics
.
This diff is collapsed.
Click to expand it.
theories/logrel/subtyping_rules.v
+
15
−
11
View file @
87186104
...
...
@@ -11,25 +11,26 @@ Section subtyping_rules.
Implicit
Types
S
:
lsty
Σ
.
(** Generic rules *)
Lemma
lty_le_refl
{
k
}
(
M
:
lty
Σ
k
)
:
⊢
M
<:
M
.
Lemma
lty_le_refl
{
k
}
(
K
:
lty
Σ
k
)
:
⊢
K
<:
K
.
Proof
.
destruct
k
.
by
iIntros
(
v
)
"!> H"
.
by
iModIntro
.
Qed
.
Lemma
lty_le_trans
{
k
}
(
M
1
M
2
M
3
:
lty
Σ
k
)
:
M
1
<:
M
2
-∗
M
2
<:
M
3
-∗
M
1
<:
M
3
.
Lemma
lty_le_trans
{
k
}
(
K
1
K
2
K
3
:
lty
Σ
k
)
:
K
1
<:
K
2
-∗
K
2
<:
K
3
-∗
K
1
<:
K
3
.
Proof
.
destruct
k
.
-
iIntros
"#H1 #H2"
(
v
)
"!> H"
.
iApply
"H2"
.
by
iApply
"H1"
.
-
iIntros
"#H1 #H2 !>"
.
by
iApply
iProto_le_trans
.
Qed
.
Lemma
lty_bi_le_refl
{
k
}
(
M
:
lty
Σ
k
)
:
⊢
M
<:>
M
.
Lemma
lty_bi_le_refl
{
k
}
(
K
:
lty
Σ
k
)
:
⊢
K
<:>
K
.
Proof
.
iSplit
;
iApply
lty_le_refl
.
Qed
.
Lemma
lty_bi_le_trans
{
k
}
(
M1
M2
M3
:
lty
Σ
k
)
:
M1
<:>
M2
-∗
M2
<:>
M3
-∗
M1
<:>
M3
.
Lemma
lty_bi_le_trans
{
k
}
(
K1
K2
K3
:
lty
Σ
k
)
:
K1
<:>
K2
-∗
K2
<:>
K3
-∗
K1
<:>
K3
.
Proof
.
iIntros
"#[H11 H12] #[H21 H22]"
.
iSplit
;
by
iApply
lty_le_trans
.
Qed
.
Lemma
lty_bi_le_sym
{
k
}
(
M
1
M
2
:
lty
Σ
k
)
:
M
1
<:>
M
2
-∗
M
2
<:>
M
1
.
Lemma
lty_bi_le_sym
{
k
}
(
K
1
K
2
:
lty
Σ
k
)
:
K
1
<:>
K
2
-∗
K
2
<:>
K
1
.
Proof
.
iIntros
"#[??]"
;
by
iSplit
.
Qed
.
Lemma
lty_le_l
{
k
}
(
M
1
M
2
M
3
:
lty
Σ
k
)
:
M
1
<:>
M
2
-∗
M
2
<:
M
3
-∗
M
1
<:
M
3
.
Lemma
lty_le_l
{
k
}
(
K
1
K
2
K
3
:
lty
Σ
k
)
:
K
1
<:>
K
2
-∗
K
2
<:
K
3
-∗
K
1
<:
K
3
.
Proof
.
iIntros
"#[H1 _] #H2"
.
by
iApply
lty_le_trans
.
Qed
.
Lemma
lty_le_r
{
k
}
(
M
1
M
2
M
3
:
lty
Σ
k
)
:
M
1
<:
M
2
-∗
M
2
<:>
M
3
-∗
M
1
<:
M
3
.
Lemma
lty_le_r
{
k
}
(
K
1
K
2
K
3
:
lty
Σ
k
)
:
K
1
<:
K
2
-∗
K
2
<:>
K
3
-∗
K
1
<:
K
3
.
Proof
.
iIntros
"#H1 #[H2 _]"
.
by
iApply
lty_le_trans
.
Qed
.
Lemma
lty_le_rec_unfold
{
k
}
(
C
:
lty
Σ
k
→
lty
Σ
k
)
`{
!
Contractive
C
}
:
...
...
@@ -40,8 +41,9 @@ Section subtyping_rules.
-
rewrite
{
2
}
/
lty_rec
fixpoint_unfold
.
iApply
lty_le_refl
.
Qed
.
Lemma
lty_le_rec
{
k
}
(
C1
C2
:
lty
Σ
k
→
lty
Σ
k
)
`{
Contractive
C1
,
Contractive
C2
}
:
(
∀
M1
M2
,
▷
(
M1
<:
M2
)
-∗
C1
M1
<:
C2
M2
)
-∗
Lemma
lty_le_rec
{
k
}
(
C1
C2
:
lty
Σ
k
→
lty
Σ
k
)
`{
Contractive
C1
,
Contractive
C2
}
:
(
∀
K1
K2
,
▷
(
K1
<:
K2
)
-∗
C1
K1
<:
C2
K2
)
-∗
lty_rec
C1
<:
lty_rec
C2
.
Proof
.
iIntros
"#Hle"
.
iLöb
as
"IH"
.
...
...
@@ -402,12 +404,14 @@ Section subtyping_rules.
⊢
(
S1
<++>
S2
)
<++>
S3
<:>
S1
<++>
(
S2
<++>
S3
)
.
Proof
.
rewrite
/
lty_app
assoc
.
iSplit
;
by
iModIntro
.
Qed
.
Lemma
lty_le_app_send
A
S1
S2
:
⊢
(
<!!>
TY
A
;
S1
)
<++>
S2
<:>
(
<!!>
TY
A
;
S1
<++>
S2
)
.
Lemma
lty_le_app_send
A
S1
S2
:
⊢
(
<!!>
TY
A
;
S1
)
<++>
S2
<:>
(
<!!>
TY
A
;
S1
<++>
S2
)
.
Proof
.
rewrite
/
lty_app
iProto_app_message
iMsg_app_exist
.
setoid_rewrite
iMsg_app_base
.
iSplit
;
by
iIntros
"!> /="
.
Qed
.
Lemma
lty_le_app_recv
A
S1
S2
:
⊢
(
<
??
>
TY
A
;
S1
)
<++>
S2
<:>
(
<
??
>
TY
A
;
S1
<++>
S2
)
.
Lemma
lty_le_app_recv
A
S1
S2
:
⊢
(
<
??
>
TY
A
;
S1
)
<++>
S2
<:>
(
<
??
>
TY
A
;
S1
<++>
S2
)
.
Proof
.
rewrite
/
lty_app
iProto_app_message
iMsg_app_exist
.
setoid_rewrite
iMsg_app_base
.
iSplit
;
by
iIntros
"!> /="
.
...
...
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