Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
c
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Iris
c
Commits
5e98b3d6
Commit
5e98b3d6
authored
Feb 01, 2019
by
Dan Frumin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Stronger spec for c_call
parent
84f6294f
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
16 additions
and
15 deletions
+16
-15
theories/c_translation/translation.v
theories/c_translation/translation.v
+3
-2
theories/tests/fact.v
theories/tests/fact.v
+1
-1
theories/tests/invoke.v
theories/tests/invoke.v
+3
-3
theories/tests/par_inc.v
theories/tests/par_inc.v
+2
-2
theories/vcgen/vcg.v
theories/vcgen/vcg.v
+7
-7
No files found.
theories/c_translation/translation.v
View file @
5e98b3d6
...
...
@@ -539,7 +539,7 @@ Section proofs.
Lemma
cwp_call
R
Ψ
1
Ψ
2
Φ
ef
ea
:
CWP
ef
@
R
{{
Ψ
1
}}
-
∗
CWP
ea
@
R
{{
Ψ
2
}}
-
∗
(
∀
f
a
,
Ψ
1
f
-
∗
Ψ
2
a
-
∗
U
(
R
-
∗
▷
CWP
f
a
{{
v
,
R
∗
Φ
v
}}))
-
∗
(
∀
f
a
,
Ψ
1
f
-
∗
Ψ
2
a
-
∗
R
-
∗
▷
U
(
CWP
f
a
{{
v
,
R
∗
Φ
v
}}))
-
∗
CWP
call
ᶜ
ef
ea
@
R
{{
Φ
}}.
Proof
.
iIntros
"H1 H2 H"
.
...
...
@@ -550,8 +550,9 @@ Section proofs.
iIntros
"!>"
(
f
a
)
"H1 H2 !>"
.
iSpecialize
(
"H"
with
"H1 H2"
).
cwp_pures
.
iApply
cwp_atomic
.
iIntros
"HR"
.
iNext
.
iExists
True
%
I
.
iSplitR
;
first
done
.
cwp_pures
.
iSpecialize
(
"H"
with
"HR"
).
iApply
cwp_bind
.
iApply
cwp_mset_clear
.
iNext
.
iModIntro
.
iSpecialize
(
"H"
with
"HR"
).
cwp_pures
.
cwp_pures
.
iApply
(
cwp_wand
with
"H"
)
;
eauto
.
Qed
.
...
...
theories/tests/fact.v
View file @
5e98b3d6
...
...
@@ -33,7 +33,7 @@ Section factorial_spec.
iL
ö
b
as
"IH"
forall
(
n
k
Hk
).
iApply
cwp_whileV
;
iNext
.
vcg
.
iIntros
"**"
.
case_bool_decide
.
+
iLeft
.
iSplit
;
eauto
.
iModIntro
.
vcg
.
iIntros
"Hc Hr
!> $
!>"
.
iApply
(
inc_spec
with
"Hc"
)
;
iIntros
"Hc"
.
iIntros
"Hc Hr
$ !>
!>"
.
iApply
(
inc_spec
with
"Hc"
)
;
iIntros
"Hc"
.
vcg_continue
.
iIntros
"Hc Hr !>"
.
assert
(
fact
k
*
S
k
=
fact
(
S
k
))
as
->
by
(
simpl
;
lia
).
iApply
(
"IH"
$!
n
(
S
k
)
with
"[%] Hc Hr"
).
lia
.
...
...
theories/tests/invoke.v
View file @
5e98b3d6
...
...
@@ -10,7 +10,7 @@ Section tests_vcg.
l
↦
C
#
42
-
∗
CWP
call
ᶜ
(
c_ret
c_id
)
(
∗ᶜ
♯ₗ
l
)
@
R
{{
v
,
⌜
v
=
#
42
⌝
∗
l
↦
C
#
42
}}%
I
.
Proof
.
iIntros
"Hl"
.
vcg
.
iIntros
"Hl
!> $
!>"
.
iIntros
"Hl"
.
vcg
.
iIntros
"Hl
$ !>
!>"
.
cwp_lam
.
vcg
.
iIntros
"Hl"
.
vcg_continue
.
eauto
.
Qed
.
...
...
@@ -22,7 +22,7 @@ Section tests_vcg.
Lemma
test_invoke_2
R
:
CWP
call
ᶜ
(
c_ret
plus_pair
)
(
♯
21
|||
ᶜ
♯
21
)
@
R
{{
v
,
⌜
v
=
#
42
⌝
}}%
I
.
Proof
.
iIntros
.
vcg
.
iIntros
"
!> $
!>"
.
cwp_lam
.
vcg
.
by
vcg_continue
.
iIntros
.
vcg
.
iIntros
"
$ !>
!>"
.
cwp_lam
.
vcg
.
by
vcg_continue
.
Qed
.
Lemma
test_invoke_3
(
l
:
cloc
)
R
:
...
...
@@ -30,7 +30,7 @@ Section tests_vcg.
CWP
call
ᶜ
(
c_ret
plus_pair
)
(
∗ᶜ
♯ₗ
l
|||
ᶜ
∗ᶜ
♯ₗ
l
)
@
R
{{
v
,
⌜
v
=
#
42
⌝
∗
l
↦
C
#
21
}}%
I
.
Proof
.
iIntros
.
vcg
.
iIntros
"Hl
!> $
!>"
.
cwp_lam
.
vcg
.
iIntros
.
vcg
.
iIntros
"Hl
$ !>
!>"
.
cwp_lam
.
vcg
.
iIntros
"Hl"
.
vcg_continue
;
eauto
.
Qed
.
End
tests_vcg
.
theories/tests/par_inc.v
View file @
5e98b3d6
...
...
@@ -29,7 +29,7 @@ Section par_inc.
iAssert
(
□
(
own
γ
(
◯
!{
1
/
2
}
0
%
nat
)
-
∗
CWP
call
ᶜ
(
c_ret
inc
)
(
c_ret
(
cloc_to_val
cl
))
@
par_inc_inv
∗
R
{{
v
,
⌜
v
=
#
1
⌝
∧
own
γ
(
◯
!{
1
/
2
}
1
%
nat
)
}}))%
I
as
"#H"
.
{
iIntros
"!> Hγ'"
.
vcg
;
iIntros
"
!> [HR $]
!>"
.
iDestruct
"HR"
as
(
n'
)
"[Hl Hγ]"
.
{
iIntros
"!> Hγ'"
.
vcg
;
iIntros
"
[HR $] !>
!>"
.
iDestruct
"HR"
as
(
n'
)
"[Hl Hγ]"
.
iApply
cwp_fupd
.
iApply
(
inc_spec
with
"[$]"
)
;
iIntros
"Hl"
.
iMod
(
own_update_2
with
"Hγ Hγ'"
)
as
"[Hγ Hγ']"
.
{
apply
frac_auth_update
,
(
nat_local_update
_
_
(
S
n'
)
1
)
;
lia
.
}
...
...
@@ -43,4 +43,4 @@ Section par_inc.
iDestruct
1
as
(
n'
)
">[Hl Hγ]"
.
iCombine
"Hγ1 Hγ2"
as
"Hγ'"
.
iDestruct
(
own_valid_2
with
"Hγ Hγ'"
)
as
%->%
frac_auth_agreeL
.
iFrame
;
auto
.
Qed
.
End
par_inc
.
\ No newline at end of file
End
par_inc
.
theories/vcgen/vcg.v
View file @
5e98b3d6
...
...
@@ -123,9 +123,9 @@ Section vcg.
Definition
vcg_call
(
E
:
known_locs
)
(
dv1
dv2
:
dval
)
(
m
:
denv
)
(
R
:
iProp
Σ
)
(
Φ
:
known_locs
→
denv
→
dval
→
iProp
Σ
)
:
iProp
Σ
:
=
(
wand_denv_interp
E
m
$
U
(
R
-
∗
▷
CWP
(
dval_interp
E
dv1
)
(
dval_interp
E
dv2
)
{{
v
,
R
∗
vcg_continuation
E
Φ
v
}}
))%
I
.
(
wand_denv_interp
E
m
(
R
-
∗
▷
U
(
CWP
(
dval_interp
E
dv1
)
(
dval_interp
E
dv2
)
{{
v
,
R
∗
vcg_continuation
E
Φ
v
}})
))%
I
.
Fixpoint
vcg
(
E
:
known_locs
)
(
n
:
nat
)
(
m
:
denv
)
(
de
:
dcexpr
)
(
R
:
iProp
Σ
)
(
Φ
:
known_locs
→
denv
→
dval
→
iProp
Σ
)
:
iProp
Σ
:
=
...
...
@@ -634,12 +634,12 @@ Section vcg_spec.
iDestruct
(
forward_correct
with
"Hm"
)
as
"[Hm' H2]"
;
eauto
.
iApply
(
cwp_call
with
"[H Hm'] H2"
).
{
iApply
(
"IH"
with
"[] [] Hm' H"
)
;
eauto
.
}
iIntros
(
f
a
)
"H [-> HmNew]"
;
iDestruct
"H"
as
(
E'
dv
m''
->
???)
"[Hm'' H]"
.
iIntros
(
f
a
)
"H [-> HmNew]"
.
iDestruct
"H"
as
(
E'
dv
m''
->
???)
"[Hm'' H]"
.
iDestruct
(
wand_denv_interp_spec
with
"H [Hm'' HmNew]"
)
as
"H"
.
{
iApply
denv_merge_interp
;
eauto
using
denv_wf_mono
.
iFrame
"Hm''"
.
iApply
(
denv_interp_mono
with
"HmNew"
)
;
eauto
.
}
iIntros
"
!> HR"
.
iSpecialize
(
"H"
with
"HR"
)
;
iModIntro
.
iIntros
"
HR"
.
iSpecialize
(
"H"
with
"HR"
).
iNext
.
iModIntro
.
rewrite
(
dval_interp_mono
E
E'
)
;
eauto
.
iApply
(
cwp_wand
with
"H"
)
;
iIntros
(
w
)
"[$ H]"
.
by
iApply
vcg_continuation_mono
.
...
...
@@ -651,7 +651,7 @@ Section vcg_spec.
iDestruct
(
wand_denv_interp_spec
with
"H [Hm'' HmNew]"
)
as
"H"
.
{
iApply
denv_merge_interp
;
eauto
using
denv_wf_mono
.
iFrame
"Hm''"
.
iApply
(
denv_interp_mono
with
"HmNew"
)
;
eauto
.
}
iIntros
"
!> HR"
.
iSpecialize
(
"H"
with
"HR"
)
;
iModIntro
.
iIntros
"
HR"
.
iSpecialize
(
"H"
with
"HR"
)
;
iNext
;
iModIntro
.
rewrite
(
dval_interp_mono
E
E'
)
;
eauto
.
iApply
(
cwp_wand
with
"H"
)
;
iIntros
(
w
)
"[$ H]"
.
by
iApply
vcg_continuation_mono
.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment