Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Lennard Gäher
Iris
Commits
fe2b525c
Commit
fe2b525c
authored
Mar 24, 2021
by
Ralf Jung
Browse files
use the new pattern features in a few places to shorten proofs a bit
parent
93ae382f
Changes
4
Hide whitespace changes
Inline
Side-by-side
iris/base_logic/lib/gen_heap.v
View file @
fe2b525c
...
@@ -196,7 +196,7 @@ Section gen_heap.
...
@@ -196,7 +196,7 @@ Section gen_heap.
meta_token
l
E1
-
∗
meta_token
l
E2
-
∗
meta_token
l
(
E1
∪
E2
).
meta_token
l
E1
-
∗
meta_token
l
E2
-
∗
meta_token
l
(
E1
∪
E2
).
Proof
.
Proof
.
rewrite
meta_token_eq
/
meta_token_def
.
rewrite
meta_token_eq
/
meta_token_def
.
i
Destruct
1
as
(
γ
m1
)
"[
#Hγm1 Hm1
]"
.
iDestruct
1
as
(
γ
m2
)
"[
#Hγm2 Hm2
]
"
.
i
Intros
"(%γm1 &
#Hγm1
&
Hm1
)
(
%
γm2
&
#Hγm2
&
Hm2
)
"
.
iDestruct
(
ghost_map_elem_valid_2
with
"Hγm1 Hγm2"
)
as
%[
_
->].
iDestruct
(
ghost_map_elem_valid_2
with
"Hγm1 Hγm2"
)
as
%[
_
->].
iDestruct
(
own_valid_2
with
"Hm1 Hm2"
)
as
%?%
reservation_map_token_valid_op
.
iDestruct
(
own_valid_2
with
"Hm1 Hm2"
)
as
%?%
reservation_map_token_valid_op
.
iExists
γ
m2
.
iFrame
"Hγm2"
.
rewrite
reservation_map_token_union
//.
by
iSplitL
"Hm1"
.
iExists
γ
m2
.
iFrame
"Hγm2"
.
rewrite
reservation_map_token_union
//.
by
iSplitL
"Hm1"
.
...
@@ -219,7 +219,7 @@ Section gen_heap.
...
@@ -219,7 +219,7 @@ Section gen_heap.
meta
l
i
x1
-
∗
meta
l
i
x2
-
∗
⌜
x1
=
x2
⌝
.
meta
l
i
x1
-
∗
meta
l
i
x2
-
∗
⌜
x1
=
x2
⌝
.
Proof
.
Proof
.
rewrite
meta_eq
/
meta_def
.
rewrite
meta_eq
/
meta_def
.
i
Destruct
1
as
(
γ
m1
)
"[
Hγm1 Hm1
]"
;
iDestruct
1
as
(
γ
m2
)
"[
Hγm2 Hm2
]
"
.
i
Intros
"(%γm1 &
Hγm1
&
Hm1
)
(
%
γm2
&
Hγm2
&
Hm2
)
"
.
iDestruct
(
ghost_map_elem_valid_2
with
"Hγm1 Hγm2"
)
as
%[
_
->].
iDestruct
(
ghost_map_elem_valid_2
with
"Hγm1 Hγm2"
)
as
%[
_
->].
iDestruct
(
own_valid_2
with
"Hm1 Hm2"
)
as
%
H
γ
;
iPureIntro
.
iDestruct
(
own_valid_2
with
"Hm1 Hm2"
)
as
%
H
γ
;
iPureIntro
.
move
:
H
γ
.
rewrite
-
reservation_map_data_op
reservation_map_data_valid
.
move
:
H
γ
.
rewrite
-
reservation_map_data_op
reservation_map_data_valid
.
...
...
iris/base_logic/lib/na_invariants.v
View file @
fe2b525c
...
@@ -45,7 +45,7 @@ Section proofs.
...
@@ -45,7 +45,7 @@ Section proofs.
Lemma
na_inv_iff
p
N
P
Q
:
na_inv
p
N
P
-
∗
▷
□
(
P
↔
Q
)
-
∗
na_inv
p
N
Q
.
Lemma
na_inv_iff
p
N
P
Q
:
na_inv
p
N
P
-
∗
▷
□
(
P
↔
Q
)
-
∗
na_inv
p
N
Q
.
Proof
.
Proof
.
iIntros
"HI #HPQ"
.
rewrite
/
na_inv
.
iDestruct
"HI"
as
(
i
?)
"HI
"
.
rewrite
/
na_inv
.
iIntros
"(%i & % & HI) #HPQ
"
.
iExists
i
.
iSplit
;
first
done
.
iApply
(
inv_iff
with
"HI"
).
iExists
i
.
iSplit
;
first
done
.
iApply
(
inv_iff
with
"HI"
).
iIntros
"!> !>"
.
iIntros
"!> !>"
.
iSplit
;
iIntros
"[[? Ho]|$]"
;
iLeft
;
iFrame
"Ho"
;
by
iApply
"HPQ"
.
iSplit
;
iIntros
"[[? Ho]|$]"
;
iLeft
;
iFrame
"Ho"
;
by
iApply
"HPQ"
.
...
@@ -97,8 +97,7 @@ Section proofs.
...
@@ -97,8 +97,7 @@ Section proofs.
na_inv
p
N
P
-
∗
na_own
p
F
={
E
}=
∗
▷
P
∗
na_own
p
(
F
∖↑
N
)
∗
na_inv
p
N
P
-
∗
na_own
p
F
={
E
}=
∗
▷
P
∗
na_own
p
(
F
∖↑
N
)
∗
(
▷
P
∗
na_own
p
(
F
∖↑
N
)
={
E
}=
∗
na_own
p
F
).
(
▷
P
∗
na_own
p
(
F
∖↑
N
)
={
E
}=
∗
na_own
p
F
).
Proof
.
Proof
.
rewrite
/
na_inv
.
iIntros
(??)
"#Hnainv Htoks"
.
rewrite
/
na_inv
.
iIntros
(??)
"#(%i & % & Hinv) Htoks"
.
iDestruct
"Hnainv"
as
(
i
)
"[% Hinv]"
.
rewrite
[
F
as
X
in
na_own
p
X
](
union_difference_L
(
↑
N
)
F
)
//.
rewrite
[
F
as
X
in
na_own
p
X
](
union_difference_L
(
↑
N
)
F
)
//.
rewrite
[
X
in
(
X
∪
_
)](
union_difference_L
{[
i
]}
(
↑
N
))
?na_own_union
;
[|
set_solver
..].
rewrite
[
X
in
(
X
∪
_
)](
union_difference_L
{[
i
]}
(
↑
N
))
?na_own_union
;
[|
set_solver
..].
iDestruct
"Htoks"
as
"[[Htoki $] $]"
.
iDestruct
"Htoks"
as
"[[Htoki $] $]"
.
...
...
iris_heap_lang/lib/array.v
View file @
fe2b525c
...
@@ -234,7 +234,7 @@ Section proof.
...
@@ -234,7 +234,7 @@ Section proof.
Proof
.
Proof
.
iIntros
"Hvs"
.
iInduction
vs
as
[|
v
vs
]
"IH"
forall
(
Q
)
;
simpl
.
iIntros
"Hvs"
.
iInduction
vs
as
[|
v
vs
]
"IH"
forall
(
Q
)
;
simpl
.
{
iExists
[].
by
auto
.
}
{
iExists
[].
by
auto
.
}
iDestruct
"Hvs"
as
"[
Hv Hvs]"
;
iDestruct
"Hv"
as
(
x
->
)
"
Hv"
.
iDestruct
"Hvs"
as
"[
(%x & -> & Hv
) Hv
s]
"
.
iDestruct
(
"IH"
with
"Hvs"
)
as
(
xs
->)
"Hxs"
.
iDestruct
(
"IH"
with
"Hvs"
)
as
(
xs
->)
"Hxs"
.
iExists
(
x
::
xs
).
by
iFrame
.
iExists
(
x
::
xs
).
by
iFrame
.
Qed
.
Qed
.
...
...
iris_heap_lang/lib/ticket_lock.v
View file @
fe2b525c
...
@@ -65,7 +65,7 @@ Section proof.
...
@@ -65,7 +65,7 @@ Section proof.
Lemma
locked_exclusive
(
γ
:
gname
)
:
locked
γ
-
∗
locked
γ
-
∗
False
.
Lemma
locked_exclusive
(
γ
:
gname
)
:
locked
γ
-
∗
locked
γ
-
∗
False
.
Proof
.
Proof
.
i
Destruct
1
as
(
o1
)
"H1"
.
iDestruct
1
as
(
o2
)
"
H2"
.
i
Intros
"[%σ1 H1] [%σ2
H2
]
"
.
iDestruct
(
own_valid_2
with
"H1 H2"
)
as
%[[]
_
]%
auth_frag_op_valid_1
.
iDestruct
(
own_valid_2
with
"H1 H2"
)
as
%[[]
_
]%
auth_frag_op_valid_1
.
Qed
.
Qed
.
...
@@ -74,7 +74,7 @@ Section proof.
...
@@ -74,7 +74,7 @@ Section proof.
Proof
.
Proof
.
iDestruct
1
as
(
lo
ln
->)
"#Hinv"
;
iIntros
"#HR"
.
iDestruct
1
as
(
lo
ln
->)
"#Hinv"
;
iIntros
"#HR"
.
iExists
lo
,
ln
;
iSplit
;
[
done
|].
iApply
(
inv_iff
with
"Hinv"
).
iExists
lo
,
ln
;
iSplit
;
[
done
|].
iApply
(
inv_iff
with
"Hinv"
).
iIntros
"!> !>"
;
iSplit
;
i
Destruct
1
as
(
o
n
)
"(
Ho & Hn & H● & H)"
;
iIntros
"!> !>"
;
iSplit
;
i
Intros
"(%o & %n &
Ho & Hn & H● & H)"
;
iExists
o
,
n
;
iFrame
"Ho Hn H●"
;
iExists
o
,
n
;
iFrame
"Ho Hn H●"
;
(
iDestruct
"H"
as
"[[H◯ H]|H◯]"
;
[
iLeft
;
iFrame
"H◯"
;
by
iApply
"HR"
|
by
iRight
]).
(
iDestruct
"H"
as
"[[H◯ H]|H◯]"
;
[
iLeft
;
iFrame
"H◯"
;
by
iApply
"HR"
|
by
iRight
]).
Qed
.
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