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
2c2ed933
Commit
2c2ed933
authored
5 years ago
by
Robbert Krebbers
Browse files
Options
Downloads
Patches
Plain Diff
Tactic for solving contractiveness of protocols.
parent
4e90af7a
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
theories/channel/proto_channel.v
+14
-0
14 additions, 0 deletions
theories/channel/proto_channel.v
theories/examples/list_sort_elem.v
+2
-8
2 additions, 8 deletions
theories/examples/list_sort_elem.v
theories/examples/loop_sort.v
+1
-4
1 addition, 4 deletions
theories/examples/loop_sort.v
with
17 additions
and
12 deletions
theories/channel/proto_channel.v
+
14
−
0
View file @
2c2ed933
...
...
@@ -803,3 +803,17 @@ Section proto.
iIntros
"!>"
(
b
)
"Hc HP"
.
iApply
"HΨ"
.
iFrame
.
Qed
.
End
proto
.
Ltac
f_proto_contractive
:=
match
goal
with
|
_
=>
apply
iProto_branch_contractive
|
_
=>
apply
iProto_message_contractive
;
simpl
;
intros
;
[
reflexivity
|..]
|
H
:
_
≡
{
?n
}
≡
_
|
-
_
≡
{
?n'
}
≡
_
=>
apply
(
dist_le
n
);
[
apply
H
|
lia
]
end
;
try
match
goal
with
|
|
-
@
dist_later
?A
_
?n
?x
?y
=>
destruct
n
as
[|
n
];
simpl
in
*
;
[
exact
Logic
.
I
|
change
(
@
dist
A
_
n
x
y
)]
end
.
Ltac
solve_proto_contractive
:=
solve_proper_core
ltac
:(
fun
_
=>
first
[
f_contractive
|
f_proto_contractive
|
f_equiv
])
.
This diff is collapsed.
Click to expand it.
theories/examples/list_sort_elem.v
+
2
−
8
View file @
2c2ed933
...
...
@@ -57,10 +57,7 @@ Section list_sort_elem.
<
&
{
⌜
ys
≡
ₚ
xs
⌝
}
>
END
)
%
proto
.
Instance
tail_protocol_aux_contractive
xs
:
Contractive
(
tail_protocol_aux
xs
)
.
Proof
.
intros
n
p
p'
Hp
ys
.
apply
iProto_branch_ne
=>
//=.
apply
iProto_message_contractive
=>
x
//=.
destruct
n
as
[|
n
]=>
//=.
Qed
.
Proof
.
solve_proto_contractive
.
Qed
.
Definition
tail_protocol
(
xs
:
list
(
A
*
val
))
:
list
(
A
*
val
)
→
iProto
Σ
:=
fixpoint
(
tail_protocol_aux
xs
)
.
Global
Instance
tail_protocol_unfold
xs
ys
:
...
...
@@ -73,10 +70,7 @@ Section list_sort_elem.
<+>
tail_protocol
xs
[])
%
proto
.
Instance
head_protocol_aux_contractive
:
Contractive
head_protocol_aux
.
Proof
.
intros
n
p
p'
Hp
xs
.
apply
iProto_branch_ne
=>
//=.
apply
iProto_message_contractive
=>
//=
x
.
destruct
n
as
[|
n
]=>
//=.
Qed
.
Proof
.
solve_proto_contractive
.
Qed
.
Definition
head_protocol
:
list
(
A
*
val
)
→
iProto
Σ
:=
fixpoint
head_protocol_aux
.
Global
Instance
head_protocol_unfold
xs
:
...
...
This diff is collapsed.
Click to expand it.
theories/examples/loop_sort.v
+
1
−
4
View file @
2c2ed933
...
...
@@ -20,10 +20,7 @@ Section loop_sort.
((
sort_protocol
<++>
rec
)
<+>
((
<
?
>
c
,
MSG
c
{{
c
↣
rec
@
N
}};
rec
)
<+>
END
))
%
proto
.
Instance
loop_sort_protocol_aux_contractive
:
Contractive
loop_sort_protocol_aux
.
Proof
.
intros
n
p
p'
Hp
.
rewrite
/
loop_sort_protocol_aux
.
f_contractive
;
f_equiv
=>
//.
apply
iProto_message_ne
=>
c
/=
;
by
repeat
f_equiv
.
Qed
.
Proof
.
solve_proto_contractive
.
Qed
.
Definition
loop_sort_protocol
:
iProto
Σ
:=
fixpoint
loop_sort_protocol_aux
.
Global
Instance
loop_sort_protocol_unfold
:
ProtoUnfold
loop_sort_protocol
(
loop_sort_protocol_aux
loop_sort_protocol
)
.
...
...
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