Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Iris
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
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
Gaëtan Gilbert
Iris
Commits
6e37f9db
Commit
6e37f9db
authored
1 year ago
by
Ralf Jung
Browse files
Options
Downloads
Patches
Plain Diff
improve comments in logatom example
parent
50495a4f
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
iris_heap_lang/lib/increment.v
+10
-3
10 additions, 3 deletions
iris_heap_lang/lib/increment.v
with
10 additions
and
3 deletions
iris_heap_lang/lib/increment.v
+
10
−
3
View file @
6e37f9db
...
@@ -24,9 +24,16 @@ Section increment_physical.
...
@@ -24,9 +24,16 @@ Section increment_physical.
⊢
<<
{
∀∀
(
v
:
Z
),
l
↦
#
v
}
>>
incr_phy
#
l
@
∅
<<
{
l
↦
#
(
v
+
1
)
|
RET
#
v
}
>>.
⊢
<<
{
∀∀
(
v
:
Z
),
l
↦
#
v
}
>>
incr_phy
#
l
@
∅
<<
{
l
↦
#
(
v
+
1
)
|
RET
#
v
}
>>.
Proof
.
Proof
.
iIntros
(
Φ
)
"AU"
.
iLöb
as
"IH"
.
wp_lam
.
iIntros
(
Φ
)
"AU"
.
iLöb
as
"IH"
.
wp_lam
.
(* [iMod] knows how to eliminate [AU] assertions. They are mask-changing
though so we first need to bind to make sure we have an atomic expression.
Out of the [AU], we then get the atomic precondition as well as the
closing updates. There's two closing updates, one to "abort" the update
and one to "commit"; in this case, we only need the "abort". *)
wp_bind
(
!
_)
%
E
.
iMod
"AU"
as
(
v
)
"[Hl [Hclose _]]"
.
wp_bind
(
!
_)
%
E
.
iMod
"AU"
as
(
v
)
"[Hl [Hclose _]]"
.
wp_load
.
iMod
(
"Hclose"
with
"Hl"
)
as
"AU"
.
iModIntro
.
wp_load
.
iMod
(
"Hclose"
with
"Hl"
)
as
"AU"
.
wp_pures
.
wp_bind
(
CmpXchg
_
_
_)
%
E
.
iMod
"AU"
as
(
w
)
"[Hl Hclose]"
.
iModIntro
.
wp_pures
.
(* As above, but this time we need both the "abort" and "commit" updates. *)
wp_bind
(
CmpXchg
_
_
_)
%
E
.
iMod
"AU"
as
(
w
)
"[Hl Hclose]"
.
destruct
(
decide
(
#
v
=
#
w
))
as
[[
=
->
]|
Hx
]
.
destruct
(
decide
(
#
v
=
#
w
))
as
[[
=
->
]|
Hx
]
.
-
wp_cmpxchg_suc
.
iDestruct
"Hclose"
as
"[_ Hclose]"
.
iMod
(
"Hclose"
with
"Hl"
)
as
"HΦ"
.
-
wp_cmpxchg_suc
.
iDestruct
"Hclose"
as
"[_ Hclose]"
.
iMod
(
"Hclose"
with
"Hl"
)
as
"HΦ"
.
iModIntro
.
wp_pures
.
done
.
iModIntro
.
wp_pures
.
done
.
...
@@ -60,7 +67,7 @@ Section increment.
...
@@ -60,7 +67,7 @@ Section increment.
awp_apply
load_spec
.
awp_apply
load_spec
.
(* Prove the atomic update for load *)
(* Prove the atomic update for load *)
(* To [iMod] a *mask-changing* update (like "AU"), we have to unfold
(* To [iMod] a *mask-changing* update (like "AU"), we have to unfold
[atomic_acc].
[atomic_acc]
in the goal
.
Note that non-mask-changing [iMod] and [iInv] would work here without
Note that non-mask-changing [iMod] and [iInv] would work here without
unfolding, i.e., an [AACC] in the goal supports eliminating
unfolding, i.e., an [AACC] in the goal supports eliminating
non-mask-changing updates and accessors but it does not support
non-mask-changing updates and accessors but it does not support
...
...
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