Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Iris
Iris
Commits
91cc6ffc
Commit
91cc6ffc
authored
May 15, 2020
by
Robbert Krebbers
Browse files
Test cases.
parent
9917cdfa
Changes
1
Hide whitespace changes
Inline
Sidebyside
Showing
1 changed file
with
17 additions
and
0 deletions
+17
0
tests/heap_lang.v
tests/heap_lang.v
+17
0
No files found.
tests/heap_lang.v
View file @
91cc6ffc
...
...
@@ 121,6 +121,23 @@ Section tests.
⊢
WP
let
:
"x"
:
=
Pred
#
42
in
Pred
"x"
@
E
[{
v
,
⌜
v
=
#
40
⌝
}].
Proof
.
iIntros
""
.
wp_apply
Pred_spec
.
by
wp_apply
Pred_spec
.
Qed
.
Definition
Id
:
val
:
=
rec
:
"go"
"x"
:
=
if
:
"x"
=
#
0
then
#()
else
"go"
(
"x"

#
1
).
(** These tests specially test the handling of the [vals_compare_safe]
sidecondition of the [=] operator. *)
Lemma
Id_wp
(
n
:
nat
)
:
⊢
WP
Id
#
n
{{
v
,
⌜
v
=
#()
⌝
}}.
Proof
.
iInduction
n
as
[
n
]
"IH"
;
wp_rec
;
wp_pures
;
first
done
.
by
replace
(
S
n

1
)
with
(
n
:
Z
)
by
lia
.
Qed
.
Lemma
Id_twp
(
n
:
nat
)
:
⊢
WP
Id
#
n
[{
v
,
⌜
v
=
#()
⌝
}].
Proof
.
iInduction
n
as
[
n
]
"IH"
;
wp_rec
;
wp_pures
;
first
done
.
by
replace
(
S
n

1
)
with
(
n
:
Z
)
by
lia
.
Qed
.
Lemma
wp_apply_evar
e
P
:
P

∗
(
∀
Q
Φ
,
Q

∗
WP
e
{{
Φ
}})

∗
WP
e
{{
_
,
True
}}.
Proof
.
iIntros
"HP HW"
.
wp_apply
"HW"
.
iExact
"HP"
.
Qed
.
...
...
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