Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Iris
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Ike Mulder
Iris
Commits
236891e9
Commit
236891e9
authored
8 years ago
by
Ralf Jung
Browse files
Options
Downloads
Patches
Plain Diff
Add a rule to alloocate an invariant and open it
Fixes #59 Proof entirely by
@janno
parent
65b9ce9f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
theories/base_logic/lib/invariants.v
+27
-0
27 additions, 0 deletions
theories/base_logic/lib/invariants.v
theories/base_logic/lib/wsat.v
+24
-0
24 additions, 0 deletions
theories/base_logic/lib/wsat.v
with
51 additions
and
0 deletions
theories/base_logic/lib/invariants.v
+
27
−
0
View file @
236891e9
...
...
@@ -41,6 +41,33 @@ Proof.
-
rewrite
/
uPred_except_0
;
eauto
.
Qed
.
Lemma
inv_alloc_open
N
E
P
:
↑
N
⊆
E
→
True
=
{
E
,
E
∖↑
N
}
=∗
inv
N
P
∗
(
▷
P
=
{
E
∖↑
N
,
E
}
=∗
True
)
.
Proof
.
rewrite
inv_eq
/
inv_def
fupd_eq
/
fupd_def
.
iIntros
(
Sub
)
"[Hw HE]"
.
iMod
(
ownI_alloc_open
(
∈
↑
N
)
P
with
"Hw"
)
as
(
i
)
"(% & Hw & #Hi & HD)"
.
-
intros
Ef
.
exists
(
coPpick
(
↑
N
∖
coPset
.
of_gset
Ef
))
.
rewrite
-
coPset
.
elem_of_of_gset
comm
-
elem_of_difference
.
apply
coPpick_elem_of
=>
Hfin
.
eapply
nclose_infinite
,
(
difference_finite_inv
_
_),
Hfin
.
apply
of_gset_finite
.
-
iAssert
(
ownE
{[
i
]}
∗
ownE
(
↑
N
∖
{[
i
]})
∗
ownE
(
E
∖
↑
N
))
%
I
with
"[HE]"
as
"(HEi & HEN\i & HE\N)"
.
{
rewrite
-
?ownE_op
;
[|
set_solver
|
set_solver
]
.
rewrite
assoc_L
.
rewrite
<-!
union_difference_L
;
try
done
;
set_solver
.
}
iModIntro
.
rewrite
/
uPred_except_0
.
iRight
.
iFrame
.
iSplitL
"Hw HEi"
.
+
by
iApply
"Hw"
.
+
iSplitL
"Hi"
;
[
eauto
|]
.
iIntros
"HP [Hw HE\N]"
.
iDestruct
(
ownI_close
with
"[$Hw $Hi $HP $HD]"
)
as
"[? HEi]"
.
iModIntro
.
iRight
.
iFrame
.
iSplitL
;
[|
done
]
.
iCombine
"HEi"
"HEN\i"
as
"HEN"
.
iCombine
"HEN"
"HE\N"
as
"HE"
.
rewrite
-
?ownE_op
;
[|
set_solver
|
set_solver
]
.
rewrite
<-!
union_difference_L
;
try
done
;
set_solver
.
Qed
.
Lemma
inv_open
E
N
P
:
↑
N
⊆
E
→
inv
N
P
=
{
E
,
E
∖↑
N
}
=∗
▷
P
∗
(
▷
P
=
{
E
∖↑
N
,
E
}
=∗
True
)
.
Proof
.
...
...
This diff is collapsed.
Click to expand it.
theories/base_logic/lib/wsat.v
+
24
−
0
View file @
236891e9
...
...
@@ -142,4 +142,28 @@ Proof.
iApply
(
big_sepM_insert
_
I
);
first
done
.
iFrame
"HI"
.
iLeft
.
by
rewrite
/
ownD
;
iFrame
.
Qed
.
Lemma
ownI_alloc_open
φ
P
:
(
∀
E
:
gset
positive
,
∃
i
,
i
∉
E
∧
φ
i
)
→
wsat
==∗
∃
i
,
⌜
φ
i
⌝
∗
(
ownE
{[
i
]}
-∗
wsat
)
∗
ownI
i
P
∗
ownD
{[
i
]}
.
Proof
.
iIntros
(
Hfresh
)
"Hw"
.
iDestruct
"Hw"
as
(
I
)
"[? HI]"
.
iMod
(
own_empty
(
gset_disjUR
positive
)
disabled_name
)
as
"HD"
.
iMod
(
own_updateP
with
"HD"
)
as
"HD"
.
{
apply
(
gset_disj_alloc_empty_updateP_strong'
(
λ
i
,
I
!!
i
=
None
∧
φ
i
))
.
intros
E
.
destruct
(
Hfresh
(
E
∪
dom
_
I
))
as
(
i
&
[?
HIi
%
not_elem_of_dom
]
%
not_elem_of_union
&
?);
eauto
.
}
iDestruct
"HD"
as
(
X
)
"[Hi HD]"
;
iDestruct
"Hi"
as
%
(
i
&
->
&
HIi
&
?)
.
iMod
(
own_update
with
"Hw"
)
as
"[Hw HiP]"
.
{
eapply
auth_update_alloc
,
(
alloc_singleton_local_update
_
i
(
invariant_unfold
P
));
last
done
.
by
rewrite
/=
lookup_fmap
HIi
.
}
iModIntro
;
iExists
i
;
iSplit
;
[
done
|]
.
rewrite
/
ownI
;
iFrame
"HiP"
.
rewrite
-/
(
ownD
_)
.
iFrame
"HD"
.
iIntros
"HE"
.
iExists
(
<
[
i
:=
P
]
>
I
);
iSplitL
"Hw"
.
{
by
rewrite
fmap_insert
insert_singleton_op
?lookup_fmap
?HIi
.
}
iApply
(
big_sepM_insert
_
I
);
first
done
.
iFrame
"HI"
.
by
iRight
.
Qed
.
End
wsat
.
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment