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
Iris
Iris
Commits
4cc3a7e0
Commit
4cc3a7e0
authored
Jan 21, 2016
by
Ralf Jung
Browse files
use nice record syntax to instantiate language
parent
13fdd51e
Changes
2
Hide whitespace changes
Inline
Side-by-side
barrier/heap_lang.v
View file @
4cc3a7e0
...
...
@@ -406,19 +406,26 @@ Section Language.
Definition
ectx_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
ectx_step
.
Proof
.
-
exact
v2v
.
-
exact
e2e
.
-
intros
e1
σ
1 e2
σ
2
ef
(
K
&
e1'
&
e2'
&
He1
&
He2
&
Hstep
).
subst
e1
e2
.
eapply
fill_not_value
.
eapply
reducible_not_value
.
do
4
eexists
;
eassumption
.
-
exact
atomic_not_value
.
-
intros
?
?
?
?
?
Hatomic
(
K
&
e1'
&
e2'
&
Heq1
&
Heq2
&
Hstep
).
subst
.
move
:
(
Hatomic
).
rewrite
(
atomic_fill
e1'
K
).
(* RJ: this is kind of annoying. *)
+
rewrite
!
fill_empty
.
eauto
using
atomic_step
.
+
assumption
.
+
clear
Hatomic
.
eapply
reducible_not_value
.
do
4
eexists
;
eassumption
.
Defined
.
Program
Instance
heap_lang
:
Language
expr
value
state
:
=
{|
of_val
:
=
v2e
;
to_val
:
=
e2v
;
language
.
atomic
:
=
atomic
;
language
.
prim_step
:
=
ectx_step
;
to_of_val
:
=
v2v
;
of_to_val
:
=
e2e
;
language
.
atomic_not_value
:
=
atomic_not_value
|}.
Next
Obligation
.
intros
e1
σ
1 e2
σ
2
ef
(
K
&
e1'
&
e2'
&
He1
&
He2
&
Hstep
).
subst
e1
e2
.
eapply
fill_not_value
.
eapply
reducible_not_value
.
do
4
eexists
;
eassumption
.
Qed
.
Next
Obligation
.
intros
?
?
?
?
?
Hatomic
(
K
&
e1'
&
e2'
&
Heq1
&
Heq2
&
Hstep
).
subst
.
move
:
(
Hatomic
).
rewrite
(
atomic_fill
e1'
K
).
-
rewrite
!
fill_empty
.
eauto
using
atomic_step
.
-
assumption
.
-
clear
Hatomic
.
eapply
reducible_not_value
.
do
4
eexists
;
eassumption
.
Qed
.
(** We can have bind with arbitrary evaluation contexts **)
Lemma
fill_is_ctx
K
:
is_ctx
(
fill
K
).
...
...
iris/language.v
View file @
4cc3a7e0
...
...
@@ -14,7 +14,6 @@ Class Language (E V St : Type) := {
prim_step
e1
σ
1 e2
σ
2
ef
→
is_Some
(
to_val
e2
)
}.
Arguments
Build_Language
{
_
_
_
}
_
_
_
_
{
_
_
_
_
_
}.
Section
language
.
Context
`
{
Language
E
V
St
}.
...
...
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