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
Model registry
Operate
Environments
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
Iris
Actris
Commits
c6253c6e
Commit
c6253c6e
authored
5 years ago
by
jihgfee
Browse files
Options
Downloads
Patches
Plain Diff
Updated list sort elem with top-level to receive comparison function
parent
b7823a4e
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/examples/list_sort_elem.v
+28
-1
28 additions, 1 deletion
theories/examples/list_sort_elem.v
with
28 additions
and
1 deletion
theories/examples/list_sort_elem.v
+
28
−
1
View file @
c6253c6e
...
...
@@ -47,8 +47,16 @@ Definition list_sort_elem_service : val :=
let
:
"x"
:=
(
if
:
recv
"c1"
then
recv
"c1"
else
assert
#
false
)
in
list_sort_elem_service_merge
"cmp"
"c"
"x"
"c1"
"c2"
.
Definition
list_sort_elem_service_top
:
val
:=
λ
:
"c"
,
let
:
"cmp"
:=
recv
"c"
in
list_sort_elem_service
"cmp"
"c"
.
Section
list_sort_elem
.
Context
`{
!
heapG
Σ
,
!
proto_chanG
Σ
}
(
N
:
namespace
)
.
Section
list_sort_elem_inner
.
Context
{
A
}
(
I
:
A
→
val
→
iProp
Σ
)
(
R
:
relation
A
)
`{
!
RelDecision
R
,
!
Total
R
}
.
Definition
tail_protocol_aux
(
xs
:
list
(
A
*
val
))
...
...
@@ -78,7 +86,7 @@ Section list_sort_elem.
Proof
.
apply
proto_unfold_eq
,
(
fixpoint_unfold
head_protocol_aux
)
.
Qed
.
Definition
list_sort_elem_protocol
:
iProto
Σ
:=
head_protocol
[]
.
Lemma
list_sort_elem_service_split_spec
c
c1
c2
xs
xs1
xs2
:
{{{
c
↣
iProto_dual
(
head_protocol
xs
)
@
N
∗
...
...
@@ -211,4 +219,23 @@ Section list_sort_elem.
by
wp_apply
(
select_spec
with
"[$Hc]"
)
.
-
by
wp_apply
(
select_spec
with
"[$Hc]"
)
.
Qed
.
End
list_sort_elem_inner
.
Definition
list_sort_elem_top_protocol
:
iProto
Σ
:=
(
<!>
A
(
I
:
A
→
val
→
iProp
Σ
)
(
R
:
A
→
A
→
Prop
)
`{
!
RelDecision
R
,
!
Total
R
}
(
cmp
:
val
),
MSG
cmp
{{
cmp_spec
I
R
cmp
}};
head_protocol
I
R
[])
%
proto
.
Lemma
list_sort_elem_service_top_spec
c
:
{{{
c
↣
iProto_dual
list_sort_elem_top_protocol
@
N
}}}
list_sort_elem_service_top
c
{{{
RET
#
();
c
↣
END
@
N
}}}
.
Proof
.
iIntros
(
Ψ
)
"Hc HΨ"
.
wp_lam
.
wp_recv
(?
I
R
?
?
cmp
)
as
"#Hcmp"
.
wp_apply
(
list_sort_elem_service_spec
with
"Hcmp Hc"
)=>
//.
Qed
.
End
list_sort_elem
.
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