Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Jonas Kastberg
iris
Commits
c9707f98
Commit
c9707f98
authored
Oct 29, 2017
by
Ralf Jung
Committed by
Robbert Krebbers
Nov 15, 2017
Browse files
generalize savedProp to let the user control the position of the type-level later
parent
60c28208
Changes
1
Hide whitespace changes
Inline
Side-by-side
theories/base_logic/lib/saved_prop.v
View file @
c9707f98
...
...
@@ -5,16 +5,17 @@ Set Default Proof Using "Type".
Import
uPred
.
Class
savedPropG
(
Σ
:
gFunctors
)
(
F
:
cFunctor
)
:
=
saved_prop_inG
:
>
inG
Σ
(
agreeR
(
laterC
(
F
(
iPreProp
Σ
)))
)
.
Definition
savedProp
Σ
(
F
:
cFunctor
)
:
gFunctors
:
=
#[
GFunctor
(
agreeRF
(
▶
F
)
)
].
saved_prop_inG
:
>
inG
Σ
(
agreeR
(
F
(
iPreProp
Σ
))).
Definition
savedProp
Σ
(
F
:
cFunctor
)
`
{!
cFunctorContractive
F
}
:
gFunctors
:
=
#[
GFunctor
(
agreeRF
F
)
].
Instance
subG_savedProp
Σ
{
Σ
F
}
:
subG
(
savedProp
Σ
F
)
Σ
→
savedPropG
Σ
F
.
Instance
subG_savedProp
Σ
{
Σ
F
}
`
{!
cFunctorContractive
F
}
:
subG
(
savedProp
Σ
F
)
Σ
→
savedPropG
Σ
F
.
Proof
.
solve_inG
.
Qed
.
Definition
saved_prop_own
`
{
savedPropG
Σ
F
}
(
γ
:
gname
)
(
x
:
F
(
iProp
Σ
))
:
iProp
Σ
:
=
own
γ
(
to_agree
$
Next
(
cFunctor_map
F
(
iProp_fold
,
iProp_unfold
)
x
)).
own
γ
(
to_agree
$
(
cFunctor_map
F
(
iProp_fold
,
iProp_unfold
)
x
)).
Typeclasses
Opaque
saved_prop_own
.
Instance
:
Params
(@
saved_prop_own
)
3
.
...
...
@@ -34,15 +35,15 @@ Section saved_prop.
Proof
.
by
apply
own_alloc
.
Qed
.
Lemma
saved_prop_agree
γ
x
y
:
saved_prop_own
γ
x
-
∗
saved_prop_own
γ
y
-
∗
▷
(
x
≡
y
)
.
saved_prop_own
γ
x
-
∗
saved_prop_own
γ
y
-
∗
x
≡
y
.
Proof
.
apply
wand_intro_r
.
rewrite
-
own_op
own_valid
agree_validI
agree_equivI
later_equivI
.
rewrite
-
own_op
own_valid
agree_validI
agree_equivI
.
set
(
G1
:
=
cFunctor_map
F
(
iProp_fold
,
iProp_unfold
)).
set
(
G2
:
=
cFunctor_map
F
(@
iProp_unfold
Σ
,
@
iProp_fold
Σ
)).
assert
(
∀
z
,
G2
(
G1
z
)
≡
z
)
as
help
.
{
intros
z
.
rewrite
/
G1
/
G2
-
cFunctor_compose
-{
2
}[
z
]
cFunctor_id
.
apply
(
ne_proper
(
cFunctor_map
F
))
;
split
=>?
;
apply
iProp_fold_unfold
.
}
rewrite
-{
2
}[
x
]
help
-{
2
}[
y
]
help
.
apply
later_mono
,
f_equiv
,
_
.
rewrite
-{
2
}[
x
]
help
-{
2
}[
y
]
help
.
apply
f_equiv
,
_
.
Qed
.
End
saved_prop
.
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment