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
Tej Chajed
iris
Commits
ec27d524
Commit
ec27d524
authored
6 years ago
by
Ralf Jung
Browse files
Options
Downloads
Patches
Plain Diff
add test with a closed proof
parent
d04c9f7e
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
tests/one_shot.ref
+1
-0
1 addition, 0 deletions
tests/one_shot.ref
tests/one_shot.v
+34
-1
34 additions, 1 deletion
tests/one_shot.v
theories/algebra/ofe.v
+1
-0
1 addition, 0 deletions
theories/algebra/ofe.v
with
36 additions
and
1 deletion
tests/one_shot.ref
+
1
−
0
View file @
ec27d524
...
...
@@ -40,3 +40,4 @@
| InjR "m" => assert: #m = "m"
end {{ _, True }}
Closed under the global context
This diff is collapsed.
Click to expand it.
tests/one_shot.v
+
34
−
1
View file @
ec27d524
From
iris
.
program_logic
Require
Export
weakestpre
hoare
.
From
iris
.
heap_lang
Require
Export
lang
.
From
iris
.
algebra
Require
Import
excl
agree
csum
.
From
iris
.
heap_lang
Require
Import
assert
proofmode
notation
.
From
iris
.
heap_lang
Require
Import
assert
proofmode
notation
adequacy
.
From
iris
.
proofmode
Require
Import
tactics
.
From
iris
.
heap_lang
.
lib
Require
Import
par
.
Set
Default
Proof
Using
"Type"
.
Definition
one_shot_example
:
val
:=
λ
:
<>
,
...
...
@@ -95,3 +96,35 @@ Proof.
-
iIntros
"!# _"
.
wp_apply
(
wp_wand
with
"Hf2"
)
.
by
iIntros
(
v
)
"#? !# _"
.
Qed
.
End
proof
.
(* Have a client with a closed proof. *)
Definition
client
:
expr
:=
let
:
"ff"
:=
one_shot_example
#
()
in
(
Fst
"ff"
#
5
|||
let
:
"check"
:=
Snd
"ff"
#
()
in
"check"
#
())
.
Section
client
.
Local
Set
Default
Proof
Using
"Type*"
.
Context
`{
!
heapG
Σ
,
!
one_shotG
Σ
,
!
spawnG
Σ
}
.
Lemma
client_safe
:
WP
client
{{
_,
True
}}
%
I
.
Proof
.
rewrite
/
client
.
wp_apply
wp_one_shot
.
iIntros
(
f1
f2
)
"[#Hf1 #Hf2]"
.
wp_let
.
wp_apply
wp_par
.
-
wp_apply
"Hf1"
.
-
wp_proj
.
wp_bind
(
f2
_)
%
E
.
iApply
wp_wand
;
first
by
iExact
"Hf2"
.
iIntros
(
check
)
"Hcheck"
.
wp_pures
.
iApply
"Hcheck"
.
-
auto
.
Qed
.
End
client
.
(** Put together all library functors. *)
Definition
clientΣ
:
gFunctors
:=
#
[
heapΣ
;
one_shotΣ
;
spawnΣ
]
.
(** This lemma implicitly shows that these functors are enough to meet
all library assumptions. *)
Lemma
client_adequate
σ
:
adequate
NotStuck
client
σ
(
λ
_
_,
True
)
.
Proof
.
apply
(
heap_adequacy
clientΣ
)=>
?
.
apply
client_safe
.
Qed
.
(* Since we check the output of the test files, this means
our test suite will fail if we ever accidentally add an axiom
to anything used by this proof. *)
Print
Assumptions
client_adequate
.
This diff is collapsed.
Click to expand it.
theories/algebra/ofe.v
+
1
−
0
View file @
ec27d524
...
...
@@ -683,6 +683,7 @@ Bind Scope cFunctor_scope with cFunctor.
Class
cFunctorContractive
(
F
:
cFunctor
)
:=
cFunctor_contractive
A1
A2
B1
B2
:>
Contractive
(
@
cFunctor_map
F
A1
A2
B1
B2
)
.
Hint
Mode
cFunctorContractive
!
:
typeclass_instances
.
Definition
cFunctor_diag
(
F
:
cFunctor
)
(
A
:
ofeT
)
:
ofeT
:=
cFunctor_car
F
A
A
.
Coercion
cFunctor_diag
:
cFunctor
>->
Funclass
.
...
...
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