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
Thomas Somers
Actris
Commits
c1bfaa60
Commit
c1bfaa60
authored
5 years ago
by
Jonas Kastberg
Browse files
Options
Downloads
Patches
Plain Diff
Updated choice type to be n-ary
parent
acd848fe
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
theories/logrel/session_types.v
+45
-53
45 additions, 53 deletions
theories/logrel/session_types.v
with
45 additions
and
53 deletions
theories/logrel/session_types.v
+
45
−
53
View file @
c1bfaa60
From
actris
.
logrel
Require
Export
ltyping
lsty
.
From
actris
.
logrel
Require
Export
ltyping
lsty
.
From
iris
.
algebra
Require
Import
gmap
.
From
iris
.
heap_lang
Require
Export
lifting
metatheory
.
From
iris
.
heap_lang
Require
Export
lifting
metatheory
.
From
iris
.
base_logic
.
lib
Require
Import
invariants
.
From
iris
.
base_logic
.
lib
Require
Import
invariants
.
From
iris
.
heap_lang
Require
Import
notation
proofmode
.
From
iris
.
heap_lang
Require
Import
notation
proofmode
.
...
@@ -9,15 +10,21 @@ Section protocols.
...
@@ -9,15 +10,21 @@ Section protocols.
Definition
lsty_end
:
lsty
Σ
:=
Lsty
END
.
Definition
lsty_end
:
lsty
Σ
:=
Lsty
END
.
Definition
lsty_message
(
a
:
action
)
(
A
:
lty
Σ
)
(
P
:
lsty
Σ
)
:
lsty
Σ
:=
Lsty
(
<
a
>
v
,
MSG
v
{{
A
v
}};
lsty_car
P
)
.
Definition
lsty_send
(
A
:
lty
Σ
)
(
P
:
lsty
Σ
)
:
lsty
Σ
:=
Definition
lsty_send
(
A
:
lty
Σ
)
(
P
:
lsty
Σ
)
:
lsty
Σ
:=
L
sty
(
<!>
v
,
MSG
v
{{
A
v
}};
lsty_car
P
)
.
l
sty
_message
Send
A
P
.
Definition
lsty_recv
(
A
:
lty
Σ
)
(
P
:
lsty
Σ
)
:
lsty
Σ
:=
Definition
lsty_recv
(
A
:
lty
Σ
)
(
P
:
lsty
Σ
)
:
lsty
Σ
:=
Lsty
(
<
?
>
v
,
MSG
v
{{
A
v
}};
lsty_car
P
)
.
lsty_message
Recv
A
P
.
Definition
lsty_choice
(
a
:
action
)
(
Ps
:
gmap
Z
(
lsty
Σ
))
:
lsty
Σ
:=
Lsty
(
<
a
>
x
:
Z
,
MSG
#
x
{{
⌜
is_Some
(
Ps
!!
x
)
⌝
}};
lsty_car
(
Ps
!!!
x
))
.
Definition
lsty_
branch
(
P1
P2
:
lsty
Σ
)
:
lsty
Σ
:=
Definition
lsty_
select
(
Ps
:
gmap
Z
(
lsty
Σ
)
)
:
lsty
Σ
:=
L
sty
(
P1
<
&
>
P2
)
.
l
sty
_choice
Send
Ps
.
Definition
lsty_
select
(
P1
P2
:
lsty
Σ
)
:
lsty
Σ
:=
Definition
lsty_
branch
(
Ps
:
gmap
Z
(
lsty
Σ
)
)
:
lsty
Σ
:=
L
sty
(
P1
<+>
P2
)
.
l
sty
_choice
Recv
Ps
.
Definition
lsty_rec1
(
C
:
lsty
Σ
→
lsty
Σ
)
Definition
lsty_rec1
(
C
:
lsty
Σ
→
lsty
Σ
)
`{
!
Contractive
C
}
`{
!
Contractive
C
}
...
@@ -41,7 +48,7 @@ End protocols.
...
@@ -41,7 +48,7 @@ End protocols.
Section
Propers
.
Section
Propers
.
Context
`{
heapG
Σ
,
protoG
Σ
}
.
Context
`{
heapG
Σ
,
protoG
Σ
}
.
Global
Instance
lsty_
send
_ne
:
NonExpansive2
(
@
lsty_
send
Σ
)
.
Global
Instance
lsty_
message
_ne
a
:
NonExpansive2
(
@
lsty_
message
Σ
a
)
.
Proof
.
Proof
.
intros
n
A
A'
H1
P
P'
H2
.
intros
n
A
A'
H1
P
P'
H2
.
rewrite
/
lsty_send
.
rewrite
/
lsty_send
.
...
@@ -49,8 +56,8 @@ Section Propers.
...
@@ -49,8 +56,8 @@ Section Propers.
apply
iProto_message_ne
;
simpl
;
try
done
.
apply
iProto_message_ne
;
simpl
;
try
done
.
Qed
.
Qed
.
Global
Instance
lsty_
send
_contractive
n
:
Global
Instance
lsty_
message
_contractive
n
a
:
Proper
(
dist_later
n
==>
dist_later
n
==>
dist
n
)
(
@
lsty_
send
Σ
)
.
Proper
(
dist_later
n
==>
dist_later
n
==>
dist
n
)
(
@
lsty_
message
Σ
a
)
.
Proof
.
Proof
.
intros
A
A'
H1
P
P'
H2
.
intros
A
A'
H1
P
P'
H2
.
rewrite
/
lsty_send
.
rewrite
/
lsty_send
.
...
@@ -61,65 +68,50 @@ Section Propers.
...
@@ -61,65 +68,50 @@ Section Propers.
apply
H1
.
apply
H1
.
Qed
.
Qed
.
Global
Instance
lsty_send_ne
:
NonExpansive2
(
@
lsty_send
Σ
)
.
Proof
.
solve_proper
.
Qed
.
Global
Instance
lsty_send_contractive
n
:
Proper
(
dist_later
n
==>
dist_later
n
==>
dist
n
)
(
@
lsty_send
Σ
)
.
Proof
.
solve_contractive
.
Qed
.
Global
Instance
lsty_recv_ne
:
NonExpansive2
(
@
lsty_recv
Σ
)
.
Global
Instance
lsty_recv_ne
:
NonExpansive2
(
@
lsty_recv
Σ
)
.
Proof
.
Proof
.
solve_proper
.
Qed
.
intros
n
A
A'
H1
P
P'
H2
.
rewrite
/
lsty_recv
.
apply
Lsty_ne
.
apply
iProto_message_ne
;
simpl
;
try
done
.
Qed
.
Global
Instance
lsty_recv_contractive
n
:
Global
Instance
lsty_recv_contractive
n
:
Proper
(
dist_later
n
==>
dist_later
n
==>
dist
n
)
(
@
lsty_recv
Σ
)
.
Proper
(
dist_later
n
==>
dist_later
n
==>
dist
n
)
(
@
lsty_recv
Σ
)
.
Proof
.
Proof
.
solve_contractive
.
Qed
.
intros
A
A'
H1
P
P'
H2
.
rewrite
/
lsty_recv
.
apply
Lsty_ne
.
apply
iProto_message_contractive
;
simpl
;
try
done
.
intros
v
.
destruct
n
as
[|
n
];
try
done
.
apply
H1
.
Qed
.
Global
Instance
lsty_
branch
_ne
:
NonExpansive
2
(
@
lsty_
branch
Σ
)
.
Global
Instance
lsty_
choice
_ne
a
:
NonExpansive
(
@
lsty_
choice
Σ
a
)
.
Proof
.
Proof
.
intros
n
A
A'
H1
P
P'
H2
.
intros
n
Ps1
Ps2
Pseq
.
rewrite
/
lsty_branch
.
apply
Lsty_ne
.
apply
Lsty_ne
.
apply
iProto_message_ne
;
simpl
;
try
done
.
apply
iProto_message_ne
;
simpl
;
try
done
;
intros
v
.
destruct
v
;
done
.
solve_proper
.
Qed
.
Qed
.
Global
Instance
lsty_
branch
_contractive
n
:
Global
Instance
lsty_
choice
_contractive
n
a
:
Proper
(
dist_later
n
==>
dist_later
n
==>
dist
n
)
(
@
lsty_
branch
Σ
)
.
Proper
(
dist_later
n
==>
dist
n
)
(
@
lsty_
choice
Σ
a
)
.
Proof
.
Proof
.
intros
A
A'
H1
P
P'
H2
.
intros
Ps1
Ps2
Pseq
.
rewrite
/
lsty_branch
.
apply
Lsty_ne
.
apply
Lsty_ne
.
apply
iProto_message_contractive
;
simpl
;
try
done
.
apply
iProto_message_contractive
;
simpl
;
try
done
;
intros
v
.
destruct
n
=>
//=
;
solve_proper
.
destruct
v
;
destruct
n
as
[|
n
];
try
done
.
Qed
.
Qed
.
Global
Instance
lsty_select_ne
:
NonExpansive2
(
@
lsty_select
Σ
)
.
Global
Instance
lsty_select_ne
:
NonExpansive
(
@
lsty_select
Σ
)
.
Proof
.
Proof
.
solve_proper
.
Qed
.
intros
n
A
A'
H1
P
P'
H2
.
rewrite
/
lsty_select
.
apply
Lsty_ne
.
apply
iProto_message_ne
;
simpl
;
try
done
.
intros
v
.
destruct
v
;
done
.
Qed
.
Global
Instance
lsty_select_contractive
n
:
Global
Instance
lsty_select_contractive
n
:
Proper
(
dist_later
n
==>
dist_later
n
==>
dist
n
)
(
@
lsty_select
Σ
)
.
Proper
(
dist_later
n
==>
dist
n
)
(
@
lsty_select
Σ
)
.
Proof
.
Proof
.
solve_contractive
.
Qed
.
intros
A
A'
H1
P
P'
H2
.
rewrit
e
/
lsty_
select
.
Global
Instanc
e
lsty_
branch_ne
:
NonExpansive
(
@
lsty_branch
Σ
)
.
apply
Lsty_ne
.
Proof
.
solve_proper
.
Qed
.
apply
iProto_message_contractive
;
simpl
;
try
done
.
intros
v
.
Global
Instance
lsty_branch_contractive
n
:
destruct
v
;
destruct
n
as
[|
n
];
try
done
.
Proper
(
dist_later
n
==>
dist
n
)
(
@
lsty_branch
Σ
)
.
Qed
.
Proof
.
solve_contractive
.
Qed
.
Global
Instance
lsty_dual_ne
:
NonExpansive
(
@
lsty_dual
Σ
)
.
Global
Instance
lsty_dual_ne
:
NonExpansive
(
@
lsty_dual
Σ
)
.
Proof
.
Proof
.
...
...
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