Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Rodolphe Lepigre
Iris
Commits
c83f4824
Commit
c83f4824
authored
Sep 08, 2019
by
Jacques-Henri Jourdan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Better ElimAcc instances for monPred_at.
parent
066354af
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
49 additions
and
29 deletions
+49
-29
tests/proofmode_monpred.v
tests/proofmode_monpred.v
+25
-0
theories/proofmode/monpred.v
theories/proofmode/monpred.v
+24
-29
No files found.
tests/proofmode_monpred.v
View file @
c83f4824
From
iris
.
proofmode
Require
Import
tactics
monpred
.
From
iris
.
base_logic
.
lib
Require
Import
invariants
.
Set
Ltac
Backtrace
.
Section
tests
.
...
...
@@ -168,3 +169,27 @@ Section tests.
Proof
.
iIntros
"HP"
.
iExists
_
.
Fail
iFrame
"HP"
.
Abort
.
End
tests
.
Section
tests_iprop
.
Context
{
I
:
biIndex
}
`
{!
invG
Σ
}.
Local
Notation
monPred
:
=
(
monPred
I
(
iPropI
Σ
)).
Implicit
Types
P
:
iProp
Σ
.
Lemma
test_iInv_0
N
P
:
embed
(
B
:
=
monPred
)
(
inv
N
(<
pers
>
P
))
={
⊤
}=
∗
⎡▷
P
⎤
.
Proof
.
iIntros
"#H"
.
iInv
N
as
"#H2"
.
Show
.
iModIntro
.
iSplit
=>//.
iModIntro
.
iModIntro
;
auto
.
Qed
.
Lemma
test_iInv_0_with_close
N
P
:
embed
(
B
:
=
monPred
)
(
inv
N
(<
pers
>
P
))
={
⊤
}=
∗
⎡▷
P
⎤
.
Proof
.
iIntros
"#H"
.
iInv
N
as
"#H2"
"Hclose"
.
Show
.
iMod
(
"Hclose"
with
"H2"
).
iModIntro
.
iModIntro
.
by
iNext
.
Qed
.
End
tests_iprop
.
theories/proofmode/monpred.v
View file @
c83f4824
...
...
@@ -557,34 +557,30 @@ Global Instance elim_modal_at_fupd_hyp `{BiFUpd PROP} φ p p' E1 E2 P 𝓟 𝓟'
ElimModal
φ
p
p'
((|={
E1
,
E2
}=>
P
)
i
)
𝓟
'
𝓠
𝓠
'
.
Proof
.
by
rewrite
/
MakeMonPredAt
/
ElimModal
monPred_at_fupd
=><-.
Qed
.
(* This instances are awfully specific, but that's what is needed. *)
Global
Instance
elim_acc_at_fupd
`
{
BiFUpd
PROP
}
{
X
:
Type
}
E1
E2
E
M1
M2
α
β
(
m
γ
:
X
→
option
PROP
)
Q
(
Q'
:
X
→
monPred
)
i
:
ElimAcc
(
X
:
=
X
)
M1
M2
α
β
m
γ
(|={
E1
,
E
}=>
Q
i
)
(
λ
x
,
|={
E2
}=>
β
x
∗
(
m
γ
x
-
∗
?
|={
E1
,
E
}=>
Q'
x
i
))%
I
→
ElimAcc
(
X
:
=
X
)
M1
M2
α
β
m
γ
((|={
E1
,
E
}=>
Q
)
i
)
(
λ
x
,
(|={
E2
}=>
⎡β
x
⎤
∗
(
match
m
γ
x
with
Some
𝓟
=>
Some
⎡𝓟⎤
|
None
=>
None
end
-
∗
?
|={
E1
,
E
}=>
Q'
x
))
i
)%
I
|
1
.
Proof
.
rewrite
/
ElimAcc
monPred_at_fupd
=><-.
apply
bi
.
forall_mono
=>
x
.
destruct
(
m
γ
x
)
;
simpl
.
-
rewrite
monPred_at_fupd
monPred_at_sep
monPred_wand_force
monPred_at_fupd
!
monPred_at_embed
//.
-
rewrite
monPred_at_fupd
monPred_at_sep
monPred_at_fupd
!
monPred_at_embed
//.
Qed
.
(* A separate, higher-priority instance for unit because otherwise unification
fails. *)
Global
Instance
elim_acc_at_fupd_unit
`
{
BiFUpd
PROP
}
E1
E2
E
M1
M2
α
β
m
γ
Q
Q'
i
:
ElimAcc
(
X
:
=
unit
)
M1
M2
α
β
m
γ
(|={
E1
,
E
}=>
Q
i
)
(
λ
x
,
|={
E2
}=>
β
x
∗
(
m
γ
x
-
∗
?
|={
E1
,
E
}=>
Q'
i
))%
I
→
ElimAcc
(
X
:
=
unit
)
M1
M2
α
β
m
γ
((|={
E1
,
E
}=>
Q
)
i
)
(
λ
x
,
(|={
E2
}=>
⎡β
x
⎤
∗
(
match
m
γ
x
with
Some
𝓟
=>
Some
⎡𝓟⎤
|
None
=>
None
end
-
∗
?
|={
E1
,
E
}=>
Q'
))
i
)%
I
|
0
.
Proof
.
exact
:
elim_acc_at_fupd
.
Qed
.
Global
Instance
elim_acc_at_None
`
{
BiFUpd
PROP
}
{
X
}
E1
E2
E3
E4
α
α
'
β
β
'
P
P'x
V
:
(
∀
x
,
MakeEmbed
(
α
x
)
(
α
'
x
))
→
(
∀
x
,
MakeEmbed
(
β
x
)
(
β
'
x
))
→
ElimAcc
(
X
:
=
X
)
(
fupd
E1
E2
)
(
fupd
E3
E4
)
α
'
β
'
(
λ
_
,
None
)
P
P'x
→
ElimAcc
(
X
:
=
X
)
(
fupd
E1
E2
)
(
fupd
E3
E4
)
α
β
(
λ
_
,
None
)
(
P
V
)
(
λ
x
,
P'x
x
V
).
Proof
.
rewrite
/
ElimAcc
/
MakeEmbed
.
iIntros
(
H
α
H
β
HEA
)
"Hinner Hacc"
.
iApply
(
HEA
with
"[Hinner]"
).
-
iIntros
(
x
).
iSpecialize
(
"Hinner"
$!
x
).
rewrite
-
H
α
.
by
iIntros
(?
<-).
-
iMod
"Hacc"
.
iDestruct
"Hacc"
as
(
x
)
"[Hα Hclose]"
.
iModIntro
.
iExists
x
.
rewrite
-
H
α
-
H
β
.
iFrame
.
iIntros
(?
_
)
"Hβ"
.
by
iApply
"Hclose"
.
Qed
.
Global
Instance
elim_acc_at_Some
`
{
BiFUpd
PROP
}
{
X
}
E1
E2
E3
E4
α
α
'
β
β
'
γ
γ
'
P
P'x
V
:
(
∀
x
,
MakeEmbed
(
α
x
)
(
α
'
x
))
→
(
∀
x
,
MakeEmbed
(
β
x
)
(
β
'
x
))
→
(
∀
x
,
MakeEmbed
(
γ
x
)
(
γ
'
x
))
→
ElimAcc
(
X
:
=
X
)
(
fupd
E1
E2
)
(
fupd
E3
E4
)
α
'
β
'
(
λ
x
,
Some
(
γ
'
x
))
P
P'x
→
ElimAcc
(
X
:
=
X
)
(
fupd
E1
E2
)
(
fupd
E3
E4
)
α
β
(
λ
x
,
Some
(
γ
x
))
(
P
V
)
(
λ
x
,
P'x
x
V
).
Proof
.
rewrite
/
ElimAcc
/
MakeEmbed
.
iIntros
(
H
α
H
β
H
γ
HEA
)
"Hinner Hacc"
.
iApply
(
HEA
with
"[Hinner]"
).
-
iIntros
(
x
).
iSpecialize
(
"Hinner"
$!
x
).
rewrite
-
H
α
.
by
iIntros
(?
<-).
-
iMod
"Hacc"
.
iDestruct
"Hacc"
as
(
x
)
"[Hα Hclose]"
.
iModIntro
.
iExists
x
.
rewrite
-
H
α
-
H
β
-
H
γ
.
iFrame
.
iIntros
(?
_
)
"Hβ /="
.
by
iApply
"Hclose"
.
Qed
.
Global
Instance
add_modal_at_fupd_goal
`
{
BiFUpd
PROP
}
E1
E2
𝓟
𝓟
'
Q
i
:
AddModal
𝓟
𝓟
'
(|={
E1
,
E2
}=>
Q
i
)
→
AddModal
𝓟
𝓟
'
((|={
E1
,
E2
}=>
Q
)
i
).
...
...
@@ -615,5 +611,4 @@ Proof.
setoid_rewrite
<-
Hout
.
iIntros
(?)
"(?&?&HQ')"
.
iApply
H
;
[
done
|].
iFrame
.
iIntros
(
x
)
"?"
.
by
iApply
"HQ'"
.
Qed
.
End
sbi
.
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