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
55e3a725
Commit
55e3a725
authored
4 years ago
by
Jonas Kastberg
Browse files
Options
Downloads
Patches
Plain Diff
Removed WIP file
parent
0b5bbd48
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/examples/map_swap.v
+0
-57
0 additions, 57 deletions
theories/examples/map_swap.v
with
0 additions
and
57 deletions
theories/examples/map_swap.v
deleted
100644 → 0
+
0
−
57
View file @
0b5bbd48
(** This file implements a distributed mapper service, a specification thereof,
and its proofs. *)
From
actris
.
channel
Require
Import
proofmode
.
From
iris
.
heap_lang
Require
Import
lib
.
spin_lock
.
From
actris
.
utils
Require
Import
llist
contribution
.
From
iris
.
algebra
Require
Import
gmultiset
.
(** * Correctness proofs of the distributed version *)
Class
mapG
Σ
A
`{
Countable
A
}
:=
{
map_contributionG
:>
contributionG
Σ
(
gmultisetUR
A
);
map_lockG
:>
lockG
Σ
;
}
.
Section
map
.
Context
`{
Countable
A
}
{
B
:
Type
}
.
Context
`{
!
heapG
Σ
,
!
chanG
Σ
,
!
mapG
Σ
A
}
.
Context
(
IA
:
A
→
val
→
iProp
Σ
)
(
IB
:
B
→
val
→
iProp
Σ
)
(
map
:
A
→
list
B
)
.
Local
Open
Scope
nat_scope
.
Implicit
Types
n
:
nat
.
Definition
map_spec
(
vmap
:
val
)
:
iProp
Σ
:=
(
∀
x
v
,
{{{
IA
x
v
}}}
vmap
v
{{{
l
,
RET
#
l
;
llist
IB
l
(
map
x
)
}}})
%
I
.
Definition
map_protocol_recv_aux
(
rec
:
gmultiset
A
-
d
>
iProto
Σ
)
:
gmultiset
A
-
d
>
iProto
Σ
:=
λ
X
,
(
if
decide
(
X
≠
∅
)
then
END
else
<!
x
(
l
:
loc
)
>
MSG
#
l
{{
⌜
x
∈
X
⌝
∗
llist
IB
l
(
map
x
)
}};
rec
(
X
∖
{[
x
]}))
%
proto
.
Instance
map_protocol_recv_aux_contractive
:
Contractive
map_protocol_recv_aux
.
Proof
.
solve_proper_prepare
.
f_equiv
.
solve_proto_contractive
.
Qed
.
Definition
map_protocol_recv
:=
fixpoint
map_protocol_recv_aux
.
Global
Instance
map_protocol_recv_unfold
X
:
ProtoUnfold
(
map_protocol_recv
X
)
(
map_protocol_recv_aux
map_protocol_recv
X
)
.
Proof
.
apply
proto_unfold_eq
,
(
fixpoint_unfold
map_protocol_recv_aux
)
.
Qed
.
Definition
map_protocol_aux
(
rec
:
nat
-
d
>
gmultiset
A
-
d
>
iProto
Σ
)
:
nat
-
d
>
gmultiset
A
-
d
>
iProto
Σ
:=
λ
n
X
,
let
rec
:
nat
→
gmultiset
A
→
iProto
Σ
:=
rec
in
(
if
n
is
0
then
map_protocol_recv
X
else
((
<
?x
v
>
MSG
v
{{
IA
x
v
}};
rec
n
(
X
⊎
{[
x
]}))
<
&
>
rec
(
pred
n
)
X
))
%
proto
.
Instance
map_protocol_aux_contractive
:
Contractive
map_protocol_aux
.
Proof
.
solve_proper_prepare
.
f_equiv
.
solve_proto_contractive
.
Qed
.
Definition
map_protocol
:=
fixpoint
map_protocol_aux
.
Global
Instance
map_protocol_unfold
n
X
:
ProtoUnfold
(
map_protocol
n
X
)
(
map_protocol_aux
map_protocol
n
X
)
.
Proof
.
apply
proto_unfold_eq
,
(
fixpoint_unfold
map_protocol_aux
)
.
Qed
.
Lemma
sub_proof
n
x
X
:
⊢
(
map_protocol
n
({[
x
]}
⊎
X
)
⊑
<
?
(
l
:
loc
)
>
MSG
#
l
{{
llist
IB
l
(
map
x
)
}}
;
map_protocol
n
X
)
%
proto
.
Proof
.
Admitted
.
End
map
.
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