Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
iris-coq
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
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
Amin Timany
iris-coq
Commits
bf42c065
Commit
bf42c065
authored
8 years ago
by
Robbert Krebbers
Browse files
Options
Downloads
Patches
Plain Diff
Repair tree_sum test case and add to _CoqProject.
parent
f96e229a
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
_CoqProject
+1
-0
1 addition, 0 deletions
_CoqProject
tests/tree_sum.v
+7
-8
7 additions, 8 deletions
tests/tree_sum.v
with
8 additions
and
8 deletions
_CoqProject
+
1
−
0
View file @
bf42c065
...
...
@@ -106,6 +106,7 @@ tests/joining_existentials.v
tests/proofmode.v
tests/barrier_client.v
tests/list_reverse.v
tests/tree_sum.v
proofmode/coq_tactics.v
proofmode/pviewshifts.v
proofmode/environments.v
...
...
This diff is collapsed.
Click to expand it.
tests/tree_sum.v
+
7
−
8
View file @
bf42c065
...
...
@@ -21,16 +21,15 @@ Fixpoint sum (t : tree) : Z :=
Definition
sum_loop
:
val
:=
rec
:
"sum_loop"
"t"
"l"
:=
match
:
'
"t"
with
InjL
"n"
=>
'
"l"
<-
'
"n"
+
!
'
"l"
|
InjR
"tt"
=>
'
"sum_loop"
!
(
Fst
'
"tt"
)
'
"l"
;;
'
"sum_loop"
!
(
Snd
'
"tt"
)
'
"l"
match
:
"t"
with
InjL
"n"
=>
"l"
<-
"n"
+
!
"l"
|
InjR
"tt"
=>
"sum_loop"
!
(
Fst
"tt"
)
"l"
;;
"sum_loop"
!
(
Snd
"tt"
)
"l"
end
.
Definition
sum'
:
val
:=
λ
:
"t"
,
let
:
"l"
:=
ref
#
0
in
^
sum_loop
'
"t"
'
"l"
;;
!
'
"l"
.
sum_loop
"t"
"l"
;;
!
"l"
.
Global
Opaque
sum_loop
sum'
.
...
...
@@ -40,12 +39,12 @@ Lemma sum_loop_wp `{!heapG Σ} heapN v t l (n : Z) (Φ : val → iPropG heap_lan
⊢
WP
sum_loop
v
#
l
{{
Φ
}}
.
Proof
.
iIntros
"(#Hh & Hl & Ht & HΦ)"
.
iLöb
{
v
t
l
n
Φ
}
as
"IH"
.
wp_rec
;
wp_let
.
iLöb
(
v
t
l
n
Φ
)
as
"IH"
.
wp_rec
.
wp_let
.
destruct
t
as
[
n'
|
tl
tr
];
simpl
in
*.
-
iDestruct
"Ht"
as
"%"
;
subst
.
wp_match
.
wp_load
.
wp_op
.
wp_store
.
by
iApply
(
"HΦ"
with
"Hl"
)
.
-
iDestruct
"Ht"
as
{
ll
lr
vl
vr
}
"(% & Hll & Htl & Hlr & Htr)"
;
subst
.
-
iDestruct
"Ht"
as
(
ll
lr
vl
vr
)
"(% & Hll & Htl & Hlr & Htr)"
;
subst
.
wp_match
.
wp_proj
.
wp_load
.
wp_apply
(
"IH"
with
"Hl Htl"
)
.
iIntros
"Hl Htl"
.
wp_seq
.
wp_proj
.
wp_load
.
...
...
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