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
8ca87cec
Commit
8ca87cec
authored
Oct 17, 2018
by
Robbert Krebbers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merge vcg_solver and splitenv into new file called proofmode.
parent
30e7f81d
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
88 additions
and
96 deletions
+88
-96
_CoqProject
_CoqProject
+1
-2
theories/tests/basics.v
theories/tests/basics.v
+1
-1
theories/tests/binop.v
theories/tests/binop.v
+1
-1
theories/tests/fact.v
theories/tests/fact.v
+1
-1
theories/tests/gcd.v
theories/tests/gcd.v
+1
-1
theories/tests/invoke.v
theories/tests/invoke.v
+1
-1
theories/tests/lists.v
theories/tests/lists.v
+1
-1
theories/tests/memcpy.v
theories/tests/memcpy.v
+1
-1
theories/tests/swap.v
theories/tests/swap.v
+1
-1
theories/tests/unknowns.v
theories/tests/unknowns.v
+1
-1
theories/vcgen/proofmode.v
theories/vcgen/proofmode.v
+78
-4
theories/vcgen/splitenv.v
theories/vcgen/splitenv.v
+0
-81
No files found.
_CoqProject
View file @
8ca87cec
...
...
@@ -12,9 +12,8 @@ theories/c_translation/proofmode.v
theories/c_translation/translation.v
theories/vcgen/dcexpr.v
theories/vcgen/denv.v
theories/vcgen/splitenv.v
theories/vcgen/vcgen.v
theories/vcgen/
vcg_solver
.v
theories/vcgen/
proofmode
.v
theories/tests/basics.v
theories/tests/invoke.v
theories/tests/unknowns.v
...
...
theories/tests/basics.v
View file @
8ca87cec
(** Testing basic connectives *)
From
iris_c
.
vcgen
Require
Import
vcg_solver
.
From
iris_c
.
vcgen
Require
Import
proofmode
.
Section
test
.
Context
`
{
amonadG
Σ
}.
...
...
theories/tests/binop.v
View file @
8ca87cec
From
iris_c
.
vcgen
Require
Import
vcg_solver
.
From
iris_c
.
vcgen
Require
Import
proofmode
.
Section
test
.
Context
`
{
amonadG
Σ
}.
...
...
theories/tests/fact.v
View file @
8ca87cec
From
iris_c
.
vcgen
Require
Import
vcg_solver
.
From
iris_c
.
vcgen
Require
Import
proofmode
.
Local
Open
Scope
Z_scope
.
Definition
incr
:
val
:
=
λ
:
"l"
,
...
...
theories/tests/gcd.v
View file @
8ca87cec
From
iris_c
.
vcgen
Require
Import
vcg_solver
.
From
iris_c
.
vcgen
Require
Import
proofmode
.
Local
Open
Scope
Z_scope
.
(* TODO: Notation, get rid of parenthesis around the while loop *)
...
...
theories/tests/invoke.v
View file @
8ca87cec
(** Testing function calls and AWP resources *)
From
iris_c
.
vcgen
Require
Import
vcg_solver
.
From
iris_c
.
vcgen
Require
Import
proofmode
.
Section
tests_vcg
.
Context
`
{
amonadG
Σ
}.
...
...
theories/tests/lists.v
View file @
8ca87cec
From
iris_c
.
vcgen
Require
Import
vcg_solver
.
From
iris_c
.
vcgen
Require
Import
proofmode
.
Definition
a_list_nil
:
val
:
=
λ
:
<>,
a_ret
NONEV
.
...
...
theories/tests/memcpy.v
View file @
8ca87cec
From
iris_c
.
vcgen
Require
Import
vcg_solver
.
From
iris_c
.
vcgen
Require
Import
proofmode
.
Local
Open
Scope
Z_scope
.
Section
memcpy
.
...
...
theories/tests/swap.v
View file @
8ca87cec
From
iris_c
.
vcgen
Require
Import
vcg_solver
.
From
iris_c
.
vcgen
Require
Import
proofmode
.
Section
tests_vcg
.
Context
`
{
amonadG
Σ
}.
...
...
theories/tests/unknowns.v
View file @
8ca87cec
(** Testing vcgen on expressions contaning unknown subexpressions *)
From
iris_c
.
vcgen
Require
Import
vcg_solver
.
From
iris_c
.
vcgen
Require
Import
proofmode
.
Local
Open
Scope
Z_scope
.
Section
tests_vcg
.
...
...
theories/vcgen/
vcg_solver
.v
→
theories/vcgen/
proofmode
.v
View file @
8ca87cec
From
iris_c
.
vcgen
Require
Export
vcge
n
.
From
iris_c
.
vcgen
Require
Import
split
env
.
From
iris_c
.
c_translation
Require
Export
translatio
n
.
From
iris_c
.
vcgen
Require
Import
vcgen
d
env
.
From
iris
.
proofmode
Require
Import
environments
coq_tactics
.
Import
env_notations
.
Section
vcg_continue
.
Section
tactics
.
Context
`
{
amonadG
Σ
}.
Class
MapstoListFromEnv
(
Γ
in
Γ
out
:
env
(
iProp
Σ
))
(
Γ
ls
:
penv
)
:
=
{
mapsto_list_from_env
:
[
∗
]
Γ
in
⊢
[
∗
]
Γ
out
∗
penv_interp
Γ
ls
;
mapsto_list_from_env_wf
:
env_wf
Γ
in
→
env_wf
Γ
out
;
mapsto_list_from_env_lookup_None
i
:
Γ
in
!!
i
=
None
→
Γ
out
!!
i
=
None
}.
Global
Instance
mapsto_list_from_env_nil
:
MapstoListFromEnv
Enil
Enil
nil
.
Proof
.
split
;
unfold
penv_interp
;
eauto
.
Qed
.
Global
Instance
mapsto_list_from_env_snoc_
Γ
out
Γ
in
Γ
out
Γ
ls
i
P
:
MapstoListFromEnv
Γ
in
Γ
out
Γ
ls
→
MapstoListFromEnv
(
Esnoc
Γ
in
i
P
)
(
Esnoc
Γ
out
i
P
)
Γ
ls
|
100
.
Proof
.
destruct
1
;
split
;
simpl
.
-
rewrite
mapsto_list_from_env0
.
iIntros
"(H1 & H2 & H3)"
.
iFrame
.
-
intro
Hwf
.
inversion
Hwf
;
subst
.
apply
mapsto_list_from_env_wf0
in
H4
.
apply
Esnoc_wf
;
last
done
.
by
apply
mapsto_list_from_env_lookup_None0
.
-
intros
j
Hj
.
destruct
(
ident_beq
j
i
)
;
simplify_eq
/=.
by
apply
mapsto_list_from_env_lookup_None0
.
Qed
.
Global
Instance
mapsto_list_from_env_snoc_
Γ
ls
Γ
in
Γ
out
Γ
ls
i
l
q
v
lvl
:
MapstoListFromEnv
Γ
in
Γ
out
Γ
ls
→
MapstoListFromEnv
(
Esnoc
Γ
in
i
(
l
↦
C
[
lvl
]{
q
}
v
))
Γ
out
(
PenvItem
l
lvl
q
v
::
Γ
ls
)
|
3
.
Proof
.
destruct
1
.
split
.
-
iIntros
"[H1 H2] /="
.
iFrame
.
by
rewrite
mapsto_list_from_env0
.
-
intros
Heq
.
inversion
Heq
;
simplify_eq
/=.
by
apply
mapsto_list_from_env_wf0
.
-
intros
j
Hsnoc
.
apply
mapsto_list_from_env_lookup_None0
.
destruct
(
decide
(
i
=
j
))
as
[->|].
simplify_eq
/=.
by
destruct
(
ident_beq
j
j
).
by
rewrite
env_lookup_snoc_ne
in
Hsnoc
.
Qed
.
Class
ListOfMapsto
(
Γ
ls
:
penv
)
(
E
:
known_locs
)
(
ps
:
denv
)
:
=
list_of_mapsto
:
penv_interp
Γ
ls
⊢
denv_interp
E
ps
.
Global
Instance
list_of_mapsto_nil
E
:
ListOfMapsto
[]
E
[].
Proof
.
unfold
ListOfMapsto
.
simpl
.
eauto
.
Qed
.
Global
Instance
list_of_mapsto_cons
E
Γ
ls
ps
v
dv
i
l
x
q
:
LocLookup
E
l
i
→
IntoDVal
E
v
dv
→
ListOfMapsto
Γ
ls
E
ps
→
ListOfMapsto
(
PenvItem
l
x
q
v
::
Γ
ls
)
E
(
denv_insert
i
x
q
dv
ps
).
Proof
.
rewrite
/
LocLookup
/
ListOfMapsto
/
penv_interp
=>
Hi
[->
?]
H
Γ
ls
/=.
iIntros
"[Hl H] /="
.
rewrite
H
Γ
ls
-
denv_insert_interp
/=
Hi
.
iFrame
.
Qed
.
Lemma
tac_envs_split_mapsto
Γ
s_in
Γ
s_out
Γ
ls
Γ
p
c
ps
P
:
MapstoListFromEnv
Γ
s_in
Γ
s_out
Γ
ls
→
ListOfMapsto
Γ
ls
(
penv_to_known_locs
Γ
ls
)
ps
→
envs_entails
(
Envs
Γ
p
Γ
s_out
c
)
(
denv_interp
(
penv_to_known_locs
Γ
ls
)
ps
-
∗
P
)%
I
→
envs_entails
(
Envs
Γ
p
Γ
s_in
c
)
P
.
Proof
.
intros
Hsplit
.
rewrite
/
ListOfMapsto
environments
.
envs_entails_eq
=>
Hexhale
.
unfold
of_envs
.
simpl
.
rewrite
mapsto_list_from_env
.
intros
Hz
.
iIntros
"(Hwf & #Hp & Hs & Hls)"
.
iDestruct
"Hwf"
as
%
Hwf
.
iApply
(
Hz
with
"[Hs]"
).
-
iFrame
"Hp Hs"
.
iPureIntro
.
split
;
eauto
.
+
apply
Hwf
.
+
apply
Hsplit
.
apply
Hwf
.
+
intros
i
.
simpl
.
destruct
(
envs_disjoint
_
Hwf
i
)
as
[
Hp
|
Hp
]
;
simpl
in
Hp
.
*
by
left
.
*
right
.
by
apply
Hsplit
.
-
by
iApply
Hexhale
.
Qed
.
Class
FromKnownLocs
(
Γ
ls
:
penv
)
(
E_old
:
known_locs
)
(
E_new
:
known_locs
).
(*dom Γls ⊂ (elem_of E_old) disj_Union (elem_of E) *)
...
...
@@ -68,7 +142,7 @@ Section vcg_continue.
*
by
left
.
*
right
.
by
apply
Hsplit
.
Qed
.
End
vcg_continue
.
End
tactics
.
Arguments
vcg_wp_continuation
{
_
_
_
_
}.
...
...
theories/vcgen/splitenv.v
deleted
100644 → 0
View file @
30e7f81d
From
iris
.
proofmode
Require
Import
environments
coq_tactics
.
From
iris_c
.
vcgen
Require
Export
denv
.
Import
env_notations
.
Section
splitenv
.
Context
`
{
amonadG
Σ
}.
Class
MapstoListFromEnv
(
Γ
in
Γ
out
:
env
(
iProp
Σ
))
(
Γ
ls
:
penv
)
:
=
{
mapsto_list_from_env
:
[
∗
]
Γ
in
⊢
[
∗
]
Γ
out
∗
penv_interp
Γ
ls
;
mapsto_list_from_env_wf
:
env_wf
Γ
in
→
env_wf
Γ
out
;
mapsto_list_from_env_lookup_None
i
:
Γ
in
!!
i
=
None
→
Γ
out
!!
i
=
None
}.
Global
Instance
mapsto_list_from_env_nil
:
MapstoListFromEnv
Enil
Enil
nil
.
Proof
.
split
;
unfold
penv_interp
;
eauto
.
Qed
.
Global
Instance
mapsto_list_from_env_snoc_
Γ
out
Γ
in
Γ
out
Γ
ls
i
P
:
MapstoListFromEnv
Γ
in
Γ
out
Γ
ls
→
MapstoListFromEnv
(
Esnoc
Γ
in
i
P
)
(
Esnoc
Γ
out
i
P
)
Γ
ls
|
100
.
Proof
.
destruct
1
;
split
;
simpl
.
-
rewrite
mapsto_list_from_env0
.
iIntros
"(H1 & H2 & H3)"
.
iFrame
.
-
intro
Hwf
.
inversion
Hwf
;
subst
.
apply
mapsto_list_from_env_wf0
in
H4
.
apply
Esnoc_wf
;
last
done
.
by
apply
mapsto_list_from_env_lookup_None0
.
-
intros
j
Hj
.
destruct
(
ident_beq
j
i
)
;
simplify_eq
/=.
by
apply
mapsto_list_from_env_lookup_None0
.
Qed
.
Global
Instance
mapsto_list_from_env_snoc_
Γ
ls
Γ
in
Γ
out
Γ
ls
i
l
q
v
lvl
:
MapstoListFromEnv
Γ
in
Γ
out
Γ
ls
→
MapstoListFromEnv
(
Esnoc
Γ
in
i
(
l
↦
C
[
lvl
]{
q
}
v
))
Γ
out
(
PenvItem
l
lvl
q
v
::
Γ
ls
)
|
3
.
Proof
.
destruct
1
.
split
.
-
iIntros
"[H1 H2] /="
.
iFrame
.
by
rewrite
mapsto_list_from_env0
.
-
intros
Heq
.
inversion
Heq
;
simplify_eq
/=.
by
apply
mapsto_list_from_env_wf0
.
-
intros
j
Hsnoc
.
apply
mapsto_list_from_env_lookup_None0
.
destruct
(
decide
(
i
=
j
))
as
[->|].
simplify_eq
/=.
by
destruct
(
ident_beq
j
j
).
by
rewrite
env_lookup_snoc_ne
in
Hsnoc
.
Qed
.
Class
ListOfMapsto
(
Γ
ls
:
penv
)
(
E
:
known_locs
)
(
ps
:
denv
)
:
=
list_of_mapsto
:
penv_interp
Γ
ls
⊢
denv_interp
E
ps
.
Global
Instance
list_of_mapsto_nil
E
:
ListOfMapsto
[]
E
[].
Proof
.
unfold
ListOfMapsto
.
simpl
.
eauto
.
Qed
.
Global
Instance
list_of_mapsto_cons
E
Γ
ls
ps
v
dv
i
l
x
q
:
LocLookup
E
l
i
→
IntoDVal
E
v
dv
→
ListOfMapsto
Γ
ls
E
ps
→
ListOfMapsto
(
PenvItem
l
x
q
v
::
Γ
ls
)
E
(
denv_insert
i
x
q
dv
ps
).
Proof
.
rewrite
/
LocLookup
/
ListOfMapsto
/
penv_interp
=>
Hi
[->
?]
H
Γ
ls
/=.
iIntros
"[Hl H] /="
.
rewrite
H
Γ
ls
-
denv_insert_interp
/=
Hi
.
iFrame
.
Qed
.
Lemma
tac_envs_split_mapsto
Γ
s_in
Γ
s_out
Γ
ls
Γ
p
c
ps
P
:
MapstoListFromEnv
Γ
s_in
Γ
s_out
Γ
ls
→
ListOfMapsto
Γ
ls
(
penv_to_known_locs
Γ
ls
)
ps
→
envs_entails
(
Envs
Γ
p
Γ
s_out
c
)
(
denv_interp
(
penv_to_known_locs
Γ
ls
)
ps
-
∗
P
)%
I
→
envs_entails
(
Envs
Γ
p
Γ
s_in
c
)
P
.
Proof
.
intros
Hsplit
.
rewrite
/
ListOfMapsto
environments
.
envs_entails_eq
=>
Hexhale
.
unfold
of_envs
.
simpl
.
rewrite
mapsto_list_from_env
.
intros
Hz
.
iIntros
"(Hwf & #Hp & Hs & Hls)"
.
iDestruct
"Hwf"
as
%
Hwf
.
iApply
(
Hz
with
"[Hs]"
).
-
iFrame
"Hp Hs"
.
iPureIntro
.
split
;
eauto
.
+
apply
Hwf
.
+
apply
Hsplit
.
apply
Hwf
.
+
intros
i
.
simpl
.
destruct
(
envs_disjoint
_
Hwf
i
)
as
[
Hp
|
Hp
]
;
simpl
in
Hp
.
*
by
left
.
*
right
.
by
apply
Hsplit
.
-
by
iApply
Hexhale
.
Qed
.
End
splitenv
.
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