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
George Pirlea
Iris
Commits
51afb8bd
Commit
51afb8bd
authored
Jun 14, 2018
by
Ralf Jung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix newlines being inserted in bad places for WP
parent
a85a8e2f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
23 deletions
+40
-23
tests/heap_lang.v
tests/heap_lang.v
+22
-0
theories/program_logic/weakestpre.v
theories/program_logic/weakestpre.v
+18
-23
No files found.
tests/heap_lang.v
View file @
51afb8bd
...
...
@@ -119,6 +119,10 @@ End tests.
Section
printing_tests
.
Context
`
{
heapG
Σ
}.
(* These terms aren't even closed, but that's not what this is about. The
length of the variable names etc. has been carefully chosen to trigger
particular behavior of the Coq pretty printer. *)
Lemma
wp_print_long_expr
(
fun1
fun2
fun3
:
expr
)
:
True
-
∗
WP
let
:
"val1"
:
=
fun1
#()
in
let
:
"val2"
:
=
fun2
"val1"
in
...
...
@@ -128,6 +132,24 @@ Section printing_tests.
iIntros
"_"
.
Show
.
Abort
.
Lemma
wp_print_long_expr
(
fun1
fun2
fun3
:
expr
)
Φ
:
True
-
∗
WP
let
:
"val1"
:
=
fun1
#()
in
let
:
"val2"
:
=
fun2
"val1"
in
let
:
"v"
:
=
fun3
"v"
in
if
:
"v"
=
"v"
then
"v"
else
"v"
{{
Φ
}}.
Proof
.
iIntros
"_"
.
Show
.
Abort
.
Lemma
wp_print_long_expr
(
fun1
fun2
fun3
:
expr
)
Φ
E
:
True
-
∗
WP
let
:
"val1"
:
=
fun1
#()
in
let
:
"val2"
:
=
fun2
"val1"
in
let
:
"v"
:
=
fun3
"v"
in
if
:
"v"
=
"v"
then
"v"
else
"v"
@
E
{{
Φ
}}.
Proof
.
iIntros
"_"
.
Show
.
Abort
.
Lemma
texan_triple_long_expr
(
fun1
fun2
fun3
:
expr
)
:
{{{
True
}}}
let
:
"val1"
:
=
fun1
#()
in
...
...
theories/program_logic/weakestpre.v
View file @
51afb8bd
...
...
@@ -53,53 +53,48 @@ Arguments wp {_ _ _} _ _ _%E _.
Instance
:
Params
(@
wp
)
6
.
Notation
"'WP' e @ s ; E {{ Φ } }"
:
=
(
wp
s
E
e
%
E
Φ
)
(
at
level
20
,
e
,
Φ
at
level
200
,
format
"'[' 'WP' e '/' @ s ; E {{ Φ } } ']'"
)
:
bi_scope
.
(
at
level
20
,
e
,
Φ
at
level
200
,
only
parsing
)
:
bi_scope
.
Notation
"'WP' e @ E {{ Φ } }"
:
=
(
wp
NotStuck
E
e
%
E
Φ
)
(
at
level
20
,
e
,
Φ
at
level
200
,
format
"'[' 'WP' e '/' @ E {{ Φ } } ']'"
)
:
bi_scope
.
(
at
level
20
,
e
,
Φ
at
level
200
,
only
parsing
)
:
bi_scope
.
Notation
"'WP' e @ E ? {{ Φ } }"
:
=
(
wp
MaybeStuck
E
e
%
E
Φ
)
(
at
level
20
,
e
,
Φ
at
level
200
,
format
"'[' 'WP' e '/' @ E ? {{ Φ } } ']'"
)
:
bi_scope
.
(
at
level
20
,
e
,
Φ
at
level
200
,
only
parsing
)
:
bi_scope
.
Notation
"'WP' e {{ Φ } }"
:
=
(
wp
NotStuck
⊤
e
%
E
Φ
)
(
at
level
20
,
e
,
Φ
at
level
200
,
format
"'[' 'WP' e '/' {{ Φ } } ']'"
)
:
bi_scope
.
(
at
level
20
,
e
,
Φ
at
level
200
,
only
parsing
)
:
bi_scope
.
Notation
"'WP' e ? {{ Φ } }"
:
=
(
wp
MaybeStuck
⊤
e
%
E
Φ
)
(
at
level
20
,
e
,
Φ
at
level
200
,
format
"'[' 'WP' e '/' ? {{ Φ } } ']'"
)
:
bi_scope
.
(
at
level
20
,
e
,
Φ
at
level
200
,
only
parsing
)
:
bi_scope
.
Notation
"'WP' e @ s ; E {{ v , Q } }"
:
=
(
wp
s
E
e
%
E
(
λ
v
,
Q
))
(
at
level
20
,
e
,
Q
at
level
200
,
format
"'[' 'WP' e '/' @ s ; E {{ v , Q } } ']'"
)
:
bi_scope
.
format
"'[' 'WP' e '/'
'[ '
@ s ; E {{ v , Q } }
']'
']'"
)
:
bi_scope
.
Notation
"'WP' e @ E {{ v , Q } }"
:
=
(
wp
NotStuck
E
e
%
E
(
λ
v
,
Q
))
(
at
level
20
,
e
,
Q
at
level
200
,
format
"'[' 'WP' e '/' @ E {{ v , Q } } ']'"
)
:
bi_scope
.
format
"'[' 'WP' e '/'
'[ '
@ E {{ v , Q } }
']'
']'"
)
:
bi_scope
.
Notation
"'WP' e @ E ? {{ v , Q } }"
:
=
(
wp
MaybeStuck
E
e
%
E
(
λ
v
,
Q
))
(
at
level
20
,
e
,
Q
at
level
200
,
format
"'[' 'WP' e '/' @ E ? {{ v , Q } } ']'"
)
:
bi_scope
.
format
"'[' 'WP' e '/'
'[ '
@ E ? {{ v , Q } }
']'
']'"
)
:
bi_scope
.
Notation
"'WP' e {{ v , Q } }"
:
=
(
wp
NotStuck
⊤
e
%
E
(
λ
v
,
Q
))
(
at
level
20
,
e
,
Q
at
level
200
,
format
"'[' 'WP' e '/' {{ v , Q } } ']'"
)
:
bi_scope
.
format
"'[' 'WP' e '/'
'[ '
{{ v , Q } }
']'
']'"
)
:
bi_scope
.
Notation
"'WP' e ? {{ v , Q } }"
:
=
(
wp
MaybeStuck
⊤
e
%
E
(
λ
v
,
Q
))
(
at
level
20
,
e
,
Q
at
level
200
,
format
"'[' 'WP' e '/' ? {{ v , Q } } ']'"
)
:
bi_scope
.
format
"'[' 'WP' e '/'
'[ '
? {{ v , Q } }
']'
']'"
)
:
bi_scope
.
(* Texan triples *)
Notation
"'{{{' P } } } e @ s ; E {{{ x .. y , 'RET' pat ; Q } } }"
:
=
(
□
∀
Φ
,
P
-
∗
▷
(
∀
x
,
..
(
∀
y
,
Q
-
∗
Φ
pat
%
V
)
..
)
-
∗
WP
e
@
s
;
E
{{
Φ
}})%
I
(
at
level
20
,
x
closed
binder
,
y
closed
binder
,
format
"'[hv' {{{ P } } } '/ ' e @ s ; E
'/'
{{{ x .. y , RET pat ; Q } } } ']'"
)
:
bi_scope
.
format
"'[hv' {{{ P } } } '/ ' e
'/'
@ s ; E {{{ x .. y , RET pat ; Q } } } ']'"
)
:
bi_scope
.
Notation
"'{{{' P } } } e @ E {{{ x .. y , 'RET' pat ; Q } } }"
:
=
(
□
∀
Φ
,
P
-
∗
▷
(
∀
x
,
..
(
∀
y
,
Q
-
∗
Φ
pat
%
V
)
..
)
-
∗
WP
e
@
E
{{
Φ
}})%
I
(
at
level
20
,
x
closed
binder
,
y
closed
binder
,
format
"'[hv' {{{ P } } } '/ ' e @ E
'/'
{{{ x .. y , RET pat ; Q } } } ']'"
)
:
bi_scope
.
format
"'[hv' {{{ P } } } '/ ' e
'/'
@ E {{{ x .. y , RET pat ; Q } } } ']'"
)
:
bi_scope
.
Notation
"'{{{' P } } } e @ E ? {{{ x .. y , 'RET' pat ; Q } } }"
:
=
(
□
∀
Φ
,
P
-
∗
▷
(
∀
x
,
..
(
∀
y
,
Q
-
∗
Φ
pat
%
V
)
..
)
-
∗
WP
e
@
E
?{{
Φ
}})%
I
(
at
level
20
,
x
closed
binder
,
y
closed
binder
,
format
"'[hv' {{{ P } } } '/ ' e @ E ?
'/'
{{{ x .. y , RET pat ; Q } } } ']'"
)
:
bi_scope
.
format
"'[hv' {{{ P } } } '/ ' e
'/'
@ E ? {{{ x .. y , RET pat ; Q } } } ']'"
)
:
bi_scope
.
Notation
"'{{{' P } } } e {{{ x .. y , 'RET' pat ; Q } } }"
:
=
(
□
∀
Φ
,
P
-
∗
▷
(
∀
x
,
..
(
∀
y
,
Q
-
∗
Φ
pat
%
V
)
..
)
-
∗
WP
e
{{
Φ
}})%
I
...
...
@@ -109,20 +104,20 @@ Notation "'{{{' P } } } e ? {{{ x .. y , 'RET' pat ; Q } } }" :=
(
□
∀
Φ
,
P
-
∗
▷
(
∀
x
,
..
(
∀
y
,
Q
-
∗
Φ
pat
%
V
)
..
)
-
∗
WP
e
?{{
Φ
}})%
I
(
at
level
20
,
x
closed
binder
,
y
closed
binder
,
format
"'[hv' {{{ P } } } '/ ' e
?
'/' {{{ x .. y , RET pat ; Q } } } ']'"
)
:
bi_scope
.
format
"'[hv' {{{ P } } } '/ ' e '/'
?
{{{ x .. y , RET pat ; Q } } } ']'"
)
:
bi_scope
.
Notation
"'{{{' P } } } e @ s ; E {{{ 'RET' pat ; Q } } }"
:
=
(
□
∀
Φ
,
P
-
∗
▷
(
Q
-
∗
Φ
pat
%
V
)
-
∗
WP
e
@
s
;
E
{{
Φ
}})%
I
(
at
level
20
,
format
"'[hv' {{{ P } } } '/ ' e @ s ; E
'/'
{{{ RET pat ; Q } } } ']'"
)
:
bi_scope
.
format
"'[hv' {{{ P } } } '/ ' e
'/'
@ s ; E {{{ RET pat ; Q } } } ']'"
)
:
bi_scope
.
Notation
"'{{{' P } } } e @ E {{{ 'RET' pat ; Q } } }"
:
=
(
□
∀
Φ
,
P
-
∗
▷
(
Q
-
∗
Φ
pat
%
V
)
-
∗
WP
e
@
E
{{
Φ
}})%
I
(
at
level
20
,
format
"'[hv' {{{ P } } } '/ ' e @ E
'/'
{{{ RET pat ; Q } } } ']'"
)
:
bi_scope
.
format
"'[hv' {{{ P } } } '/ ' e
'/'
@ E {{{ RET pat ; Q } } } ']'"
)
:
bi_scope
.
Notation
"'{{{' P } } } e @ E ? {{{ 'RET' pat ; Q } } }"
:
=
(
□
∀
Φ
,
P
-
∗
▷
(
Q
-
∗
Φ
pat
%
V
)
-
∗
WP
e
@
E
?{{
Φ
}})%
I
(
at
level
20
,
format
"'[hv' {{{ P } } } '/ ' e @ E ?
'/'
{{{ RET pat ; Q } } } ']'"
)
:
bi_scope
.
format
"'[hv' {{{ P } } } '/ ' e
'/'
@ E ? {{{ RET pat ; Q } } } ']'"
)
:
bi_scope
.
Notation
"'{{{' P } } } e {{{ 'RET' pat ; Q } } }"
:
=
(
□
∀
Φ
,
P
-
∗
▷
(
Q
-
∗
Φ
pat
%
V
)
-
∗
WP
e
{{
Φ
}})%
I
(
at
level
20
,
...
...
@@ -130,7 +125,7 @@ Notation "'{{{' P } } } e {{{ 'RET' pat ; Q } } }" :=
Notation
"'{{{' P } } } e ? {{{ 'RET' pat ; Q } } }"
:
=
(
□
∀
Φ
,
P
-
∗
▷
(
Q
-
∗
Φ
pat
%
V
)
-
∗
WP
e
?{{
Φ
}})%
I
(
at
level
20
,
format
"'[hv' {{{ P } } } '/ ' e
?
'/' {{{ RET pat ; Q } } } ']'"
)
:
bi_scope
.
format
"'[hv' {{{ P } } } '/ ' e '/'
?
{{{ RET pat ; Q } } } ']'"
)
:
bi_scope
.
(* Aliases for stdpp scope -- they inherit the levels and format from above. *)
Notation
"'{{{' P } } } e @ s ; E {{{ x .. y , 'RET' pat ; Q } } }"
:
=
...
...
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