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
f3ad9e36
Commit
f3ad9e36
authored
4 years ago
by
Jonas Kastberg
Browse files
Options
Downloads
Patches
Plain Diff
Added a typing example of a mapper client
parent
8e033d1a
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
theories/logrel/examples/mapper.v
+34
-2
34 additions, 2 deletions
theories/logrel/examples/mapper.v
with
34 additions
and
2 deletions
theories/logrel/examples/mapper.v
+
34
−
2
View file @
f3ad9e36
From
actris
.
channel
Require
Import
proofmode
proto
channel
.
From
actris
.
logrel
Require
Import
subtyping_rules
term_typing_judgment
term_typing_rules
environments
.
From
actris
.
logrel
Require
Import
subtyping_rules
term_typing_judgment
term_typing_rules
environments
operators
.
From
iris
.
proofmode
Require
Import
tactics
.
Section
with_Σ
.
Context
`{
heapG
Σ
,
chanG
Σ
}
.
Definition
mapper_client_type
:
lsty
Σ
:=
<!!>
TY
(
lty_int
⊸
lty_bool
);
<!!>
TY
lty_int
;
<
??
>
TY
lty_bool
;
END
.
Definition
mapper_client
:
expr
:=
λ
:
"c"
,
let
:
"f"
:=
send
"c"
(
λ
:
"x"
,
#
9000
<
"x"
)
in
let
:
"v"
:=
send
"c"
#
42
in
recv
"c"
.
Definition
mapper_service_type
:
lsty
Σ
:=
<
??
>
TY
(
lty_int
⊸
lty_bool
);
<
??
>
TY
lty_int
;
<!!>
TY
lty_bool
;
END
.
...
...
@@ -13,7 +21,31 @@ Section with_Σ.
let
:
"v"
:=
recv
"c"
in
send
"c"
(
"f"
"v"
);;
"c"
.
Lemma
mapper_typed
Γ
:
Lemma
mapper_client_typed
Γ
:
⊢
Γ
⊨
mapper_client
:
(
lty_chan
(
mapper_client_type
)
⊸
lty_bool
)
%
lty
⫤
Γ
.
Proof
.
iApply
(
ltyped_frame
_
_
_
_
Γ
)
.
{
iApply
env_split_id_l
.
}
2
:
{
iApply
env_split_id_l
.
}
iApply
ltyped_lam
.
iApply
ltyped_let
.
{
iApply
ltyped_send
.
apply
lookup_insert
.
iApply
(
ltyped_frame
_
_
_
_
{[
"c"
:=_]})
.
{
iApply
env_split_id_l
.
}
{
iApply
ltyped_lam
.
iApply
ltyped_bin_op
.
-
iApply
ltyped_var
.
apply
lookup_insert
.
-
iApply
ltyped_int
.
}
{
iApply
env_split_id_l
.
}
}
rewrite
insert_insert
/=.
iApply
ltyped_let
.
{
iApply
ltyped_send
.
apply
lookup_insert
.
rewrite
insert_commute
=>
//.
iApply
ltyped_int
.
}
rewrite
insert_insert
/=
(
insert_commute
_
"v"
"c"
)
//.
iApply
ltyped_recv
.
apply
lookup_insert
.
Qed
.
Lemma
mapper_service_typed
Γ
:
⊢
Γ
⊨
mapper_service
:
(
lty_chan
(
mapper_service_type
)
⊸
(
lty_chan
END
))
%
lty
⫤
Γ
.
Proof
.
iApply
(
ltyped_frame
_
_
_
_
Γ
)
.
...
...
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