Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Joshua Yanovski
iris-coq
Commits
8f25b2f2
Commit
8f25b2f2
authored
Feb 03, 2016
by
Ralf Jung
Browse files
add a version of bind for ectx items
parent
b7401c68
Changes
3
Hide whitespace changes
Inline
Side-by-side
heap_lang/heap_lang.v
View file @
8f25b2f2
...
...
@@ -313,3 +313,10 @@ Proof.
exists
(
heap_lang
.
fill
K
'
e2
''
);
rewrite
heap_lang
.
fill_app
;
split
;
auto
.
econstructor
;
eauto
.
Qed
.
Global
Instance
heap_lang_ctx_item
Ki
:
LanguageCtx
heap_lang
(
heap_lang
.
fill_item
Ki
).
Proof
.
change
(
LanguageCtx
heap_lang
(
heap_lang
.
fill
[
Ki
])).
by
apply
_.
Qed
.
heap_lang/lifting.v
View file @
8f25b2f2
...
...
@@ -13,7 +13,11 @@ Implicit Types K : ectx.
(
**
Bind
.
*
)
Lemma
wp_bind
{
E
e
}
K
Q
:
wp
E
e
(
λ
v
,
wp
E
(
fill
K
(
of_val
v
))
Q
)
⊑
wp
E
(
fill
K
e
)
Q
.
Proof
.
apply
wp_bind
.
Qed
.
Proof
.
apply
weakestpre
.
wp_bind
.
Qed
.
Lemma
wp_bindi
{
E
e
}
Ki
Q
:
wp
E
e
(
λ
v
,
wp
E
(
fill_item
Ki
(
of_val
v
))
Q
)
⊑
wp
E
(
fill_item
Ki
e
)
Q
.
Proof
.
apply
weakestpre
.
wp_bind
.
Qed
.
(
**
Base
axioms
for
core
primitives
of
the
language
:
Stateful
reductions
.
*
)
Lemma
wp_alloc_pst
E
σ
e
v
Q
:
...
...
heap_lang/tests.v
View file @
8f25b2f2
...
...
@@ -34,9 +34,9 @@ Module LiftingTests.
rewrite
-
later_intro
.
apply
forall_intro
=>
l
.
apply
wand_intro_l
.
rewrite
right_id
.
apply
const_elim_l
;
move
=>
_.
rewrite
-
later_intro
.
asimpl
.
rewrite
-
(
wp_bind
[
SeqCtx
(
Load
(
Loc
_
))
]
).
rewrite
-
(
wp_bind
[
StoreRCtx
(
LocV
_
)
]
).
rewrite
-
(
wp_bind
[
PlusLCtx
_
]
).
rewrite
-
(
wp_bind
i
(
SeqCtx
(
Load
(
Loc
_
))
)
).
rewrite
-
(
wp_bind
i
(
StoreRCtx
(
LocV
_
)
)
).
rewrite
-
(
wp_bind
i
(
PlusLCtx
_
)
).
rewrite
-
wp_load_pst
;
first
(
apply
sep_intro_True_r
;
first
done
);
last
first
.
{
by
rewrite
lookup_insert
.
}
(
*
RJ
TODO
:
figure
out
why
apply
and
eapply
fail
.
*
)
rewrite
-
later_intro
.
apply
wand_intro_l
.
rewrite
right_id
.
...
...
@@ -75,7 +75,7 @@ Module LiftingTests.
(
*
Go
on
.
*
)
rewrite
-
(
wp_let
_
_
(
FindPred
'
(
LitNat
n1
)
(
Var
0
)
(
LitNat
n2
)
(
FindPred
$
LitNat
n2
))).
rewrite
-
wp_plus
.
asimpl
.
rewrite
-
(
wp_bind
[
CaseCtx
_
_
]
).
rewrite
-
(
wp_bind
i
(
CaseCtx
_
_
)
).
rewrite
-!
later_intro
/=
.
apply
wp_lt
;
intros
Hn12
.
*
(
*
TODO
RJ
:
It
would
be
better
if
we
could
use
wp_if_true
here
...
...
@@ -97,7 +97,7 @@ Module LiftingTests.
▷
Q
(
LitNatV
$
pred
n
)
⊑
wp
E
(
App
Pred
(
LitNat
n
))
Q
.
Proof
.
rewrite
-
wp_lam
//. asimpl.
rewrite
-
(
wp_bind
[
CaseCtx
_
_
]
).
rewrite
-
(
wp_bind
i
(
CaseCtx
_
_
)
).
apply
later_mono
,
wp_le
=>
Hn
.
-
rewrite
-
wp_case_inl
//.
rewrite
-!
later_intro
-
wp_value
'
//.
...
...
Write
Preview
Supports
Markdown
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