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
c824cbeb
Commit
c824cbeb
authored
4 years ago
by
Robbert Krebbers
Browse files
Options
Downloads
Patches
Plain Diff
Make everything related to `inG_fold`/`inG_unfold`/`iRes_singleton` local.
parent
741c92b0
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
theories/base_logic/lib/own.v
+18
-16
18 additions, 16 deletions
theories/base_logic/lib/own.v
with
18 additions
and
16 deletions
theories/base_logic/lib/own.v
+
18
−
16
View file @
c824cbeb
...
@@ -55,25 +55,25 @@ Ltac solve_inG :=
...
@@ -55,25 +55,25 @@ Ltac solve_inG :=
split
;
(
assumption
||
by
apply
_)
.
split
;
(
assumption
||
by
apply
_)
.
(** * Definition of the connective [own] *)
(** * Definition of the connective [own] *)
Definition
inG_unfold
{
Σ
A
}
{
i
:
inG
Σ
A
}
:
Local
Definition
inG_unfold
{
Σ
A
}
{
i
:
inG
Σ
A
}
:
inG_apply
i
(
iPropO
Σ
)
-
n
>
inG_apply
i
(
iPrePropO
Σ
)
:=
inG_apply
i
(
iPropO
Σ
)
-
n
>
inG_apply
i
(
iPrePropO
Σ
)
:=
rFunctor_map
_
(
iProp_fold
,
iProp_unfold
)
.
rFunctor_map
_
(
iProp_fold
,
iProp_unfold
)
.
Definition
inG_fold
{
Σ
A
}
{
i
:
inG
Σ
A
}
:
Local
Definition
inG_fold
{
Σ
A
}
{
i
:
inG
Σ
A
}
:
inG_apply
i
(
iPrePropO
Σ
)
-
n
>
inG_apply
i
(
iPropO
Σ
)
:=
inG_apply
i
(
iPrePropO
Σ
)
-
n
>
inG_apply
i
(
iPropO
Σ
)
:=
rFunctor_map
_
(
iProp_unfold
,
iProp_fold
)
.
rFunctor_map
_
(
iProp_unfold
,
iProp_fold
)
.
Definition
iRes_singleton
{
Σ
A
}
{
i
:
inG
Σ
A
}
(
γ
:
gname
)
(
a
:
A
)
:
iResUR
Σ
:=
Local
Definition
iRes_singleton
{
Σ
A
}
{
i
:
inG
Σ
A
}
(
γ
:
gname
)
(
a
:
A
)
:
iResUR
Σ
:=
discrete_fun_singleton
(
inG_id
i
)
discrete_fun_singleton
(
inG_id
i
)
{[
γ
:=
inG_unfold
(
cmra_transport
inG_prf
a
)
]}
.
{[
γ
:=
inG_unfold
(
cmra_transport
inG_prf
a
)
]}
.
Instance
:
Params
(
@
iRes_singleton
)
4
:=
{}
.
Instance
:
Params
(
@
iRes_singleton
)
4
:=
{}
.
Definition
own_def
`{
!
inG
Σ
A
}
(
γ
:
gname
)
(
a
:
A
)
:
iProp
Σ
:=
Local
Definition
own_def
`{
!
inG
Σ
A
}
(
γ
:
gname
)
(
a
:
A
)
:
iProp
Σ
:=
uPred_ownM
(
iRes_singleton
γ
a
)
.
uPred_ownM
(
iRes_singleton
γ
a
)
.
Definition
own_aux
:
seal
(
@
own_def
)
.
Proof
.
by
eexists
.
Qed
.
Local
Definition
own_aux
:
seal
(
@
own_def
)
.
Proof
.
by
eexists
.
Qed
.
Definition
own
:=
own_aux
.(
unseal
)
.
Definition
own
:=
own_aux
.(
unseal
)
.
Arguments
own
{
Σ
A
_}
γ
a
.
Arguments
own
{
Σ
A
_}
γ
a
.
Definition
own_eq
:
@
own
=
@
own_def
:=
own_aux
.(
seal_eq
)
.
Local
Definition
own_eq
:
@
own
=
@
own_def
:=
own_aux
.(
seal_eq
)
.
Instance
:
Params
(
@
own
)
4
:=
{}
.
Local
Instance
:
Params
(
@
own
)
4
:=
{}
.
(** * Properties about ghost ownership *)
(** * Properties about ghost ownership *)
Section
global
.
Section
global
.
...
@@ -81,26 +81,28 @@ Context `{i : !inG Σ A}.
...
@@ -81,26 +81,28 @@ Context `{i : !inG Σ A}.
Implicit
Types
a
:
A
.
Implicit
Types
a
:
A
.
(** ** Properties of [iRes_singleton] *)
(** ** Properties of [iRes_singleton] *)
Lemma
inG_unfold_fold
(
x
:
inG_apply
i
(
iPrePropO
Σ
))
:
inG_unfold
(
inG_fold
x
)
≡
x
.
Local
Lemma
inG_unfold_fold
(
x
:
inG_apply
i
(
iPrePropO
Σ
))
:
inG_unfold
(
inG_fold
x
)
≡
x
.
Proof
.
Proof
.
rewrite
/
inG_unfold
/
inG_fold
-
rFunctor_map_compose
-
{
2
}[
x
]
rFunctor_map_id
.
rewrite
/
inG_unfold
/
inG_fold
-
rFunctor_map_compose
-
{
2
}[
x
]
rFunctor_map_id
.
apply
(
ne_proper
(
rFunctor_map
_));
split
=>
?;
apply
iProp_unfold_fold
.
apply
(
ne_proper
(
rFunctor_map
_));
split
=>
?;
apply
iProp_unfold_fold
.
Qed
.
Qed
.
Lemma
inG_fold_unfold
(
x
:
inG_apply
i
(
iPropO
Σ
))
:
inG_fold
(
inG_unfold
x
)
≡
x
.
Local
Lemma
inG_fold_unfold
(
x
:
inG_apply
i
(
iPropO
Σ
))
:
inG_fold
(
inG_unfold
x
)
≡
x
.
Proof
.
Proof
.
rewrite
/
inG_unfold
/
inG_fold
-
rFunctor_map_compose
-
{
2
}[
x
]
rFunctor_map_id
.
rewrite
/
inG_unfold
/
inG_fold
-
rFunctor_map_compose
-
{
2
}[
x
]
rFunctor_map_id
.
apply
(
ne_proper
(
rFunctor_map
_));
split
=>
?;
apply
iProp_fold_unfold
.
apply
(
ne_proper
(
rFunctor_map
_));
split
=>
?;
apply
iProp_fold_unfold
.
Qed
.
Qed
.
Lemma
inG_unfold_validN
n
(
x
:
inG_apply
i
(
iPropO
Σ
))
:
Local
Lemma
inG_unfold_validN
n
(
x
:
inG_apply
i
(
iPropO
Σ
))
:
✓
{
n
}
(
inG_unfold
x
)
↔
✓
{
n
}
x
.
✓
{
n
}
(
inG_unfold
x
)
↔
✓
{
n
}
x
.
Proof
.
Proof
.
split
;
[|
apply
(
cmra_morphism_validN
_)]
.
split
;
[|
apply
(
cmra_morphism_validN
_)]
.
move
=>
/
(
cmra_morphism_validN
inG_fold
)
.
by
rewrite
inG_fold_unfold
.
move
=>
/
(
cmra_morphism_validN
inG_fold
)
.
by
rewrite
inG_fold_unfold
.
Qed
.
Qed
.
Glob
al
Instance
iRes_singleton_ne
γ
:
NonExpansive
(
@
iRes_singleton
Σ
A
_
γ
)
.
Loc
al
Instance
iRes_singleton_ne
γ
:
NonExpansive
(
@
iRes_singleton
Σ
A
_
γ
)
.
Proof
.
by
intros
n
a
a'
Ha
;
apply
discrete_fun_singleton_ne
;
rewrite
Ha
.
Qed
.
Proof
.
by
intros
n
a
a'
Ha
;
apply
discrete_fun_singleton_ne
;
rewrite
Ha
.
Qed
.
Lemma
iRes_singleton_validI
γ
a
:
✓
(
iRes_singleton
γ
a
)
⊢@
{
iPropI
Σ
}
✓
a
.
Local
Lemma
iRes_singleton_validI
γ
a
:
✓
(
iRes_singleton
γ
a
)
⊢@
{
iPropI
Σ
}
✓
a
.
Proof
.
Proof
.
rewrite
/
iRes_singleton
.
rewrite
/
iRes_singleton
.
rewrite
discrete_fun_validI
(
forall_elim
(
inG_id
i
))
discrete_fun_lookup_singleton
.
rewrite
discrete_fun_validI
(
forall_elim
(
inG_id
i
))
discrete_fun_lookup_singleton
.
...
@@ -108,14 +110,14 @@ Proof.
...
@@ -108,14 +110,14 @@ Proof.
trans
(
✓
cmra_transport
inG_prf
a
:
iProp
Σ
)
%
I
;
last
by
destruct
inG_prf
.
trans
(
✓
cmra_transport
inG_prf
a
:
iProp
Σ
)
%
I
;
last
by
destruct
inG_prf
.
apply
valid_entails
=>
n
.
apply
inG_unfold_validN
.
apply
valid_entails
=>
n
.
apply
inG_unfold_validN
.
Qed
.
Qed
.
Lemma
iRes_singleton_op
γ
a1
a2
:
Local
Lemma
iRes_singleton_op
γ
a1
a2
:
iRes_singleton
γ
(
a1
⋅
a2
)
≡
iRes_singleton
γ
a1
⋅
iRes_singleton
γ
a2
.
iRes_singleton
γ
(
a1
⋅
a2
)
≡
iRes_singleton
γ
a1
⋅
iRes_singleton
γ
a2
.
Proof
.
Proof
.
rewrite
/
iRes_singleton
discrete_fun_singleton_op
singleton_op
cmra_transport_op
.
rewrite
/
iRes_singleton
discrete_fun_singleton_op
singleton_op
cmra_transport_op
.
f_equiv
.
apply
:
singletonM_proper
.
apply
(
cmra_morphism_op
_)
.
f_equiv
.
apply
:
singletonM_proper
.
apply
(
cmra_morphism_op
_)
.
Qed
.
Qed
.
Glob
al
Instance
iRes_singleton_discrete
γ
a
:
Loc
al
Instance
iRes_singleton_discrete
γ
a
:
Discrete
a
→
Discrete
(
iRes_singleton
γ
a
)
.
Discrete
a
→
Discrete
(
iRes_singleton
γ
a
)
.
Proof
.
Proof
.
intros
?
.
rewrite
/
iRes_singleton
.
intros
?
.
rewrite
/
iRes_singleton
.
...
@@ -124,14 +126,14 @@ Proof.
...
@@ -124,14 +126,14 @@ Proof.
{
apply
(
discrete
_)
.
by
rewrite
-
Hx
inG_fold_unfold
.
}
{
apply
(
discrete
_)
.
by
rewrite
-
Hx
inG_fold_unfold
.
}
by
rewrite
Ha
inG_unfold_fold
.
by
rewrite
Ha
inG_unfold_fold
.
Qed
.
Qed
.
Glob
al
Instance
iRes_singleton_core_id
γ
a
:
Loc
al
Instance
iRes_singleton_core_id
γ
a
:
CoreId
a
→
CoreId
(
iRes_singleton
γ
a
)
.
CoreId
a
→
CoreId
(
iRes_singleton
γ
a
)
.
Proof
.
Proof
.
intros
.
apply
discrete_fun_singleton_core_id
,
gmap_singleton_core_id
.
intros
.
apply
discrete_fun_singleton_core_id
,
gmap_singleton_core_id
.
by
rewrite
/
CoreId
-
cmra_morphism_pcore
core_id
.
by
rewrite
/
CoreId
-
cmra_morphism_pcore
core_id
.
Qed
.
Qed
.
Lemma
later_internal_eq_iRes_singleton
γ
a
r
:
Local
Lemma
later_internal_eq_iRes_singleton
γ
a
r
:
▷
(
r
≡
iRes_singleton
γ
a
)
⊢@
{
iPropI
Σ
}
▷
(
r
≡
iRes_singleton
γ
a
)
⊢@
{
iPropI
Σ
}
◇
∃
b
r'
,
r
≡
iRes_singleton
γ
b
⋅
r'
∧
▷
(
a
≡
b
)
.
◇
∃
b
r'
,
r
≡
iRes_singleton
γ
b
⋅
r'
∧
▷
(
a
≡
b
)
.
Proof
.
Proof
.
...
...
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