Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
R
ReLoC-v1
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dan Frumin
ReLoC-v1
Commits
f1a8bd8d
Commit
f1a8bd8d
authored
Feb 01, 2018
by
Dan Frumin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleaner proof of the stack refinement
parent
7b1728ba
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
13 deletions
+10
-13
module_refinement.v
theories/examples/stack/module_refinement.v
+1
-1
refinement.v
theories/examples/stack/refinement.v
+4
-7
stack_rules.v
theories/examples/stack/stack_rules.v
+5
-5
No files found.
theories/examples/stack/module_refinement.v
View file @
f1a8bd8d
...
@@ -46,7 +46,7 @@ Section Mod_refinement.
...
@@ -46,7 +46,7 @@ Section Mod_refinement.
{
rewrite
/
prestack_owns
big_sepM_empty
fmap_empty
.
{
rewrite
/
prestack_owns
big_sepM_empty
fmap_empty
.
iFrame
"Hemp"
.
}
iFrame
"Hemp"
.
}
iMod
(
stack_owns_alloc
with
"[$Hoe $Histk]"
)
as
"[Hoe #Histk]"
.
iMod
(
stack_owns_alloc
with
"[$Hoe $Histk]"
)
as
"[Hoe #Histk]"
.
iAssert
(
preStackLink
γ
(
R
τ
i
)
(#
istk
,
FoldV
(
InjLV
#())))
with
"[Histk]"
as
"#HLK"
.
iAssert
(
preStackLink
γ
τ
i
(#
istk
,
FoldV
(
InjLV
#())))
with
"[Histk]"
as
"#HLK"
.
{
rewrite
preStackLink_unfold
.
{
rewrite
preStackLink_unfold
.
iExists
_
,
_.
iSplitR
;
simpl
;
trivial
.
iExists
_
,
_.
iSplitR
;
simpl
;
trivial
.
iFrame
"Histk"
.
iLeft
.
iSplit
;
trivial
.
}
iFrame
"Histk"
.
iLeft
.
iSplit
;
trivial
.
}
...
...
theories/examples/stack/refinement.v
View file @
f1a8bd8d
...
@@ -11,14 +11,11 @@ Section Stack_refinement.
...
@@ -11,14 +11,11 @@ Section Stack_refinement.
Implicit
Types
Δ
:
listC
D
.
Implicit
Types
Δ
:
listC
D
.
Import
lang
.
Import
lang
.
Program
Definition
R
(
τ
i
:
prodC
valC
valC
->
iProp
Σ
)
:=
λ
ne
ww
,
(
□
τ
i
ww
)
%
I
.
Next
Obligation
.
solve_proper
.
Qed
.
Definition
sinv
'
{
SPG
:
authG
Σ
stackUR
}
γ
τ
i
stk
stk
'
l
'
:
iProp
Σ
:=
Definition
sinv
'
{
SPG
:
authG
Σ
stackUR
}
γ
τ
i
stk
stk
'
l
'
:
iProp
Σ
:=
(
∃
(
istk
:
loc
)
v
h
,
(
prestack_owns
γ
h
)
(
∃
(
istk
:
loc
)
v
h
,
(
prestack_owns
γ
h
)
∗
stk
'
↦ₛ
v
∗
stk
'
↦ₛ
v
∗
stk
↦ᵢ
(
FoldV
#
istk
)
∗
stk
↦ᵢ
(
FoldV
#
istk
)
∗
preStackLink
γ
(
R
τ
i
)
(#
istk
,
v
)
∗
preStackLink
γ
τ
i
(#
istk
,
v
)
∗
l
'
↦ₛ
#
false
)
%
I
.
∗
l
'
↦ₛ
#
false
)
%
I
.
Context
`
{
stackG
Σ
}
.
Context
`
{
stackG
Σ
}
.
...
@@ -26,7 +23,7 @@ Section Stack_refinement.
...
@@ -26,7 +23,7 @@ Section Stack_refinement.
(
∃
(
istk
:
loc
)
v
h
,
(
stack_owns
h
)
(
∃
(
istk
:
loc
)
v
h
,
(
stack_owns
h
)
∗
stk
'
↦ₛ
v
∗
stk
'
↦ₛ
v
∗
stk
↦ᵢ
(
FoldV
#
istk
)
∗
stk
↦ᵢ
(
FoldV
#
istk
)
∗
StackLink
(
R
τ
i
)
(#
istk
,
v
)
∗
StackLink
τ
i
(#
istk
,
v
)
∗
l
↦ₛ
#
false
)
%
I
.
∗
l
↦ₛ
#
false
)
%
I
.
Lemma
sinv_unfold
τ
i
stk
stk
'
l
:
Lemma
sinv_unfold
τ
i
stk
stk
'
l
:
sinv
τ
i
stk
stk
'
l
=
sinv
'
stack_name
τ
i
stk
stk
'
l
.
sinv
τ
i
stk
stk
'
l
=
sinv
'
stack_name
τ
i
stk
stk
'
l
.
...
@@ -38,7 +35,7 @@ Section Stack_refinement.
...
@@ -38,7 +35,7 @@ Section Stack_refinement.
Lemma
FG_CG_push_refinement
N
st
st
'
(
τ
i
:
D
)
(
v
v
'
:
val
)
l
Γ
:
Lemma
FG_CG_push_refinement
N
st
st
'
(
τ
i
:
D
)
(
v
v
'
:
val
)
l
Γ
:
N
##
logrelN
→
N
##
logrelN
→
inv
N
(
sinv
τ
i
st
st
'
l
)
-
∗
(
R
τ
i
)
(
v
,
v
'
)
-
∗
inv
N
(
sinv
τ
i
st
st
'
l
)
-
∗
□
τ
i
(
v
,
v
'
)
-
∗
Γ
⊨
(
FG_push
$
/
(
LitV
(
Loc
st
)))
v
≤
log
≤
(
CG_locked_push
$
/
(
LitV
(
Loc
st
'
))
$
/
(
LitV
(
Loc
l
)))
v
'
:
TUnit
.
Γ
⊨
(
FG_push
$
/
(
LitV
(
Loc
st
)))
v
≤
log
≤
(
CG_locked_push
$
/
(
LitV
(
Loc
st
'
))
$
/
(
LitV
(
Loc
l
)))
v
'
:
TUnit
.
Proof
.
Proof
.
iIntros
(
?
)
"#Hinv #Hvv'"
.
iIntros
(
Δ
).
iIntros
(
?
)
"#Hinv #Hvv'"
.
iIntros
(
Δ
).
...
@@ -344,7 +341,7 @@ Section Full_refinement.
...
@@ -344,7 +341,7 @@ Section Full_refinement.
{
rewrite
/
stack_owns
/
prestack_owns
big_sepM_empty
fmap_empty
.
{
rewrite
/
stack_owns
/
prestack_owns
big_sepM_empty
fmap_empty
.
iFrame
"Hemp"
.
}
iFrame
"Hemp"
.
}
iMod
(
stack_owns_alloc
with
"[$Hoe $Histk]"
)
as
"[Hoe #Histk]"
.
iMod
(
stack_owns_alloc
with
"[$Hoe $Histk]"
)
as
"[Hoe #Histk]"
.
iAssert
(
StackLink
(
R
τ
i
)
(#
istk
,
FoldV
(
InjLV
Unit
)))
with
"[Histk]"
as
"#HLK"
.
iAssert
(
StackLink
τ
i
(#
istk
,
FoldV
(
InjLV
Unit
)))
with
"[Histk]"
as
"#HLK"
.
{
rewrite
StackLink_unfold
.
{
rewrite
StackLink_unfold
.
iExists
_
,
_.
iSplitR
;
simpl
;
trivial
.
iExists
_
,
_.
iSplitR
;
simpl
;
trivial
.
iFrame
"Histk"
.
iLeft
.
iSplit
;
trivial
.
}
iFrame
"Histk"
.
iLeft
.
iSplit
;
trivial
.
}
...
...
theories/examples/stack/stack_rules.v
View file @
f1a8bd8d
...
@@ -55,7 +55,7 @@ Section Rules_pre.
...
@@ -55,7 +55,7 @@ Section Rules_pre.
(
∃
(
l
:
loc
)
w
,
⌜
v
.1
=
#
l
⌝
∗
l
↦ˢᵗᵏ
w
∗
(
∃
(
l
:
loc
)
w
,
⌜
v
.1
=
#
l
⌝
∗
l
↦ˢᵗᵏ
w
∗
((
⌜
w
=
InjLV
#()
⌝
∧
⌜
v
.2
=
FoldV
(
InjLV
#())
⌝
)
∨
((
⌜
w
=
InjLV
#()
⌝
∧
⌜
v
.2
=
FoldV
(
InjLV
#())
⌝
)
∨
(
∃
y1
z1
y2
z2
,
⌜
w
=
InjRV
(
PairV
y1
(
FoldV
z1
))
⌝
∗
(
∃
y1
z1
y2
z2
,
⌜
w
=
InjRV
(
PairV
y1
(
FoldV
z1
))
⌝
∗
⌜
v
.2
=
FoldV
(
InjRV
(
PairV
y2
z2
))
⌝
∗
Q
(
y1
,
y2
)
∗
▷
P
(
z1
,
z2
))))
%
I
.
⌜
v
.2
=
FoldV
(
InjRV
(
PairV
y2
z2
))
⌝
∗
□
Q
(
y1
,
y2
)
∗
▷
P
(
z1
,
z2
))))
%
I
.
Solve
Obligations
with
solve_proper
.
Solve
Obligations
with
solve_proper
.
Global
Instance
StackLink_pre_contractive
Q
:
Contractive
(
preStackLink_pre
Q
).
Global
Instance
StackLink_pre_contractive
Q
:
Contractive
(
preStackLink_pre
Q
).
...
@@ -69,12 +69,12 @@ Section Rules_pre.
...
@@ -69,12 +69,12 @@ Section Rules_pre.
((
⌜
w
=
InjLV
#()
⌝
∧
⌜
v
.2
=
FoldV
(
InjLV
#())
⌝
)
∨
((
⌜
w
=
InjLV
#()
⌝
∧
⌜
v
.2
=
FoldV
(
InjLV
#())
⌝
)
∨
(
∃
y1
z1
y2
z2
,
⌜
w
=
InjRV
(
PairV
y1
(
FoldV
z1
))
⌝
(
∃
y1
z1
y2
z2
,
⌜
w
=
InjRV
(
PairV
y1
(
FoldV
z1
))
⌝
∗
⌜
v
.2
=
FoldV
(
InjRV
(
PairV
y2
z2
))
⌝
∗
⌜
v
.2
=
FoldV
(
InjRV
(
PairV
y2
z2
))
⌝
∗
Q
(
y1
,
y2
)
∗
▷
preStackLink
Q
(
z1
,
z2
))))
%
I
.
∗
□
Q
(
y1
,
y2
)
∗
▷
preStackLink
Q
(
z1
,
z2
))))
%
I
.
Proof
.
by
rewrite
{
1
}/
preStackLink
fixpoint_unfold
.
Qed
.
Proof
.
by
rewrite
{
1
}/
preStackLink
fixpoint_unfold
.
Qed
.
Global
Opaque
preStackLink
.
(
*
So
that
we
can
only
use
the
unfold
above
.
*
)
Global
Opaque
preStackLink
.
(
*
So
that
we
can
only
use
the
unfold
above
.
*
)
Global
Instance
preStackLink_persistent
(
Q
:
D
)
v
`
{
∀
vw
,
Persistent
(
Q
vw
)
}
:
Global
Instance
preStackLink_persistent
(
Q
:
D
)
v
:
Persistent
(
preStackLink
Q
v
).
Persistent
(
preStackLink
Q
v
).
Proof
.
Proof
.
rewrite
/
Persistent
.
rewrite
/
Persistent
.
...
@@ -166,10 +166,10 @@ Section Rules.
...
@@ -166,10 +166,10 @@ Section Rules.
((
⌜
w
=
InjLV
#()
⌝
∧
⌜
v
.2
=
FoldV
(
InjLV
#())
⌝
)
∨
((
⌜
w
=
InjLV
#()
⌝
∧
⌜
v
.2
=
FoldV
(
InjLV
#())
⌝
)
∨
(
∃
y1
z1
y2
z2
,
⌜
w
=
InjRV
(
PairV
y1
(
FoldV
z1
))
⌝
(
∃
y1
z1
y2
z2
,
⌜
w
=
InjRV
(
PairV
y1
(
FoldV
z1
))
⌝
∗
⌜
v
.2
=
FoldV
(
InjRV
(
PairV
y2
z2
))
⌝
∗
⌜
v
.2
=
FoldV
(
InjRV
(
PairV
y2
z2
))
⌝
∗
Q
(
y1
,
y2
)
∗
▷
StackLink
Q
(
z1
,
z2
))))
%
I
.
∗
□
Q
(
y1
,
y2
)
∗
▷
StackLink
Q
(
z1
,
z2
))))
%
I
.
Proof
.
by
rewrite
/
StackLink
preStackLink_unfold
.
Qed
.
Proof
.
by
rewrite
/
StackLink
preStackLink_unfold
.
Qed
.
Global
Instance
StackLink_persistent
(
Q
:
D
)
v
`
{
∀
vw
,
Persistent
(
Q
vw
)
}
:
Global
Instance
StackLink_persistent
(
Q
:
D
)
v
:
Persistent
(
StackLink
Q
v
).
Persistent
(
StackLink
Q
v
).
Proof
.
apply
_.
Qed
.
Proof
.
apply
_.
Qed
.
Global
Opaque
StackLink
.
Global
Opaque
StackLink
.
...
...
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