Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
George Pirlea
Iris
Commits
6ae49bd9
Commit
6ae49bd9
authored
Apr 24, 2018
by
Ralf Jung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rename InvOpener -> AccElim
parent
eb36249e
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
34 additions
and
34 deletions
+34
-34
theories/base_logic/lib/cancelable_invariants.v
theories/base_logic/lib/cancelable_invariants.v
+2
-2
theories/base_logic/lib/invariants.v
theories/base_logic/lib/invariants.v
+2
-2
theories/base_logic/lib/na_invariants.v
theories/base_logic/lib/na_invariants.v
+2
-2
theories/program_logic/weakestpre.v
theories/program_logic/weakestpre.v
+7
-7
theories/proofmode/class_instances_sbi.v
theories/proofmode/class_instances_sbi.v
+6
-6
theories/proofmode/classes.v
theories/proofmode/classes.v
+15
-15
No files found.
theories/base_logic/lib/cancelable_invariants.v
View file @
6ae49bd9
...
...
@@ -93,10 +93,10 @@ Section proofs.
Global
Instance
into_inv_cinv
N
γ
P
:
IntoInv
(
cinv
N
γ
P
)
N
.
Global
Instance
elim_inv_cinv
E
N
γ
P
p
Q
Q'
:
InvOpener
E
(
E
∖↑
N
)
(
▷
P
∗
cinv_own
γ
p
)
(
▷
P
)
None
Q
Q'
→
AccElim
E
(
E
∖↑
N
)
(
▷
P
∗
cinv_own
γ
p
)
(
▷
P
)
None
Q
Q'
→
ElimInv
(
↑
N
⊆
E
)
(
cinv
N
γ
P
)
(
cinv_own
γ
p
)
(
▷
P
∗
cinv_own
γ
p
)
Q
Q'
.
Proof
.
rewrite
/
ElimInv
/
InvOpener
.
iIntros
(
Helim
?)
"(#Hinv & Hown & Hcont)"
.
rewrite
/
ElimInv
/
AccElim
.
iIntros
(
Helim
?)
"(#Hinv & Hown & Hcont)"
.
iApply
(
Helim
with
"Hcont"
).
clear
Helim
.
rewrite
-
assoc
.
iApply
(
cinv_open
with
"Hinv"
)
;
done
.
Qed
.
...
...
theories/base_logic/lib/invariants.v
View file @
6ae49bd9
...
...
@@ -110,10 +110,10 @@ Qed.
Global
Instance
into_inv_inv
N
P
:
IntoInv
(
inv
N
P
)
N
.
Global
Instance
elim_inv_inv
E
N
P
Q
Q'
:
InvOpener
E
(
E
∖↑
N
)
(
▷
P
)
(
▷
P
)
None
Q
Q'
→
AccElim
E
(
E
∖↑
N
)
(
▷
P
)
(
▷
P
)
None
Q
Q'
→
ElimInv
(
↑
N
⊆
E
)
(
inv
N
P
)
True
(
▷
P
)
Q
Q'
.
Proof
.
rewrite
/
ElimInv
/
InvOpener
.
iIntros
(
Hopener
?)
"(#Hinv & _ & Hcont)"
.
rewrite
/
ElimInv
/
AccElim
.
iIntros
(
Hopener
?)
"(#Hinv & _ & Hcont)"
.
iApply
(
Hopener
with
"Hcont"
).
iApply
inv_open
;
done
.
Qed
.
...
...
theories/base_logic/lib/na_invariants.v
View file @
6ae49bd9
...
...
@@ -114,12 +114,12 @@ Section proofs.
Global
Instance
into_inv_na
p
N
P
:
IntoInv
(
na_inv
p
N
P
)
N
.
Global
Instance
elim_inv_na
p
F
E
N
P
Q
Q'
:
InvOpener
E
E
(
▷
P
∗
na_own
p
(
F
∖
↑
N
))
(
▷
P
∗
na_own
p
(
F
∖
↑
N
))
AccElim
E
E
(
▷
P
∗
na_own
p
(
F
∖
↑
N
))
(
▷
P
∗
na_own
p
(
F
∖
↑
N
))
(
Some
(
na_own
p
F
))
Q
Q'
→
ElimInv
(
↑
N
⊆
E
∧
↑
N
⊆
F
)
(
na_inv
p
N
P
)
(
na_own
p
F
)
(
▷
P
∗
na_own
p
(
F
∖↑
N
))
Q
Q'
.
Proof
.
rewrite
/
ElimInv
/
InvOpener
.
iIntros
(
Helim
(?&?))
"(#Hinv & Hown & Hcont)"
.
rewrite
/
ElimInv
/
AccElim
.
iIntros
(
Helim
(?&?))
"(#Hinv & Hown & Hcont)"
.
iApply
(
Helim
with
"Hcont"
).
clear
Helim
.
rewrite
-
assoc
/=.
iApply
(
na_inv_open
with
"Hinv"
)
;
done
.
Qed
.
...
...
theories/program_logic/weakestpre.v
View file @
6ae49bd9
...
...
@@ -405,22 +405,22 @@ Section proofmode_classes.
AddModal
(|={
E
}=>
P
)
P
(
WP
e
@
s
;
E
{{
Φ
}}).
Proof
.
by
rewrite
/
AddModal
fupd_frame_r
wand_elim_r
fupd_wp
.
Qed
.
Global
Instance
inv_opener
_wp
E1
E2
P
P'
(
P''
:
option
_
)
e
s
Φ
:
Global
Instance
acc_elim
_wp
E1
E2
P
P'
(
P''
:
option
_
)
e
s
Φ
:
Atomic
(
stuckness_to_atomicity
s
)
e
→
InvOpener
E1
E2
P
P'
P''
(
WP
e
@
s
;
E1
{{
Φ
}})
AccElim
E1
E2
P
P'
P''
(
WP
e
@
s
;
E1
{{
Φ
}})
(
WP
e
@
s
;
E2
{{
v
,
P'
∗
coq_tactics
.
maybe_wand
P''
(
Φ
v
)
}})%
I
.
Proof
.
intros
?.
rewrite
/
InvOpener
.
setoid_rewrite
coq_tactics
.
maybe_wand_sound
.
intros
?.
rewrite
/
AccElim
.
setoid_rewrite
coq_tactics
.
maybe_wand_sound
.
iIntros
"Hinner >[HP Hclose]"
.
iApply
(
wp_wand
with
"[Hinner HP]"
)
;
first
by
iApply
"Hinner"
.
iIntros
(
v
)
"[HP HΦ]"
.
iApply
"HΦ"
.
by
iApply
"Hclose"
.
Qed
.
Global
Instance
inv_opener
_wp_nonatomic
E
P
P'
(
P''
:
option
_
)
e
s
Φ
:
InvOpener
E
E
P
P'
P''
(
WP
e
@
s
;
E
{{
Φ
}})
(
WP
e
@
s
;
E
{{
v
,
P'
∗
coq_tactics
.
maybe_wand
P''
(
Φ
v
)
}})%
I
.
Global
Instance
acc_elim
_wp_nonatomic
E
P
P'
(
P''
:
option
_
)
e
s
Φ
:
AccElim
E
E
P
P'
P''
(
WP
e
@
s
;
E
{{
Φ
}})
(
WP
e
@
s
;
E
{{
v
,
P'
∗
coq_tactics
.
maybe_wand
P''
(
Φ
v
)
}})%
I
.
Proof
.
rewrite
/
InvOpener
.
setoid_rewrite
coq_tactics
.
maybe_wand_sound
.
rewrite
/
AccElim
.
setoid_rewrite
coq_tactics
.
maybe_wand_sound
.
iIntros
"Hinner >[HP Hclose]"
.
iApply
wp_fupd
.
iApply
(
wp_wand
with
"[Hinner HP]"
)
;
first
by
iApply
"Hinner"
.
iIntros
(
v
)
"[HP HΦ]"
.
iApply
"HΦ"
.
by
iApply
"Hclose"
.
...
...
theories/proofmode/class_instances_sbi.v
View file @
6ae49bd9
...
...
@@ -551,13 +551,13 @@ Global Instance add_modal_embed_fupd_goal `{BiEmbedFUpd PROP PROP'}
AddModal
P
P'
(|={
E1
,
E2
}=>
⎡
Q
⎤
)%
I
→
AddModal
P
P'
⎡
|={
E1
,
E2
}=>
Q
⎤
.
Proof
.
by
rewrite
/
AddModal
!
embed_fupd
.
Qed
.
(*
InvOpener
*)
Global
Instance
inv_opener
_vs
`
{
BiFUpd
PROP
}
E1
E2
E
P
P'
(
P''
:
option
PROP
)
Q
:
(* FIXME: Why %I? Elim
Inv should
set the right scopes! *)
InvOpener
E1
E2
P
P'
P''
(|={
E1
,
E
}=>
Q
)
(|={
E2
}=>
(
P'
∗
(
coq_tactics
.
maybe_wand
P''
(|={
E1
,
E
}=>
Q
))))%
I
.
(*
AccElim
*)
Global
Instance
acc_elim
_vs
`
{
BiFUpd
PROP
}
E1
E2
E
P
P'
(
P''
:
option
PROP
)
Q
:
(* FIXME: Why %I?
Acc
Elim set
s
the right scopes! *)
AccElim
E1
E2
P
P'
P''
(|={
E1
,
E
}=>
Q
)
(|={
E2
}=>
(
P'
∗
(
coq_tactics
.
maybe_wand
P''
(|={
E1
,
E
}=>
Q
))))%
I
.
Proof
.
rewrite
/
InvOpener
coq_tactics
.
maybe_wand_sound
.
rewrite
/
AccElim
coq_tactics
.
maybe_wand_sound
.
iIntros
"Hinner >[HP Hclose]"
.
iMod
(
"Hinner"
with
"HP"
)
as
"[HP Hfin]"
.
iMod
(
"Hclose"
with
"HP"
)
as
"HP''"
.
by
iApply
"Hfin"
.
...
...
theories/proofmode/classes.v
View file @
6ae49bd9
...
...
@@ -513,21 +513,21 @@ Class IntoInv {PROP : bi} (P: PROP) (N: namespace).
Arguments
IntoInv
{
_
}
_
%
I
_
.
Hint
Mode
IntoInv
+
!
-
:
typeclass_instances
.
(** Typeclass for assertions around which
invariants can be open
ed.
Inputs: [Q]
Outputs:
[E1], [E2], [P], [P'],
[Q']
Transforms the goal [Q] into the goal [Q'] where additional assumptions [P]
are available, obtaining may require accessing invariants. Later,
[
P
']
has
t
o be given up aga
in
to
close these invariants again, which will
produce [P'']. If [P''] is None,
that signifies [emp] and will be used to
make the goal shown to the user
nicer (i.e., no unnecessary hypothesis is
added)
*)
Class
InvOpener
`
{
BiFUpd
PROP
}
E1
E2
(
P
P'
:
PROP
)
(
P''
:
option
PROP
)
(
Q
Q'
:
PROP
)
:
=
inv_opener
:
((
P
-
∗
Q'
)
-
∗
(|={
E1
,
E2
}=>
P
∗
(
P'
={
E2
,
E1
}=
∗
default
emp
P''
id
))
-
∗
Q
).
Arguments
InvOpener
{
_
}
{
_
}
_
_
_
%
I
_
%
I
_
%
I
_
%
I
:
simpl
never
.
Arguments
inv_opener
{
_
}
{
_
}
_
_
_
%
I
_
%
I
_
%
I
_
%
I
{
_
}.
Hint
Mode
InvOpener
+
+
-
-
-
-
-
!
-
:
typeclass_instances
.
(** Typeclass for assertions around which
accessors can be elliminat
ed.
Inputs: [Q]
, [P], [P'], [P'']
Outputs: [Q']
In/Out (can be an evar and will not usually be instantiated): [E1], [E2]
Elliminates an accessor [|={E1,E2}=> P ∗ (P' ={E2,E1}=∗ P'')] in goal
[
Q
']
,
t
urning the goal
into
[Q'] with a new assumption [P]. If [P''] is None,
that signifies [emp] and will be used to
make the goal shown to the user
nicer (i.e., no unnecessary hypothesis is
added). [φ] is a Coq-level
side-condition that will be attempted to be discharged by solve_ndisj.
*)
Class
AccElim
`
{
BiFUpd
PROP
}
E1
E2
(
P
P'
:
PROP
)
(
P''
:
option
PROP
)
(
Q
Q'
:
PROP
)
:
=
acc_elim
:
((
P
-
∗
Q'
)
-
∗
(|={
E1
,
E2
}=>
P
∗
(
P'
={
E2
,
E1
}=
∗
default
emp
P''
id
))
-
∗
Q
).
Arguments
AccElim
{
_
}
{
_
}
_
_
_
%
I
_
%
I
_
%
I
_
%
I
:
simpl
never
.
Arguments
acc_elim
{
_
}
{
_
}
_
_
_
%
I
_
%
I
_
%
I
_
%
I
{
_
}.
Hint
Mode
AccElim
+
+
-
-
!
!
!
!
-
:
typeclass_instances
.
(* Input: [Pinv]
Arguments:
...
...
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