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
Lennard Gäher
Iris
Commits
333c3dba
Commit
333c3dba
authored
Mar 18, 2021
by
Ralf Jung
Browse files
heap_lang interpreter: fix build with Coq 8.11, and some style fixes
parent
000ec35e
Changes
1
Hide whitespace changes
Inline
Side-by-side
iris_staging/heap_lang/interpreter.v
View file @
333c3dba
...
@@ -50,6 +50,7 @@ issues before stabilization. *)
...
@@ -50,6 +50,7 @@ issues before stabilization. *)
*)
*)
From
stdpp
Require
Import
gmap
.
From
iris
.
heap_lang
Require
Export
lang
.
From
iris
.
heap_lang
Require
Export
lang
.
From
iris
.
heap_lang
Require
Import
tactics
pretty
.
From
iris
.
heap_lang
Require
Import
tactics
pretty
.
From
iris
.
prelude
Require
Import
options
.
From
iris
.
prelude
Require
Import
options
.
...
@@ -706,35 +707,36 @@ Section interpret_ok.
...
@@ -706,35 +707,36 @@ Section interpret_ok.
Qed
.
Qed
.
Lemma
state_wf_same_dom
s
f
:
Lemma
state_wf_same_dom
s
f
:
(
dom
(
gmap
.
gset
_
)
(
f
s
.(
lang_state
)).(
heap
)
=
dom
_
s
.(
lang_state
).(
heap
))
→
(
dom
(
gset
loc
)
(
f
s
.(
lang_state
)).(
heap
)
=
dom
_
s
.(
lang_state
).(
heap
))
→
state_wf
s
→
state_wf
s
→
state_wf
(
modify_lang_state
f
s
).
state_wf
(
modify_lang_state
f
s
).
Proof
.
Proof
.
intros
Hdom_eq
Hwf
.
intros
Hdom_eq
Hwf
.
constructor
;
rewrite
/
modify_lang_state
/=
=>
l
?.
constructor
;
rewrite
/
modify_lang_state
/=
=>
l
?.
apply
fin_map_dom
.
not_elem_of_dom
.
apply
(
fin_map_dom
.
not_elem_of_dom
(
D
:
=
gset
loc
))
.
rewrite
Hdom_eq
.
rewrite
Hdom_eq
.
apply
fin_map_dom
.
not_elem_of_dom
.
apply
fin_map_dom
.
not_elem_of_dom
.
apply
state_wf_holds
;
auto
.
apply
state_wf_holds
;
auto
.
Qed
.
Qed
.
Lemma
state_wf_upd
s
l
mv0
v'
:
Lemma
state_wf_upd
s
l
mv0
v'
:
state_wf
s
→
state_wf
s
→
heap
(
lang_state
s
)
!!
l
=
Some
mv0
→
heap
(
lang_state
s
)
!!
l
=
Some
mv0
→
state_wf
(
modify_lang_state
(
λ
σ
:
state
,
state_upd_heap
<[
l
:
=
v'
]>
σ
)
s
).
state_wf
(
modify_lang_state
(
λ
σ
:
state
,
state_upd_heap
<[
l
:
=
v'
]>
σ
)
s
).
Proof
.
Proof
.
intros
Hwf
Heq
.
intros
Hwf
Heq
.
apply
state_wf_same_dom
;
auto
.
apply
state_wf_same_dom
;
auto
.
rewrite
fin_map_dom
.
dom_insert_L
.
rewrite
fin_map_dom
.
dom_insert_L
.
apply
fin_map_dom
.
elem_of_dom_2
in
Heq
.
apply
(
fin_map_dom
.
elem_of_dom_2
(
D
:
=
gset
loc
))
in
Heq
.
set_solver
.
set_solver
.
Qed
.
Qed
.
Lemma
interpret_wf
fuel
:
∀
(
e
:
expr
)
s
v
s'
,
Lemma
interpret_wf
fuel
(
e
:
expr
)
s
v
s'
:
state_wf
s
→
state_wf
s
→
interpret
fuel
e
s
=
(
inl
v
,
s'
)
→
interpret
fuel
e
s
=
(
inl
v
,
s'
)
→
state_wf
s'
.
state_wf
s'
.
Proof
.
Proof
.
revert
e
s
v
s'
.
induction
fuel
as
[|
fuel
]
;
simpl
;
intros
e
s
v
s'
**
;
[
errored
|
].
induction
fuel
as
[|
fuel
]
;
simpl
;
intros
e
s
v
s'
**
;
[
errored
|
].
destruct
e
;
try
errored
;
success
;
eauto
;
destruct
e
;
try
errored
;
success
;
eauto
;
(
repeat
case_match
;
subst
;
try
errored
;
(
repeat
case_match
;
subst
;
try
errored
;
...
@@ -753,11 +755,12 @@ Section interpret_ok.
...
@@ -753,11 +755,12 @@ Section interpret_ok.
Local
Hint
Resolve
interpret_wf
:
core
.
Local
Hint
Resolve
interpret_wf
:
core
.
Lemma
interpret_sound
fuel
:
∀
e
s
v
s'
,
Lemma
interpret_sound
fuel
e
s
v
s'
:
state_wf
s
→
state_wf
s
→
interpret
fuel
e
s
=
(
inl
v
,
s'
)
→
interpret
fuel
e
s
=
(
inl
v
,
s'
)
→
rtc
erased_step
(
e
::
s
.(
forked_threads
),
s
.(
lang_state
))
(
Val
v
::
s'
.(
forked_threads
),
s'
.(
lang_state
)).
rtc
erased_step
(
e
::
s
.(
forked_threads
),
s
.(
lang_state
))
(
Val
v
::
s'
.(
forked_threads
),
s'
.(
lang_state
)).
Proof
.
Proof
.
revert
e
s
v
s'
.
induction
fuel
as
[|
fuel
]
;
simpl
;
intros
e
s
v
s'
**
;
[
errored
|
].
induction
fuel
as
[|
fuel
]
;
simpl
;
intros
e
s
v
s'
**
;
[
errored
|
].
destruct
e
;
try
errored
;
success
;
cbn
[
forked_threads
lang_state
]
;
destruct
e
;
try
errored
;
success
;
cbn
[
forked_threads
lang_state
]
;
repeat
match
goal
with
repeat
match
goal
with
...
...
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