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
901d37f7
Commit
901d37f7
authored
4 years ago
by
Jonas Kastberg
Browse files
Options
Downloads
Patches
Plain Diff
Lifted program reuse to mapper example
parent
75a90bac
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
_CoqProject
+1
-1
1 addition, 1 deletion
_CoqProject
theories/examples/subprotocols.v
+28
-10
28 additions, 10 deletions
theories/examples/subprotocols.v
with
29 additions
and
11 deletions
_CoqProject
+
1
−
1
View file @
901d37f7
...
...
@@ -17,8 +17,8 @@ theories/examples/sort_br_del.v
theories/examples/sort_fg.v
theories/examples/map.v
theories/examples/map_reduce.v
theories/examples/subprotocols.v
theories/examples/swap_mapper.v
theories/examples/subprotocols.v
theories/logrel/model.v
theories/logrel/telescopes.v
theories/logrel/subtyping.v
...
...
This diff is collapsed.
Click to expand it.
theories/examples/subprotocols.v
+
28
−
10
View file @
901d37f7
From
actris
.
channel
Require
Import
proofmode
proto
channel
.
From
iris
.
proofmode
Require
Import
tactics
.
From
actris
.
utils
Require
Import
llist
.
From
actris
.
examples
Require
Import
swap_mapper
.
Section
basics
.
Context
`{
heapG
Σ
,
chanG
Σ
}
.
...
...
@@ -26,25 +27,42 @@ Section basics.
Context
(
IU
:
U
->
val
->
iProp
Σ
)
.
Context
(
IUR
:
(
U
*
R
)
->
val
->
iProp
Σ
)
.
Context
(
IR
:
R
->
iProp
Σ
)
.
Context
(
f
:
T
->
U
)
.
Axiom
HIT
:
∀
v
t
r
,
ITR
(
t
,
r
)
v
-∗
IT
t
v
∗
IR
r
.
Axiom
HIU
:
∀
v
u
r
,
(
IU
u
v
∗
IR
r
)
-∗
IUR
(
u
,
r
)
v
.
Lemma
example
:
⊢
(
<!
(
v
:
val
)
(
t
:
T
)
>
MSG
v
{{
IT
t
v
}};
<
?
(
w
:
val
)
(
u
:
U
)
>
MSG
w
{{
IU
u
w
}};
END
)
⊑
(
<!
(
v
:
val
)
(
t
:
T
)
(
r
:
R
)
>
MSG
v
{{
ITR
(
t
,
r
)
v
}};
<
?
(
w
:
val
)
(
u
:
U
)
>
MSG
w
{{
IUR
(
u
,
r
)
w
}};
END
)
.
Lemma
example
prot
prot'
:
prot
⊑
prot'
-∗
(
<!
(
x
:
T
)
(
v
:
val
)
>
MSG
v
{{
IT
x
v
}};
<
?
(
w
:
val
)
>
MSG
w
{{
IU
(
f
x
)
w
}};
prot
)
⊑
(
<!
(
x
:
T
*
R
)
(
v
:
val
)
>
MSG
v
{{
ITR
x
v
}};
<
?
(
w
:
val
)
>
MSG
w
{{
IUR
(
f
x
.
1
,
x
.
2
)
w
}};
prot'
)
.
Proof
.
iIntros
(
v
t
r
)
"HTR"
.
iIntros
"Hprot"
([
t
r
]
v
)
"HTR"
.
iDestruct
(
HIT
with
"HTR"
)
as
"[HT HR]"
.
iExists
v
,
t
.
iFrame
"HT"
.
iExists
t
,
v
.
iFrame
"HT"
.
iModIntro
.
iIntros
(
w
u
)
"HU"
.
iIntros
(
w
)
"HU"
.
iDestruct
(
HIU
with
"[$HR $HU]"
)
as
"HUR"
.
iExists
w
,
u
.
iFrame
"HUR"
.
eauto
.
iExists
w
.
iFrame
"HUR"
.
iModIntro
.
iApply
"Hprot"
.
Qed
.
Lemma
mapper_prot_reuse_example
:
⊢
mapper_prot
IT
IU
f
⊑
mapper_prot
ITR
IUR
(
λ
tr
,
(
f
tr
.
1
,
tr
.
2
))
.
Proof
.
iLöb
as
"IH"
.
iEval
(
rewrite
/
mapper_prot
)
.
rewrite
(
fixpoint_unfold
(
mapper_prot_aux
IT
_
_))
.
rewrite
(
fixpoint_unfold
(
mapper_prot_aux
ITR
_
_))
.
rewrite
{
1
3
}
/
mapper_prot_aux
.
rewrite
/
iProto_choice
.
iIntros
(
b
)
.
iExists
(
b
)
.
destruct
b
=>
//.
iModIntro
.
iApply
example
.
iApply
"IH"
.
Qed
.
End
program_reuse
.
End
basics
.
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