Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
lambda-rust
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
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
Simon Spies
lambda-rust
Commits
64751fcd
Commit
64751fcd
authored
8 years ago
by
Ralf Jung
Browse files
Options
Downloads
Patches
Plain Diff
prove lemma for non-deterministic CAS on locations
parent
9e5b4d6a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
theories/lang/derived.v
+1
-1
1 addition, 1 deletion
theories/lang/derived.v
theories/lang/heap.v
+24
-1
24 additions, 1 deletion
theories/lang/heap.v
with
25 additions
and
2 deletions
theories/lang/derived.v
+
1
−
1
View file @
64751fcd
...
@@ -78,7 +78,7 @@ Proof.
...
@@ -78,7 +78,7 @@ Proof.
iNext
.
iIntros
(??
Heval
)
.
inversion_clear
Heval
.
done
.
iNext
.
iIntros
(??
Heval
)
.
inversion_clear
Heval
.
done
.
Qed
.
Qed
.
(* TODO: Add lemmas for
remaining binary operators
. *)
(* TODO: Add lemmas for
equality test
. *)
Lemma
wp_if
E
(
b
:
bool
)
e1
e2
Φ
:
Lemma
wp_if
E
(
b
:
bool
)
e1
e2
Φ
:
(
if
b
then
▷
WP
e1
@
E
{{
Φ
}}
else
▷
WP
e2
@
E
{{
Φ
}})
%
I
-∗
(
if
b
then
▷
WP
e1
@
E
{{
Φ
}}
else
▷
WP
e2
@
E
{{
Φ
}})
%
I
-∗
...
...
This diff is collapsed.
Click to expand it.
theories/lang/heap.v
+
24
−
1
View file @
64751fcd
...
@@ -608,5 +608,28 @@ Section heap.
...
@@ -608,5 +608,28 @@ Section heap.
iNext
.
iExists
_,
hF
.
iFrame
.
eauto
using
heap_freeable_rel_stable
.
iNext
.
iExists
_,
hF
.
iFrame
.
eauto
using
heap_freeable_rel_stable
.
Qed
.
Qed
.
(* TODO: Add a lemma for non-deterministic CAS on locations. *)
Lemma
wp_cas_loc_nondet
E
l
l1
e2
l2
ll
:
↑
heapN
⊆
E
→
to_val
e2
=
Some
$
LitV
$
LitLoc
l2
→
{{{
heap_ctx
∗
▷
l
↦
(
LitV
$
LitLoc
ll
)
}}}
CAS
(
Lit
$
LitLoc
l
)
(
Lit
$
LitLoc
l1
)
e2
@
E
{{{
b
,
RET
LitV
$
lit_of_bool
b
;
if
b
is
true
then
l
↦
LitV
(
LitLoc
l2
)
else
⌜
l1
≠
ll
⌝
∗
l
↦
LitV
(
LitLoc
ll
)
}}}
.
Proof
.
iIntros
(?
<-%
of_to_val
?)
"[#Hinv >Hv] HΦ"
.
rewrite
/
heap_ctx
/
heap_inv
heap_mapsto_eq
/
heap_mapsto_def
.
iInv
heapN
as
(
σ
hF
)
">(Hσ & Hvalσ & HhF & %)"
"Hclose"
.
iDestruct
(
heap_mapsto_lookup_1
with
"Hvalσ Hv"
)
as
%
?
.
iApply
(
wp_cas_pst
with
"[$Hσ]"
);
eauto
.
{
destruct
(
decide
(
l1
=
ll
))
as
[
->
|
Hne
]
.
-
left
.
by
constructor
.
-
right
.
by
constructor
.
}
iNext
.
iIntros
([|])
.
-
iIntros
"[_ Hσ]"
.
iMod
(
heap_write_vs
with
"[$Hvalσ $Hv]"
)
as
"[Hvalσ Hv]"
;
first
done
.
iMod
(
"Hclose"
with
"[-Hv HΦ]"
);
last
by
iApply
"HΦ"
;
iFrame
.
iNext
.
iExists
_,
hF
.
iFrame
.
eauto
using
heap_freeable_rel_stable
.
-
iIntros
"[Hneq Hσ]"
.
iDestruct
"Hneq"
as
%
Hneq
.
inversion_clear
Hneq
.
iMod
(
"Hclose"
with
"[-Hv HΦ]"
);
last
by
iApply
(
"HΦ"
$!
false
);
iFrame
.
iNext
.
iExists
_,
hF
.
iFrame
.
eauto
using
heap_freeable_rel_stable
.
Qed
.
End
heap
.
End
heap
.
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