Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Iris
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
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
William Mansky
Iris
Commits
705bc223
Commit
705bc223
authored
6 years ago
by
Ralf Jung
Browse files
Options
Downloads
Patches
Plain Diff
test how WP prints when the code gets long
parent
bf0b4bd4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
tests/heap_lang.ref
+12
-0
12 additions, 0 deletions
tests/heap_lang.ref
tests/heap_lang.v
+11
-2
11 additions, 2 deletions
tests/heap_lang.v
theories/program_logic/weakestpre.v
+10
-10
10 additions, 10 deletions
theories/program_logic/weakestpre.v
with
33 additions
and
12 deletions
tests/heap_lang.ref
+
12
−
0
View file @
705bc223
...
...
@@ -18,3 +18,15 @@
--------------------------------------∗
WP #l <- #1 + #1;; ! #l @ E {{ v, ⌜v = #2⌝ }}
1 subgoal
Σ : gFunctors
H : heapG Σ
fun1, fun2, fun3 : expr
============================
--------------------------------------∗
WP let: "val1" := fun1 #() in
let: "val2" := fun2 "val1" in
let: "val3" := fun3 "val2" in if: "val1" = "val2" then "val" else "val3"
{{ _, True }}
This diff is collapsed.
Click to expand it.
tests/heap_lang.v
+
11
−
2
View file @
705bc223
...
...
@@ -5,7 +5,7 @@ From iris.heap_lang Require Import adequacy.
From
iris
.
heap_lang
Require
Import
proofmode
notation
.
Set
Default
Proof
Using
"Type"
.
Section
LiftingT
ests
.
Section
t
ests
.
Context
`{
heapG
Σ
}
.
Implicit
Types
P
Q
:
iProp
Σ
.
Implicit
Types
Φ
:
val
→
iProp
Σ
.
...
...
@@ -115,7 +115,16 @@ Section LiftingTests.
P
-∗
(
∀
Q
Φ
,
Q
-∗
WP
e
{{
Φ
}})
-∗
WP
e
{{
_,
True
}}
.
Proof
.
iIntros
"HP HW"
.
wp_apply
"HW"
.
iExact
"HP"
.
Qed
.
End
LiftingTests
.
Lemma
wp_print_long_expr
(
fun1
fun2
fun3
:
expr
)
:
True
-∗
WP
let
:
"val1"
:=
fun1
#
()
in
let
:
"val2"
:=
fun2
"val1"
in
let
:
"val3"
:=
fun3
"val2"
in
if
:
"val1"
=
"val2"
then
"val"
else
"val3"
{{
_,
True
}}
.
Proof
.
iIntros
"_"
.
Show
.
Abort
.
End
tests
.
Lemma
heap_e_adequate
σ
:
adequate
NotStuck
heap_e
σ
(
=
#
2
)
.
Proof
.
eapply
(
heap_adequacy
heapΣ
)=>
?
.
by
apply
heap_e_spec
.
Qed
.
This diff is collapsed.
Click to expand it.
theories/program_logic/weakestpre.v
+
10
−
10
View file @
705bc223
...
...
@@ -54,35 +54,35 @@ 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
.
format
"'[
hv
' 'WP' e '/' @ s ; E {{ Φ } } ']'"
)
:
bi_scope
.
Notation
"'WP' e @ E {{ Φ } }"
:=
(
wp
NotStuck
E
e
%
E
Φ
)
(
at
level
20
,
e
,
Φ
at
level
200
,
format
"'[' 'WP' e '/' @ E {{ Φ } } ']'"
)
:
bi_scope
.
format
"'[
hv
' 'WP' e '/' @ E {{ Φ } } ']'"
)
:
bi_scope
.
Notation
"'WP' e @ E ? {{ Φ } }"
:=
(
wp
MaybeStuck
E
e
%
E
Φ
)
(
at
level
20
,
e
,
Φ
at
level
200
,
format
"'[' 'WP' e '/' @ E ? {{ Φ } } ']'"
)
:
bi_scope
.
format
"'[
hv
' 'WP' e '/' @ E ? {{ Φ } } ']'"
)
:
bi_scope
.
Notation
"'WP' e {{ Φ } }"
:=
(
wp
NotStuck
⊤
e
%
E
Φ
)
(
at
level
20
,
e
,
Φ
at
level
200
,
format
"'[' 'WP' e '/' {{ Φ } } ']'"
)
:
bi_scope
.
format
"'[
hv
' 'WP' e '/' {{ Φ } } ']'"
)
:
bi_scope
.
Notation
"'WP' e ? {{ Φ } }"
:=
(
wp
MaybeStuck
⊤
e
%
E
Φ
)
(
at
level
20
,
e
,
Φ
at
level
200
,
format
"'[' 'WP' e '/' ? {{ Φ } } ']'"
)
:
bi_scope
.
format
"'[
hv
' 'WP' e '/' ? {{ Φ } } ']'"
)
:
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
"'[
hv
' '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
"'[
hv
' '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
"'[
hv
' '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
"'[
hv
' '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
"'[
hv
' 'WP' e '/' ? {{ v , Q } } ']'"
)
:
bi_scope
.
(* Texan triples *)
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