Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Marianna Rapoport
iris-coq
Commits
199d205a
Commit
199d205a
authored
Apr 27, 2018
by
Robbert Krebbers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix #184.
parent
e53c497d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
1 deletion
+7
-1
theories/heap_lang/lang.v
theories/heap_lang/lang.v
+2
-1
theories/tests/heap_lang.v
theories/tests/heap_lang.v
+5
-0
No files found.
theories/heap_lang/lang.v
View file @
199d205a
...
...
@@ -351,10 +351,11 @@ Definition bin_op_eval_bool (op : bin_op) (b1 b2 : bool) : option base_lit :=
end
.
Definition
bin_op_eval
(
op
:
bin_op
)
(
v1
v2
:
val
)
:
option
val
:
=
if
decide
(
op
=
EqOp
)
then
Some
$
LitV
$
LitBool
$
bool_decide
(
v1
=
v2
)
else
match
v1
,
v2
with
|
LitV
(
LitInt
n1
),
LitV
(
LitInt
n2
)
=>
Some
$
LitV
$
bin_op_eval_int
op
n1
n2
|
LitV
(
LitBool
b1
),
LitV
(
LitBool
b2
)
=>
LitV
<$>
bin_op_eval_bool
op
b1
b2
|
v1
,
v2
=>
guard
(
op
=
EqOp
)
;
Some
$
LitV
$
LitBool
$
bool_decide
(
v1
=
v2
)
|
_
,
_
=>
None
end
.
Inductive
head_step
:
expr
→
state
→
expr
→
state
→
list
(
expr
)
→
Prop
:
=
...
...
theories/tests/heap_lang.v
View file @
199d205a
...
...
@@ -71,6 +71,11 @@ Section LiftingTests.
wp_load
.
wp_op
.
wp_faa
.
do
2
wp_load
.
wp_op
.
done
.
Qed
.
Definition
heap_e6
:
val
:
=
λ
:
"v"
,
"v"
=
"v"
.
Lemma
heap_e6_spec
(
v
:
val
)
:
(
WP
heap_e6
v
{{
w
,
⌜
w
=
#
true
⌝
}})%
I
.
Proof
.
wp_lam
.
wp_op
.
by
case_bool_decide
.
Qed
.
Definition
FindPred
:
val
:
=
rec
:
"pred"
"x"
"y"
:
=
let
:
"yp"
:
=
"y"
+
#
1
in
...
...
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