Skip to content
GitLab
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
8968f2c1
Commit
8968f2c1
authored
Jan 05, 2016
by
Ralf Jung
Browse files
show that evaluation contexts are 'contexts' in the sense required by bind
parent
65e7a75e
Changes
1
Hide whitespace changes
Inline
Side-by-side
channel/heap_lang.v
View file @
8968f2c1
...
...
@@ -176,7 +176,7 @@ Proof.
Qed
.
Lemma
fill_value
K
e
v
'
:
e2v
(
fill
K
e
)
=
Some
v
'
->
exists
v
,
e2v
e
=
Some
v
.
e2v
(
fill
K
e
)
=
Some
v
'
->
is_Some
(
e2v
e
)
.
Proof
.
revert
v
'
;
induction
K
=>
v
'
/=
;
try
discriminate
;
try
destruct
(
e2v
(
fill
K
e
));
rewrite
?
v2v
;
eauto
.
...
...
@@ -240,7 +240,7 @@ Section step_by_value.
expression
has
a
non
-
value
e
in
the
hole
,
then
K
is
a
left
sub
-
context
of
K
'
-
in
other
words
,
e
also
contains
the
reducible
expression
*
)
Lemma
step_by_value
K
K
'
e
e
'
:
Lemma
step_by_value
{
K
K
'
e
e
'
}
:
fill
K
e
=
fill
K
'
e
'
->
reducible
e
'
->
e2v
e
=
None
->
...
...
@@ -295,10 +295,10 @@ End Tests.
Section
Language
.
Local
Obligation
Tactic
:=
idtac
.
Definition
ctx_step
e1
σ
1
e2
σ
2
(
ef
:
option
expr
)
:=
Definition
e
ctx_step
e1
σ
1
e2
σ
2
(
ef
:
option
expr
)
:=
exists
K
e1
'
e2
'
,
e1
=
fill
K
e1
'
/
\
e2
=
fill
K
e2
'
/
\
prim_step
e1
'
σ
1
e2
'
σ
2
ef
.
Instance
heap_lang
:
Language
expr
value
state
:=
Build_Language
v2e
e2v
atomic
ctx_step
.
Instance
heap_lang
:
Language
expr
value
state
:=
Build_Language
v2e
e2v
atomic
e
ctx_step
.
Proof
.
-
exact
v2v
.
-
exact
e2e
.
...
...
@@ -308,5 +308,23 @@ Section Language.
eapply
e2e
.
eassumption
.
-
intros
.
contradiction
.
-
intros
.
contradiction
.
Defined
.
(
**
We
can
have
bind
with
arbitrary
evaluation
contexts
**
)
Lemma
fill_is_ctx
K
:
is_ctx
(
fill
K
).
Proof
.
split
;
last
split
.
-
intros
?
[
v
Hval
].
eapply
fill_value
.
eassumption
.
-
intros
?
?
?
?
?
(
K
'
&
e1
'
&
e2
'
&
Heq1
&
Heq2
&
Hstep
).
exists
(
comp_ctx
K
K
'
),
e1
'
,
e2
'
.
rewrite
-!
fill_comp
Heq1
Heq2
.
split
;
last
split
;
reflexivity
||
assumption
.
-
intros
?
?
?
?
?
Hnval
(
K
''
&
e1
''
&
e2
''
&
Heq1
&
Heq2
&
Hstep
).
destruct
(
step_by_value
Heq1
)
as
[
K
'
HeqK
].
+
do
4
eexists
.
eassumption
.
+
assumption
.
+
subst
e2
K
''
.
rewrite
-
fill_comp
in
Heq1
.
apply
fill_inj_r
in
Heq1
.
subst
e1
'
.
exists
(
fill
K
'
e2
''
).
split
;
first
by
rewrite
-
fill_comp
.
do
3
eexists
.
split
;
last
split
;
eassumption
||
reflexivity
.
Qed
.
End
Language
.
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment