Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
Iris
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Abel Nieto
Iris
Commits
51afb8bd
Commit
51afb8bd
authored
6 years ago
by
Ralf Jung
Browse files
Options
Downloads
Patches
Plain Diff
fix newlines being inserted in bad places for WP
parent
a85a8e2f
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
tests/heap_lang.v
+22
-0
22 additions, 0 deletions
tests/heap_lang.v
theories/program_logic/weakestpre.v
+18
-23
18 additions, 23 deletions
theories/program_logic/weakestpre.v
with
40 additions
and
23 deletions
tests/heap_lang.v
+
22
−
0
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
...
...
This diff is collapsed.
Click to expand it.
theories/program_logic/weakestpre.v
+
18
−
23
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 } } }"
:=
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment