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
Terraform modules
Monitor
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
Pierre Roux
Iris
Commits
f66d2618
Commit
f66d2618
authored
4 years ago
by
Ralf Jung
Browse files
Options
Downloads
Patches
Plain Diff
ghost-var lib: more lemmas for when you own the two halves
parent
892dfbb6
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/algebra/lib/frac_agree.v
+4
-0
4 additions, 0 deletions
theories/algebra/lib/frac_agree.v
theories/base_logic/lib/ghost_var.v
+16
-3
16 additions, 3 deletions
theories/base_logic/lib/ghost_var.v
with
20 additions
and
3 deletions
theories/algebra/lib/frac_agree.v
+
4
−
0
View file @
f66d2618
...
@@ -25,6 +25,10 @@ Section lemmas.
...
@@ -25,6 +25,10 @@ Section lemmas.
Global
Instance
to_frac_inj
:
Inj2
(
≡
)
(
≡
)
(
≡
)
(
@
to_frac_agree
A
)
.
Global
Instance
to_frac_inj
:
Inj2
(
≡
)
(
≡
)
(
≡
)
(
@
to_frac_agree
A
)
.
Proof
.
by
intros
q1
a1
q2
a2
[??
%
(
inj
to_agree
)]
.
Qed
.
Proof
.
by
intros
q1
a1
q2
a2
[??
%
(
inj
to_agree
)]
.
Qed
.
Lemma
frac_agree_op
q1
q2
a
:
to_frac_agree
(
q1
+
q2
)
a
≡
to_frac_agree
q1
a
⋅
to_frac_agree
q2
a
.
Proof
.
rewrite
/
to_frac_agree
-
pair_op
agree_idemp
//.
Qed
.
Lemma
frac_agree_op_valid
q1
a1
q2
a2
:
Lemma
frac_agree_op_valid
q1
a1
q2
a2
:
✓
(
to_frac_agree
q1
a1
⋅
to_frac_agree
q2
a2
)
→
✓
(
to_frac_agree
q1
a1
⋅
to_frac_agree
q2
a2
)
→
✓
(
q1
+
q2
)
%
Qp
∧
a1
≡
a2
.
✓
(
q1
+
q2
)
%
Qp
∧
a1
≡
a2
.
...
...
This diff is collapsed.
Click to expand it.
theories/base_logic/lib/ghost_var.v
+
16
−
3
View file @
f66d2618
...
@@ -30,7 +30,7 @@ Section lemmas.
...
@@ -30,7 +30,7 @@ Section lemmas.
Proof
.
apply
_
.
Qed
.
Proof
.
apply
_
.
Qed
.
Global
Instance
ghost_var_fractional
γ
a
:
Fractional
(
λ
q
,
ghost_var
γ
q
a
)
.
Global
Instance
ghost_var_fractional
γ
a
:
Fractional
(
λ
q
,
ghost_var
γ
q
a
)
.
Proof
.
intros
q1
q2
.
rewrite
/
ghost_var
-
own_op
-
pair_op
agree_
idem
p
//.
Qed
.
Proof
.
intros
q1
q2
.
rewrite
/
ghost_var
-
own_op
-
frac_
agree_
o
p
//.
Qed
.
Global
Instance
ghost_var_as_fractional
γ
a
q
:
Global
Instance
ghost_var_as_fractional
γ
a
q
:
AsFractional
(
ghost_var
γ
q
a
)
(
λ
q
,
ghost_var
γ
q
a
)
q
.
AsFractional
(
ghost_var
γ
q
a
)
(
λ
q
,
ghost_var
γ
q
a
)
q
.
Proof
.
split
.
done
.
apply
_
.
Qed
.
Proof
.
split
.
done
.
apply
_
.
Qed
.
...
@@ -43,7 +43,7 @@ Section lemmas.
...
@@ -43,7 +43,7 @@ Section lemmas.
⊢
|
==>
∃
γ
,
ghost_var
γ
1
a
.
⊢
|
==>
∃
γ
,
ghost_var
γ
1
a
.
Proof
.
iApply
own_alloc
.
done
.
Qed
.
Proof
.
iApply
own_alloc
.
done
.
Qed
.
Lemma
ghost_var_
op_
valid
γ
a1
q1
a2
q2
:
Lemma
ghost_var_valid
_2
γ
a1
q1
a2
q2
:
ghost_var
γ
q1
a1
-∗
ghost_var
γ
q2
a2
-∗
⌜✓
(
q1
+
q2
)
%
Qp
∧
a1
=
a2
⌝.
ghost_var
γ
q1
a1
-∗
ghost_var
γ
q2
a2
-∗
⌜✓
(
q1
+
q2
)
%
Qp
∧
a1
=
a2
⌝.
Proof
.
Proof
.
iIntros
"Hvar1 Hvar2"
.
iIntros
"Hvar1 Hvar2"
.
...
@@ -61,7 +61,20 @@ Section lemmas.
...
@@ -61,7 +61,20 @@ Section lemmas.
ghost_var
γ
1
a
==∗
ghost_var
γ
1
b
.
ghost_var
γ
1
a
==∗
ghost_var
γ
1
b
.
Proof
.
Proof
.
iApply
own_update
.
apply
cmra_update_exclusive
.
done
.
iApply
own_update
.
apply
cmra_update_exclusive
.
done
.
Qed
.
Qed
.
Lemma
ghost_var_update_2
b
γ
a1
q1
a2
q2
:
(
q1
+
q2
=
1
)
%
Qp
→
ghost_var
γ
q1
a1
-∗
ghost_var
γ
q2
a2
==∗
ghost_var
γ
q1
b
∗
ghost_var
γ
q2
b
.
Proof
.
iIntros
(
Hq
)
"[H1 H2]"
.
iDestruct
(
ghost_var_valid_2
with
"H1 H2"
)
as
%
[_
->
]
.
iCombine
"H1 H2"
as
"H"
.
rewrite
-
frac_agree_op
Hq
.
iMod
(
ghost_var_update
with
"H"
)
as
"H"
.
rewrite
-
Hq
.
iApply
ghost_var_split
.
done
.
Qed
.
Lemma
ghost_var_update_halves
b
γ
a1
a2
:
ghost_var
γ
(
1
/
2
)
a1
-∗
ghost_var
γ
(
1
/
2
)
a2
==∗
ghost_var
γ
(
1
/
2
)
b
∗
ghost_var
γ
(
1
/
2
)
b
.
Proof
.
iApply
ghost_var_update_2
.
apply
Qp_half_half
.
Qed
.
End
lemmas
.
End
lemmas
.
...
...
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