Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
c
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
Iris
c
Commits
9865cb46
Commit
9865cb46
authored
6 years ago
by
Dan Frumin
Browse files
Options
Downloads
Patches
Plain Diff
Simpler specifications for pre_bin_op
parent
120d75a4
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
theories/c_translation/derived.v
+27
-0
27 additions, 0 deletions
theories/c_translation/derived.v
theories/tests/test1.v
+9
-0
9 additions, 0 deletions
theories/tests/test1.v
with
36 additions
and
0 deletions
theories/c_translation/derived.v
+
27
−
0
View file @
9865cb46
...
...
@@ -58,6 +58,33 @@ Section derived.
iApply
(
"HΦ"
with
"[$Hl] [$Hr]"
)
.
Qed
.
Lemma
a_pre_bin_op_spec'
R
Φ
Ψ1
Ψ2
e1
e2
op
v
l
:
l
↦
C
v
-∗
AWP
e1
@
R
{{
Ψ1
}}
-∗
AWP
e2
@
R
{{
Ψ2
}}
-∗
▷
(
∀
v1
v2
,
Ψ1
v1
-∗
Ψ2
v2
-∗
⌜
v1
=
#
l
⌝
∗
∃
w
,
⌜
bin_op_eval
op
v
v2
=
Some
w
⌝
∗
(
l
↦
C
[
LLvl
]
w
-∗
Φ
v
))
-∗
AWP
a_pre_bin_op
op
e1
e2
@
R
{{
Φ
}}
.
Proof
.
iIntros
"Hl He1 He2 HΦ"
.
iApply
(
a_pre_bin_op_spec
with
"He1 He2 [-]"
)
.
iNext
.
iIntros
(
v1
v2
)
"HΨ1 HΨ2 $"
.
iDestruct
(
"HΦ"
with
"HΨ1 HΨ2"
)
as
(
->
)
"HΦ"
.
iDestruct
"HΦ"
as
(
w
?)
"HΦ"
.
iExists
_,_,_;
iFrame
.
eauto
.
Qed
.
Lemma
a_pre_incr
R
Φ
e1
l
(
z
:
Z
)
:
l
↦
C
#
z
-∗
AWP
e1
@
R
{{
v
,
⌜
v
=
#
l
⌝
∗
(
l
↦
C
[
LLvl
]
#
(
z
+
1
)
-∗
Φ
#
z
)
}}
-∗
AWP
e1
+=
ᶜ
♯
1
@
R
{{
Φ
}}
.
Proof
.
iIntros
"Hl He1"
.
iApply
(
a_pre_bin_op_spec'
_
_
_
(
λ
v
,
⌜
v
=
#
1
⌝
)
%
I
with
"Hl He1 [] [-]"
)
.
{
iApply
awp_ret
.
by
wp_value_head
.
}
iNext
.
iIntros
(
v1
v2
)
"[% HΦ] %"
.
simplify_eq
/=.
eauto
.
Qed
.
Lemma
a_move_spec
(
s
t
:
loc
)
(
v
w
:
val
)
R
Φ
:
s
↦
C
v
∗
t
↦
C
w
∗
(
t
↦
C
w
-∗
s
↦
C
[
LLvl
]
w
-∗
Φ
w
)
-∗
awp
(
a_store
(
a_ret
#
s
)
(
a_load
(
a_ret
#
t
)))
R
Φ
.
...
...
This diff is collapsed.
Click to expand it.
theories/tests/test1.v
+
9
−
0
View file @
9865cb46
...
...
@@ -147,4 +147,13 @@ Section test.
repeat
iSplit
;
eauto
.
Qed
.
Lemma
inc_test2
(
l
:
loc
)
(
z0
:
Z
)
R
:
l
↦
C
#
z0
-∗
AWP
♯
l
+=
ᶜ
♯
1
@
R
{{
v
,
⌜
v
=
#
z0
⌝
∧
l
↦
C
[
LLvl
]
#
(
z0
+
1
)
}}
.
Proof
.
iIntros
"Hl"
.
iApply
(
a_pre_incr
with
"Hl"
)
.
iApply
awp_ret
;
wp_value_head
.
iSplit
;
eauto
.
Qed
.
End
test
.
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