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
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
Daniël Louwrink
lambda-rust
Commits
6291445a
Commit
6291445a
authored
5 years ago
by
Daniël Louwrink
Browse files
Options
Downloads
Patches
Plain Diff
prove wp_cas_loc_nondet
parent
57254a34
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
theories/lang/lifting.v
+28
-18
28 additions, 18 deletions
theories/lang/lifting.v
theories/lang/stbor/stbor_ghost.v
+9
-0
9 additions, 0 deletions
theories/lang/stbor/stbor_ghost.v
with
37 additions
and
18 deletions
theories/lang/lifting.v
+
28
−
18
View file @
6291445a
...
@@ -396,24 +396,34 @@ Proof.
...
@@ -396,24 +396,34 @@ Proof.
iApply
"HΦ"
.
iFrame
"Hl Hl' Hl1 Hstk"
.
iApply
"HΦ"
.
iFrame
"Hl Hl' Hl1 Hstk"
.
Qed
.
Qed
.
(* Lemma wp_cas_loc_nondet E l tg l1 tg1 e2 l2 tg2 ll tgl : *)
Lemma
wp_cas_loc_nondet
E
l
tg
l1
tg1
e2
l2
tg2
ll
tgl
q
gstk
:
(* IntoVal e2 (LitV $ LitLoc l2 tg2) → ↑stborN ⊆ E → *)
IntoVal
e2
(
LitV
$
LitLoc
l2
tg2
)
→
↑
stborN
⊆
E
→
(* {{{ ▷ l ↦ LitV (LitLoc ll tgl) }}} *)
ghost_grants_write
gstk
tg
-∗
(* CAS (Lit $ LitLoc l tg) (Lit $ LitLoc l1 tg1) e2 @ E *)
{{{
▷
l
↦
LitV
(
LitLoc
ll
tgl
)
∗
▷
stbor_active
l
q
gstk
}}}
(* {{{ b, RET LitV (lit_of_bool b); *)
CAS
(
Lit
$
LitLoc
l
tg
)
(
Lit
$
LitLoc
l1
tg1
)
e2
@
E
(* if b is true then l ↦ LitV (LitLoc l2 tg2) *)
{{{
b
,
RET
LitV
(
lit_of_bool
b
);
(* else ⌜l1 ≠ ll⌝ ∗ l ↦ LitV (LitLoc ll tgl) }}}. *)
if
b
is
true
then
l
↦
LitV
(
LitLoc
l2
tg2
)
∗
▷
stbor_active
l
q
gstk
(* Proof. *)
else
⌜
l1
≠
ll
⌝
∗
l
↦
LitV
(
LitLoc
ll
tgl
)
∗
▷
stbor_active
l
q
gstk
}}}
.
(* iIntros (<- Φ) ">Hv HΦ". *)
Proof
.
(* iApply wp_lift_atomic_head_step_no_fork; auto. *)
iIntros
(
<-
?)
"#Hgrantsw !>"
.
iIntros
(
Φ
)
"[>Hv >Hstk] HΦ"
.
(* iIntros ([σ1 stbor] ???) "[Hσ Hstbor]". iDestruct (heap_read_1 with "Hσ Hv") as %?. *)
iDestruct
(
ghost_grants_write_to_read
with
"Hgrantsw"
)
as
"#Hgrantsr"
.
(* iModIntro; iSplit; first (destruct (decide (ll = l1)) as [->|]; by eauto). *)
iApply
wp_lift_atomic_head_step_no_fork
;
auto
.
(* iNext; iIntros (v2 σ2 efs Hstep); inv_head_step; last lia. *)
iIntros
([
σ1
stbor
]
???)
"(Hσ & Hstbor & #BOR)"
.
(* - inv_lit. iModIntro; iSplit; [done|]; iFrame "Hσ Hstbor". *)
iDestruct
(
heap_read_1
with
"Hσ Hv"
)
as
%
?
.
(* iApply "HΦ"; simpl; auto. *)
iMod
(
stbor_inv_set
stbor
with
"BOR Hstbor"
)
as
"(Hctx & Hstbor & Hclose)"
;
first
done
.
(* - iMod (heap_write with "Hσ Hv") as "[$ Hv]". iFrame "Hstbor". *)
iDestruct
(
stbor_read_ctx_1
with
"Hgrantsr Hctx Hstk"
)
as
%
[?
Hstborstepr
]
.
(* iModIntro; iSplit; [done|]. iApply "HΦ"; iFrame. *)
iDestruct
(
stbor_write_ctx_1
with
"Hgrantsw Hctx Hstk"
)
as
%
[?
Hstborstepw
]
.
(* Qed. *)
iMod
(
"Hclose"
with
"Hctx"
)
as
"_"
.
iModIntro
;
iSplit
;
first
(
destruct
(
decide
(
ll
=
l1
))
as
[
->
|];
by
eauto
)
.
iNext
;
iIntros
(
v2
σ2
efs
Hstep
);
inv_head_step
;
last
lia
.
-
inv_lit
.
iMod
(
stbor_read
with
"BOR Hgrantsr Hstbor Hstk"
)
as
"[Hstbor Hstk]"
;
[
done
|
done
|]
.
iModIntro
;
iSplit
;
[
done
|];
iFrame
"Hσ Hstbor BOR"
.
iApply
"HΦ"
;
simpl
;
iFrame
"Hv Hstk"
;
auto
.
-
iMod
(
heap_write
with
"Hσ Hv"
)
as
"[$ Hv]"
.
iMod
(
stbor_write
with
"BOR Hgrantsw Hstbor Hstk"
)
as
"[Hstbor Hstk]"
;
[
done
|
done
|]
.
iFrame
"Hstbor BOR"
.
iModIntro
;
iSplit
;
[
done
|]
.
iApply
"HΦ"
;
iFrame
.
Qed
.
Lemma
wp_eq_loc
E
(
l1
:
loc
)
(
l2
:
loc
)
tg1
tg2
q1
q2
v1
v2
P
Φ
:
Lemma
wp_eq_loc
E
(
l1
:
loc
)
(
l2
:
loc
)
tg1
tg2
q1
q2
v1
v2
P
Φ
:
(
P
-∗
▷
l1
↦
{
q1
}
v1
)
→
(
P
-∗
▷
l1
↦
{
q1
}
v1
)
→
...
...
This diff is collapsed.
Click to expand it.
theories/lang/stbor/stbor_ghost.v
+
9
−
0
View file @
6291445a
...
@@ -308,6 +308,15 @@ Section defs.
...
@@ -308,6 +308,15 @@ Section defs.
Global
Instance
ghost_grants_read_pers
gstk
tg
:
Persistent
(
ghost_grants_read
gstk
tg
)
.
Global
Instance
ghost_grants_read_pers
gstk
tg
:
Persistent
(
ghost_grants_read
gstk
tg
)
.
Proof
.
induction
gstk
as
[|[|
|]];
apply
_
.
Qed
.
Proof
.
induction
gstk
as
[|[|
|]];
apply
_
.
Qed
.
Lemma
ghost_grants_write_to_read
tg
gstk
:
ghost_grants_write
gstk
tg
-∗
ghost_grants_read
gstk
tg
.
Proof
.
iIntros
"#Hwrite"
.
destruct
gstk
as
[|[|
|]
gstk
];
try
done
.
iLeft
.
iFrame
"Hwrite"
.
Qed
.
Lemma
ghost_grants_write_log
tg
gstk
stklog
:
Lemma
ghost_grants_write_log
tg
gstk
stklog
:
ghost_grants_write
gstk
tg
-∗
ghost_grants_write
gstk
tg
-∗
stbor_ghost_stack
stklog
gstk
-∗
stbor_ghost_stack
stklog
gstk
-∗
...
...
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