Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
examples
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Simon Friis Vindum
examples
Commits
8ca249fb
Commit
8ca249fb
authored
Apr 23, 2020
by
Simon Friis Vindum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use fractional pointers with extensional variable
parent
18fe6f53
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
143 additions
and
76 deletions
+143
-76
theories/logrel/F_mu_ref_conc/examples/queue/common.v
theories/logrel/F_mu_ref_conc/examples/queue/common.v
+34
-0
theories/logrel/F_mu_ref_conc/examples/queue/refinement.v
theories/logrel/F_mu_ref_conc/examples/queue/refinement.v
+84
-76
theories/logrel/F_mu_ref_conc/rules.v
theories/logrel/F_mu_ref_conc/rules.v
+25
-0
No files found.
theories/logrel/F_mu_ref_conc/examples/queue/common.v
View file @
8ca249fb
...
@@ -58,9 +58,43 @@ Section common.
...
@@ -58,9 +58,43 @@ Section common.
iIntros
.
iApply
(
own_update
with
"[$]"
).
by
apply
cmra_update_exclusive
.
iIntros
.
iApply
(
own_update
with
"[$]"
).
by
apply
cmra_update_exclusive
.
Qed
.
Qed
.
Lemma
mapsto_full_to_frac
l
v
:
l
↦ᵢ
v
-
∗
l
↦ᵢ
{-}
v
.
Proof
.
iIntros
.
by
iExists
_
.
Qed
.
Lemma
mapsto_full_to_frac_2
l
v
:
l
↦ᵢ
v
-
∗
l
↦ᵢ
{-}
v
∗
l
↦ᵢ
{-}
v
.
Proof
.
iIntros
.
iDestruct
(
mapsto_full_to_frac
with
"[$]"
)
as
"H"
.
iDestruct
(
mapsto_frac_duplicable
with
"H"
)
as
"[H1 H2]"
.
iFrame
.
Qed
.
Lemma
mapsto_full_to_frac_3
l
v
:
l
↦ᵢ
v
-
∗
(
l
↦ᵢ
{-}
v
∗
l
↦ᵢ
{-}
v
∗
l
↦ᵢ
{-}
v
).
Proof
.
iIntros
.
iDestruct
(
mapsto_full_to_frac_2
with
"[$]"
)
as
"[H1 H2]"
.
iDestruct
(
mapsto_frac_duplicable
with
"H2"
)
as
"[H2 H3]"
.
iFrame
.
Qed
.
Lemma
mapsto_agree_frac
l
q
v1
v2
:
l
↦ᵢ
{
q
}
v1
-
∗
l
↦ᵢ
{-}
v2
-
∗
⌜
v1
=
v2
⌝
.
Proof
.
iIntros
"P1"
.
iDestruct
1
as
(
q2
)
"P2"
.
iApply
(
mapsto_agree
with
"P1 P2"
).
Qed
.
Lemma
mapsto_agree_frac_frac
l
v1
v2
:
l
↦ᵢ
{-}
v1
-
∗
l
↦ᵢ
{-}
v2
-
∗
⌜
v1
=
v2
⌝
.
Proof
.
iDestruct
1
as
(
q1
)
"P1"
.
iDestruct
1
as
(
q2
)
"P2"
.
iApply
(
mapsto_agree
with
"P1 P2"
).
Qed
.
(* Maybe commit this upstream. *)
(* Maybe commit this upstream. *)
Lemma
mapsto_exclusive
l
v1
v2
q
:
l
↦ᵢ
v1
-
∗
l
↦ᵢ
{
q
}
v2
-
∗
False
.
Lemma
mapsto_exclusive
l
v1
v2
q
:
l
↦ᵢ
v1
-
∗
l
↦ᵢ
{
q
}
v2
-
∗
False
.
iIntros
"Hl1 Hl2"
.
iDestruct
(
mapsto_valid_2
with
"Hl1 Hl2"
)
as
%[]%
Qp_not_plus_q_ge_1
.
iIntros
"Hl1 Hl2"
.
iDestruct
(
mapsto_valid_2
with
"Hl1 Hl2"
)
as
%[]%
Qp_not_plus_q_ge_1
.
Qed
.
Qed
.
Lemma
mapsto_exclusive_frac
l
v1
v2
:
l
↦ᵢ
v1
-
∗
l
↦ᵢ
{-}
v2
-
∗
False
.
iIntros
"Hl1 Hl2"
.
iDestruct
"Hl2"
as
(
q
)
"Hl2"
.
iDestruct
(
mapsto_valid_2
with
"Hl1 Hl2"
)
as
%[]%
Qp_not_plus_q_ge_1
.
Qed
.
End
common
.
End
common
.
\ No newline at end of file
theories/logrel/F_mu_ref_conc/examples/queue/refinement.v
View file @
8ca249fb
This diff is collapsed.
Click to expand it.
theories/logrel/F_mu_ref_conc/rules.v
View file @
8ca249fb
...
@@ -24,6 +24,7 @@ Global Opaque iris_invG.
...
@@ -24,6 +24,7 @@ Global Opaque iris_invG.
Notation
"l ↦ᵢ{ q } v"
:
=
(
mapsto
(
L
:
=
loc
)
(
V
:
=
val
)
l
q
v
)
Notation
"l ↦ᵢ{ q } v"
:
=
(
mapsto
(
L
:
=
loc
)
(
V
:
=
val
)
l
q
v
)
(
at
level
20
,
q
at
level
50
,
format
"l ↦ᵢ{ q } v"
)
:
bi_scope
.
(
at
level
20
,
q
at
level
50
,
format
"l ↦ᵢ{ q } v"
)
:
bi_scope
.
Notation
"l ↦ᵢ v"
:
=
(
mapsto
(
L
:
=
loc
)
(
V
:
=
val
)
l
1
v
)
(
at
level
20
)
:
bi_scope
.
Notation
"l ↦ᵢ v"
:
=
(
mapsto
(
L
:
=
loc
)
(
V
:
=
val
)
l
1
v
)
(
at
level
20
)
:
bi_scope
.
Notation
"l ↦ᵢ{-} v"
:
=
(
∃
q
,
l
↦ᵢ
{
q
}
v
)%
I
(
at
level
20
,
format
"l ↦ᵢ{-} v"
)
:
bi_scope
.
Section
lang_rules
.
Section
lang_rules
.
Context
`
{
heapIG
Σ
}.
Context
`
{
heapIG
Σ
}.
...
@@ -74,6 +75,14 @@ Section lang_rules.
...
@@ -74,6 +75,14 @@ Section lang_rules.
iModIntro
;
iSplit
=>
//.
iFrame
.
by
iApply
"HΦ"
.
iModIntro
;
iSplit
=>
//.
iFrame
.
by
iApply
"HΦ"
.
Qed
.
Qed
.
Lemma
wp_load_frac
E
l
v
:
{{{
▷
l
↦ᵢ
{-}
v
}}}
Load
(
Loc
l
)
@
E
{{{
RET
v
;
l
↦ᵢ
{-}
v
}}}.
Proof
.
iIntros
(
Φ
)
">Hl HΦ"
.
iDestruct
"Hl"
as
(
q
)
"Hl"
.
iApply
(
wp_load
with
"Hl"
).
iNext
.
iIntros
"Hl"
.
iApply
"HΦ"
.
by
iExists
q
.
Qed
.
Lemma
wp_store
E
l
v'
e
v
:
Lemma
wp_store
E
l
v'
e
v
:
IntoVal
e
v
→
IntoVal
e
v
→
{{{
▷
l
↦ᵢ
v'
}}}
Store
(
Loc
l
)
e
@
E
{{{
▷
l
↦ᵢ
v'
}}}
Store
(
Loc
l
)
e
@
E
...
@@ -100,6 +109,16 @@ Section lang_rules.
...
@@ -100,6 +109,16 @@ Section lang_rules.
iModIntro
;
iSplit
=>
//.
iFrame
.
by
iApply
"HΦ"
.
iModIntro
;
iSplit
=>
//.
iFrame
.
by
iApply
"HΦ"
.
Qed
.
Qed
.
Lemma
wp_cas_fail_frac
E
l
v'
e1
v1
e2
v2
:
IntoVal
e1
v1
→
IntoVal
e2
v2
→
v'
≠
v1
→
{{{
▷
l
↦ᵢ
{-}
v'
}}}
CAS
(
Loc
l
)
e1
e2
@
E
{{{
RET
(
BoolV
false
)
;
l
↦ᵢ
{-}
v'
}}}.
Proof
.
iIntros
(<-
<-
?
Φ
)
">Hl HΦ"
.
iDestruct
"Hl"
as
(
q
)
"Hl"
.
iApply
(
wp_cas_fail
with
"Hl"
)
;
first
done
.
iNext
.
iIntros
"Hl"
.
iApply
"HΦ"
.
by
iExists
q
.
Qed
.
Lemma
wp_cas_suc
E
l
e1
v1
e2
v2
:
Lemma
wp_cas_suc
E
l
e1
v1
e2
v2
:
IntoVal
e1
v1
→
IntoVal
e2
v2
→
IntoVal
e1
v1
→
IntoVal
e2
v2
→
{{{
▷
l
↦ᵢ
v1
}}}
CAS
(
Loc
l
)
e1
e2
@
E
{{{
▷
l
↦ᵢ
v1
}}}
CAS
(
Loc
l
)
e1
e2
@
E
...
@@ -121,6 +140,12 @@ Section lang_rules.
...
@@ -121,6 +140,12 @@ Section lang_rules.
iNext
;
iIntros
(
v2
σ
2
efs
Hstep
)
;
inv_head_step
.
by
iFrame
.
iNext
;
iIntros
(
v2
σ
2
efs
Hstep
)
;
inv_head_step
.
by
iFrame
.
Qed
.
Qed
.
Lemma
mapsto_frac_duplicable
l
v
:
l
↦ᵢ
{-}
v
-
∗
l
↦ᵢ
{-}
v
∗
l
↦ᵢ
{-}
v
.
Proof
.
iIntros
"H"
;
iDestruct
"H"
as
(?)
"[Hl Hl']"
;
iSplitL
"Hl"
;
eauto
.
Qed
.
Local
Ltac
solve_exec_safe
:
=
intros
;
subst
;
do
3
eexists
;
econstructor
;
eauto
.
Local
Ltac
solve_exec_safe
:
=
intros
;
subst
;
do
3
eexists
;
econstructor
;
eauto
.
Local
Ltac
solve_exec_puredet
:
=
simpl
;
intros
;
by
inv_head_step
.
Local
Ltac
solve_exec_puredet
:
=
simpl
;
intros
;
by
inv_head_step
.
Local
Ltac
solve_pure_exec
:
=
Local
Ltac
solve_pure_exec
:
=
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment