Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Pierre-Marie Pédrot
Iris
Commits
53741bf7
Commit
53741bf7
authored
Mar 15, 2016
by
Robbert Krebbers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Define Assert for heap_lang.
parent
0d981f42
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
0 deletions
+24
-0
_CoqProject
_CoqProject
+1
-0
heap_lang/assert.v
heap_lang/assert.v
+23
-0
No files found.
_CoqProject
View file @
53741bf7
...
...
@@ -87,6 +87,7 @@ heap_lang/spawn.v
heap_lang/par.v
heap_lang/tests.v
heap_lang/substitution.v
heap_lang/assert.v
barrier/barrier.v
barrier/specification.v
barrier/protocol.v
...
...
heap_lang/assert.v
0 → 100644
View file @
53741bf7
From
iris
.
heap_lang
Require
Export
derived
.
From
iris
.
heap_lang
Require
Import
wp_tactics
substitution
notation
.
Definition
Assert
{
X
}
(
e
:
expr
X
)
:
expr
X
:
=
if
:
e
then
#()
else
#
0
#
0
.
(* #0 #0 is unsafe *)
Instance
do_wsubst_assert
{
X
Y
}
x
es
(
H
:
X
`
included
`
x
::
Y
)
e
er
:
WSubst
x
es
H
e
er
→
WSubst
x
es
H
(
Assert
e
)
(
Assert
er
)
|
1
.
Proof
.
intros
;
red
.
by
rewrite
/
Assert
/
wsubst
-/
wsubst
;
f_equal
/=.
Qed
.
Instance
do_wexpr_assert
{
X
Y
}
(
H
:
X
`
included
`
Y
)
e
er
:
WExpr
H
e
er
→
WExpr
H
(
Assert
e
)
(
Assert
er
)
|
1
.
Proof
.
intros
;
red
.
by
rewrite
/
Assert
/
wexpr
-/
wexpr
;
f_equal
/=.
Qed
.
Lemma
wp_assert
{
Σ
}
(
Φ
:
val
→
iProp
heap_lang
Σ
)
:
▷
Φ
#()
⊢
WP
Assert
#
true
{{
Φ
}}.
Proof
.
by
rewrite
-
wp_if_true
-
wp_value
.
Qed
.
Lemma
wp_assert'
{
Σ
}
(
Φ
:
val
→
iProp
heap_lang
Σ
)
e
:
WP
e
{{
λ
v
,
v
=
#
true
∧
▷
Φ
#()
}}
⊢
WP
Assert
e
{{
Φ
}}.
Proof
.
rewrite
/
Assert
.
wp_focus
e
;
apply
wp_mono
=>
v
.
apply
uPred
.
const_elim_l
=>->.
apply
wp_assert
.
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