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
d800f42e
Commit
d800f42e
authored
9 years ago
by
Ralf Jung
Browse files
Options
Downloads
Patches
Plain Diff
port the testcase to use the heap.v
parent
b6b2f174
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
heap_lang/heap.v
+1
-0
1 addition, 0 deletions
heap_lang/heap.v
heap_lang/tests.v
+16
-22
16 additions, 22 deletions
heap_lang/tests.v
with
17 additions
and
22 deletions
heap_lang/heap.v
+
1
−
0
View file @
d800f42e
From
heap_lang
Require
Export
derived
.
From
program_logic
Require
Export
invariants
ghost_ownership
.
From
program_logic
Require
Import
ownership
auth
.
From
heap_lang
Require
Import
notation
.
Import
uPred
.
...
...
This diff is collapsed.
Click to expand it.
heap_lang/tests.v
+
16
−
22
View file @
d800f42e
(** This file is essentially a bunch of testcases. *)
From
program_logic
Require
Import
ownership
.
From
heap_lang
Require
Import
substitution
tactics
notation
.
From
heap_lang
Require
Import
substitution
tactics
heap
notation
.
Import
uPred
.
Module
LangTests
.
Section
LangTests
.
Definition
add
:=
(
'
21
+
'
21
)
%
L
.
Goal
∀
σ
,
prim_step
add
σ
(
'
42
)
σ
None
.
Proof
.
intros
;
do_step
done
.
Qed
.
...
...
@@ -21,36 +21,30 @@ Module LangTests.
Qed
.
End
LangTests
.
Module
LiftingTests
.
Context
{
Σ
:
iFunctor
}
.
Implicit
Types
P
:
iProp
heap_lang
Σ
.
Implicit
Types
Q
:
val
→
iProp
heap_lang
Σ
.
Section
LiftingTests
.
Context
{
Σ
:
iFunctor
G
}
(
HeapI
:
gid
)
`{
!
HeapInG
Σ
HeapI
}
.
Implicit
Types
P
:
iProp
G
heap_lang
Σ
.
Implicit
Types
Q
:
val
→
iProp
G
heap_lang
Σ
.
Definition
e
:
expr
:=
let
:
"x"
:=
ref
'
1
in
"x"
<-
!
"x"
+
'
1
;;
!
"x"
.
Goal
∀
σ
E
,
ownP
(
Σ
:=
Σ
)
σ
⊑
wp
E
e
(
λ
v
,
v
=
'
2
)
.
Goal
∀
γh
N
,
heap_ctx
HeapI
γh
N
⊑
wp
N
e
(
λ
v
,
v
=
'
2
)
.
Proof
.
move
=>
σ
E
.
rewrite
/
e
.
rewrite
-
(
wp_bindi
(
LetCtx
_
_))
-
wp_alloc_pst
//=.
apply
sep_intro_True_r
;
first
done
.
move
=>
γh
N
.
rewrite
/
e
.
rewrite
-
(
wp_bindi
(
LetCtx
_
_))
.
eapply
wp_alloc
;
eauto
;
[]
.
rewrite
-
later_intro
;
apply
forall_intro
=>
l
;
apply
wand_intro_l
.
rewrite
right_id
;
apply
const_elim_l
=>
_
.
rewrite
-
wp_let
//=
-
later_intro
.
rewrite
-
(
wp_bindi
(
SeqCtx
(
Load
(
Loc
_))))
/=.
rewrite
-
(
wp_bindi
(
StoreRCtx
(
LocV
_)))
/=.
rewrite
-
(
wp_bindi
(
BinOpLCtx
PlusOp
_))
/=.
rewrite
-
wp_load_pst
;
first
(
apply
sep_intro_True_r
;
first
done
);
last
first
.
{
by
rewrite
lookup_insert
.
}
(* RJ FIXME: figure out why apply and eapply fail. *)
rewrite
-
later_intro
;
apply
wand_intro_l
;
rewrite
right_id
.
eapply
wp_load
;
eauto
with
I
;
[]
.
apply
sep_mono
;
first
done
.
rewrite
-
later_intro
;
apply
wand_intro_l
.
rewrite
-
wp_bin_op
//
-
later_intro
.
rewrite
-
wp_store_pst
;
first
(
apply
sep_intro_True_r
;
first
done
);
last
first
.
{
by
rewrite
lookup_insert
.
}
{
done
.
}
rewrite
-
later_intro
.
apply
wand_intro_l
.
rewrite
right_id
.
eapply
wp_store
;
eauto
with
I
;
[]
.
apply
sep_mono
;
first
done
.
rewrite
-
later_intro
.
apply
wand_intro_l
.
rewrite
-
wp_seq
-
wp_value'
-
later_intro
.
rewrite
-
wp_load_pst
;
first
(
apply
sep_intro_True_r
;
first
done
);
last
first
.
{
by
rewrite
lookup_insert
.
}
rewrite
-
later_intro
.
apply
wand_intro_l
.
rewrite
right_id
.
eapply
wp_load
;
eauto
with
I
;
[]
.
apply
sep_mono
;
first
done
.
rewrite
-
later_intro
.
apply
wand_intro_l
.
by
apply
const_intro
.
Qed
.
...
...
@@ -106,7 +100,7 @@ Module LiftingTests.
Qed
.
Goal
∀
E
,
True
⊑
wp
(
Σ
:=
Σ
)
E
(
let
:
"x"
:=
Pred
'
42
in
Pred
"x"
)
(
λ
v
,
v
=
'
40
)
.
True
⊑
wp
(
Σ
:=
globalF
Σ
)
E
(
let
:
"x"
:=
Pred
'
42
in
Pred
"x"
)
(
λ
v
,
v
=
'
40
)
.
Proof
.
intros
E
.
rewrite
-
(
wp_bindi
(
LetCtx
_
_))
-
Pred_spec
//=
-
wp_let'
//=.
...
...
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