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
6e625cb3
Commit
6e625cb3
authored
Nov 15, 2018
by
Robbert Krebbers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Less awkward syntax for call.
parent
816dd71e
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
13 additions
and
13 deletions
+13
-13
theories/c_translation/translation.v
theories/c_translation/translation.v
+5
-5
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/dcexpr.v
theories/vcgen/dcexpr.v
+1
-1
theories/vcgen/reification.v
theories/vcgen/reification.v
+1
-1
No files found.
theories/c_translation/translation.v
View file @
6e625cb3
...
...
@@ -84,7 +84,7 @@ Definition a_load : val := λ: "x",
end
).
Notation
"∗ᶜ e"
:
=
(
a_load
e
)%
E
(
at
level
9
,
right
associativity
)
:
expr_scope
.
(
a_load
e
)%
E
(
at
level
20
,
right
associativity
)
:
expr_scope
.
Notation
"'skipᶜ'"
:
=
(
a_ret
#()).
...
...
@@ -137,10 +137,10 @@ Notation "'whileVᶜ' ( cnd ) { e }" := (a_while (LamV <> cnd) (LamV <> e))
Definition
a_call
:
val
:
=
λ
:
"f"
"arg"
,
"a"
←ᶜ
"arg"
;
ᶜ
a_atomic
(
λ
:
<>,
"f"
"a"
).
Notation
"'callᶜ'
( f , a )
"
:
=
Notation
"'callᶜ'
f a
"
:
=
(
a_call
f
a
)%
E
(
at
level
10
,
f
,
a
at
level
9
9
,
format
"'callᶜ'
( f , a )
"
)
:
expr_scope
.
(
at
level
10
,
f
,
a
at
level
9
,
format
"'callᶜ'
f a
"
)
:
expr_scope
.
Definition
a_un_op
(
op
:
un_op
)
:
val
:
=
λ
:
"x"
,
"v"
←ᶜ
"x"
;;
ᶜ
a_ret
(
UnOp
op
"v"
).
...
...
@@ -509,7 +509,7 @@ Section proofs.
Lemma
a_call_spec
R
Ψ
Φ
(
f
:
val
)
ea
:
AWP
ea
@
R
{{
Ψ
}}
-
∗
(
∀
a
,
Ψ
a
-
∗
U
(
R
-
∗
AWP
f
a
{{
v
,
R
∗
Φ
v
}}))
-
∗
AWP
call
ᶜ
(
f
,
ea
)
@
R
{{
Φ
}}.
AWP
call
ᶜ
f
ea
@
R
{{
Φ
}}.
Proof
.
iIntros
"Ha Hfa"
.
awp_apply
(
a_wp_awp
R
with
"Ha"
)
;
iIntros
(
va
)
"Ha"
.
awp_lam
.
awp_pures
.
...
...
theories/tests/fact.v
View file @
6e625cb3
...
...
@@ -8,7 +8,7 @@ Definition factorial : val := λ: "n",
"r"
←
mut
ᶜ
♯
1
;
ᶜ
"c"
←
mut
ᶜ
♯
0
;
ᶜ
while
ᶜ
(
∗ᶜ
(
a_ret
"c"
)
<
ᶜ
a_ret
"n"
)
{
call
ᶜ
(
incr
,
a_ret
"c"
)
;
ᶜ
call
ᶜ
incr
(
a_ret
"c"
)
;
ᶜ
a_ret
"r"
=
ᶜ
∗ᶜ
(
a_ret
"r"
)
*
ᶜ
∗ᶜ
(
a_ret
"c"
)
}
;
ᶜ
∗ᶜ
(
a_ret
"r"
).
...
...
theories/tests/invoke.v
View file @
6e625cb3
...
...
@@ -8,7 +8,7 @@ Section tests_vcg.
Lemma
test_invoke_1
(
l
:
cloc
)
R
:
l
↦
C
#
42
-
∗
AWP
call
ᶜ
(
c_id
,
∗ᶜ
♯ₗ
l
)
@
R
{{
v
,
⌜
v
=
#
42
⌝
∗
l
↦
C
#
42
}}%
I
.
AWP
call
ᶜ
c_id
(
∗ᶜ
♯ₗ
l
)
@
R
{{
v
,
⌜
v
=
#
42
⌝
∗
l
↦
C
#
42
}}%
I
.
Proof
.
iIntros
"Hl"
.
vcg
.
iIntros
"Hl !> $"
.
awp_lam
.
vcg
.
iIntros
"Hl"
.
vcg_continue
.
eauto
.
...
...
@@ -20,14 +20,14 @@ Section tests_vcg.
(
a_ret
"v1"
)
+
ᶜ
(
a_ret
"v2"
).
Lemma
test_invoke_2
R
:
AWP
call
ᶜ
(
plus_pair
,
♯
21
|||
ᶜ
♯
21
)
@
R
{{
v
,
⌜
v
=
#
42
⌝
}}%
I
.
AWP
call
ᶜ
plus_pair
(
♯
21
|||
ᶜ
♯
21
)
@
R
{{
v
,
⌜
v
=
#
42
⌝
}}%
I
.
Proof
.
iIntros
.
vcg
.
iIntros
"!> $"
.
awp_lam
.
vcg
.
by
vcg_continue
.
Qed
.
Lemma
test_invoke_3
(
l
:
cloc
)
R
:
l
↦
C
#
21
-
∗
AWP
call
ᶜ
(
plus_pair
,
(
∗ᶜ
♯ₗ
l
|||
ᶜ
∗ᶜ
♯ₗ
l
)
)
@
R
AWP
call
ᶜ
plus_pair
(
∗ᶜ
♯ₗ
l
|||
ᶜ
∗ᶜ
♯ₗ
l
)
@
R
{{
v
,
⌜
v
=
#
42
⌝
∗
l
↦
C
#
21
}}%
I
.
Proof
.
iIntros
.
vcg
.
iIntros
"Hl !> $"
.
awp_lam
.
vcg
.
...
...
theories/tests/par_inc.v
View file @
6e625cb3
...
...
@@ -5,7 +5,7 @@ Definition inc : val := λ: "l",
a_ret
"l"
+=
ᶜ
♯
1
;
ᶜ
♯
1
.
Definition
par_inc
:
val
:
=
λ
:
"l"
,
call
ᶜ
(
inc
,
a_ret
"l"
)
+
ᶜ
call
ᶜ
(
inc
,
a_ret
"l"
).
call
ᶜ
inc
(
a_ret
"l"
)
+
ᶜ
call
ᶜ
inc
(
a_ret
"l"
).
Section
par_inc
.
Context
`
{
amonadG
Σ
,
!
inG
Σ
(
frac_authR
natR
)}.
...
...
@@ -25,7 +25,7 @@ Section par_inc.
iApply
(
awp_insert_res
_
_
par_inc_inv
with
"[Hγ Hl]"
).
{
iExists
0
%
nat
.
iFrame
.
}
iAssert
(
□
(
own
γ
(
◯
!{
1
/
2
}
0
%
nat
)
-
∗
AWP
call
ᶜ
(
inc
,
a_ret
(
cloc_to_val
cl
))
@
par_inc_inv
∗
R
AWP
call
ᶜ
inc
(
a_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γ]"
.
iApply
awp_fupd
.
iApply
(
inc_spec
with
"[$]"
)
;
iIntros
"Hl"
.
...
...
theories/vcgen/dcexpr.v
View file @
6e625cb3
...
...
@@ -254,7 +254,7 @@ Fixpoint dcexpr_interp (E : known_locs) (de : dcexpr) : expr :=
|
dCPar
de1
de2
=>
dcexpr_interp
E
de1
|||
ᶜ
dcexpr_interp
E
de2
|
dCWhile
de1
de2
=>
while
ᶜ
(
dcexpr_interp
E
de1
)
{
dcexpr_interp
E
de2
}
|
dCWhileV
de1
de2
=>
whileV
ᶜ
(
dcexpr_interp
E
de1
)
{
dcexpr_interp
E
de2
}
|
dCCall
fv
de
=>
call
ᶜ
(
fv
,
dcexpr_interp
E
de
)
|
dCCall
fv
de
=>
call
ᶜ
fv
(
dcexpr_interp
E
de
)
|
dCUnknown
e1
=>
e1
end
.
...
...
theories/vcgen/reification.v
View file @
6e625cb3
...
...
@@ -220,7 +220,7 @@ Instance into_dcexpr_whileV E E' E'' e1 e2 de1 de2 :
IntoDCExpr
E
E''
(
whileV
ᶜ
(
e1
)
{
e2
})
(
dCWhileV
de1
de2
).
Proof
.
solve_into_dcexpr2
.
Qed
.
Instance
into_dcexpr_call
e1
E
E'
f
de1
:
IntoDCExpr
E
E'
e1
de1
→
IntoDCExpr
E
E'
(
call
ᶜ
(
Val
f
,
e1
)
)
(
dCCall
f
de1
).
IntoDCExpr
E
E'
e1
de1
→
IntoDCExpr
E
E'
(
call
ᶜ
(
Val
f
)
e1
)
(
dCCall
f
de1
).
Proof
.
intros
[->
??]
;
by
split
.
Qed
.
Instance
into_dcexpr_unknown
E
e
:
IntoDCExpr
E
E
e
(
dCUnknown
e
)
|
100
.
Proof
.
done
.
Qed
.
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