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
William Mansky
Iris
Commits
5241c33d
Commit
5241c33d
authored
8 years ago
by
Robbert Krebbers
Browse files
Options
Downloads
Patches
Plain Diff
Apply default instance for later stripping not deep in terms.
This fixes issue #55.
parent
8c844e32
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/proofmode/class_instances.v
+81
-25
81 additions, 25 deletions
theories/proofmode/class_instances.v
with
81 additions
and
25 deletions
theories/proofmode/class_instances.v
+
81
−
25
View file @
5241c33d
...
...
@@ -72,53 +72,109 @@ Global Instance into_persistentP_persistent P :
Proof
.
done
.
Qed
.
(* IntoLater *)
(* The class [IntoLaterN] has only two instances:
- The default instance [IntoLaterN n P P], i.e. [▷^n P -∗ P]
- The instance [ProgIntoLaterN n P Q → IntoLaterN n P Q], where [ProgIntoLaterN]
is identical to [IntoLaterN], but computationally is supposed to make
progress, i.e. its instances should actually strip a later.
The point of using the auxilary class [ProgIntoLaterN] is to ensure that the
default instance is not applied deeply in the term, which may cause in too many
definitions being unfolded (see issue #55).
For binary connectives we have the following instances:
<<
ProgIntoLaterN n P P' IntoLaterN n Q Q'
---------------------------------------------
ProgIntoLaterN n (P /\ Q) (P' /\ Q')
ProgIntoLaterN n Q Q'
--------------------------------
IntoLaterN n (P /\ Q) (P /\ Q')
>>
That is, to make progress, a later _should_ be stripped on either the left- or
right-hand side of the binary connective. *)
Class
ProgIntoLaterN
(
n
:
nat
)
(
P
Q
:
uPred
M
)
:=
prog_into_laterN
:
P
⊢
▷^
n
Q
.
Global
Arguments
prog_into_laterN
_
_
_
{_}
.
Global
Instance
into_laterN_default
n
P
:
IntoLaterN
n
P
P
|
1000
.
Proof
.
apply
laterN_intro
.
Qed
.
Global
Instance
into_laterN_progress
P
Q
:
ProgIntoLaterN
n
P
Q
→
IntoLaterN
n
P
Q
.
Proof
.
done
.
Qed
.
Global
Instance
into_laterN_later
n
P
Q
:
IntoLaterN
n
P
Q
→
IntoLaterN
(
S
n
)
(
▷
P
)
Q
.
Proof
.
by
rewrite
/
IntoLaterN
=>
->
.
Qed
.
Global
Instance
into_laterN_laterN
n
P
:
IntoLaterN
n
(
▷^
n
P
)
P
.
IntoLaterN
n
P
Q
→
Prog
IntoLaterN
(
S
n
)
(
▷
P
)
Q
.
Proof
.
by
rewrite
/
IntoLaterN
/
ProgIntoLaterN
=>
->
.
Qed
.
Global
Instance
into_laterN_laterN
n
P
:
Prog
IntoLaterN
n
(
▷^
n
P
)
P
.
Proof
.
done
.
Qed
.
Global
Instance
into_laterN_laterN_plus
n
m
P
Q
:
IntoLaterN
m
P
Q
→
IntoLaterN
(
n
+
m
)
(
▷^
n
P
)
Q
.
Proof
.
rewrite
/
IntoLaterN
=>
->
.
by
rewrite
laterN_plus
.
Qed
.
IntoLaterN
m
P
Q
→
ProgIntoLaterN
(
n
+
m
)
(
▷^
n
P
)
Q
.
Proof
.
rewrite
/
IntoLaterN
/
ProgIntoLaterN
=>
->
.
by
rewrite
laterN_plus
.
Qed
.
Global
Instance
into_laterN_and_l
n
P1
P2
Q1
Q2
:
ProgIntoLaterN
n
P1
Q1
→
IntoLaterN
n
P2
Q2
→
IntoLaterN
n
(
P1
∧
P2
)
(
Q1
∧
Q2
)
.
Proof
.
rewrite
/
ProgIntoLaterN
/
IntoLaterN
=>
->
->
.
by
rewrite
laterN_and
.
Qed
.
Global
Instance
into_laterN_and_r
n
P
P2
Q2
:
ProgIntoLaterN
n
P2
Q2
→
ProgIntoLaterN
n
(
P
∧
P2
)
(
P
∧
Q2
)
.
Proof
.
rewrite
/
ProgIntoLaterN
=>
->
.
by
rewrite
laterN_and
-
(
laterN_intro
_
P
)
.
Qed
.
Global
Instance
into_laterN_and
n
P1
P2
Q1
Q2
:
IntoLaterN
n
P1
Q1
→
IntoLaterN
n
P2
Q2
→
IntoLaterN
n
(
P1
∧
P2
)
(
Q1
∧
Q2
)
.
Proof
.
intros
??;
red
.
by
rewrite
laterN_and
;
apply
and_mono
.
Qed
.
Global
Instance
into_laterN_or
n
P1
P2
Q1
Q2
:
IntoLaterN
n
P1
Q1
→
IntoLaterN
n
P2
Q2
→
IntoLaterN
n
(
P1
∨
P2
)
(
Q1
∨
Q2
)
.
Proof
.
intros
??;
red
.
by
rewrite
laterN_or
;
apply
or_mono
.
Qed
.
Global
Instance
into_laterN_sep
n
P1
P2
Q1
Q2
:
IntoLaterN
n
P1
Q1
→
IntoLaterN
n
P2
Q2
→
IntoLaterN
n
(
P1
∗
P2
)
(
Q1
∗
Q2
)
.
Global
Instance
into_laterN_or_l
n
P1
P2
Q1
Q2
:
ProgIntoLaterN
n
P1
Q1
→
IntoLaterN
n
P2
Q2
→
IntoLaterN
n
(
P1
∨
P2
)
(
Q1
∨
Q2
)
.
Proof
.
rewrite
/
ProgIntoLaterN
/
IntoLaterN
=>
->
->
.
by
rewrite
laterN_or
.
Qed
.
Global
Instance
into_laterN_or_r
n
P
P2
Q2
:
ProgIntoLaterN
n
P2
Q2
→
ProgIntoLaterN
n
(
P
∨
P2
)
(
P
∨
Q2
)
.
Proof
.
rewrite
/
ProgIntoLaterN
=>
->
.
by
rewrite
laterN_or
-
(
laterN_intro
_
P
)
.
Qed
.
Global
Instance
into_laterN_sep_l
n
P1
P2
Q1
Q2
:
ProgIntoLaterN
n
P1
Q1
→
IntoLaterN
n
P2
Q2
→
IntoLaterN
n
(
P1
∗
P2
)
(
Q1
∗
Q2
)
.
Proof
.
intros
??;
red
.
by
rewrite
laterN_sep
;
apply
sep_mono
.
Qed
.
Global
Instance
into_laterN_sep_r
n
P
P2
Q2
:
ProgIntoLaterN
n
P2
Q2
→
ProgIntoLaterN
n
(
P
∗
P2
)
(
P
∗
Q2
)
.
Proof
.
rewrite
/
ProgIntoLaterN
=>
->
.
by
rewrite
laterN_sep
-
(
laterN_intro
_
P
)
.
Qed
.
Global
Instance
into_laterN_big_sepL
n
{
A
}
(
Φ
Ψ
:
nat
→
A
→
uPred
M
)
(
l
:
list
A
)
:
(
∀
x
k
,
IntoLaterN
n
(
Φ
k
x
)
(
Ψ
k
x
))
→
IntoLaterN
n
([
∗
list
]
k
↦
x
∈
l
,
Φ
k
x
)
([
∗
list
]
k
↦
x
∈
l
,
Ψ
k
x
)
.
(
∀
x
k
,
Prog
IntoLaterN
n
(
Φ
k
x
)
(
Ψ
k
x
))
→
Prog
IntoLaterN
n
([
∗
list
]
k
↦
x
∈
l
,
Φ
k
x
)
([
∗
list
]
k
↦
x
∈
l
,
Ψ
k
x
)
.
Proof
.
rewrite
/
IntoLaterN
=>
?
.
rewrite
big_sepL_laterN
.
by
apply
big_sepL_mono
.
rewrite
/
Prog
IntoLaterN
=>
?
.
rewrite
big_sepL_laterN
.
by
apply
big_sepL_mono
.
Qed
.
Global
Instance
into_laterN_big_sepM
n
`{
Countable
K
}
{
A
}
(
Φ
Ψ
:
K
→
A
→
uPred
M
)
(
m
:
gmap
K
A
)
:
(
∀
x
k
,
IntoLaterN
n
(
Φ
k
x
)
(
Ψ
k
x
))
→
IntoLaterN
n
([
∗
map
]
k
↦
x
∈
m
,
Φ
k
x
)
([
∗
map
]
k
↦
x
∈
m
,
Ψ
k
x
)
.
(
∀
x
k
,
Prog
IntoLaterN
n
(
Φ
k
x
)
(
Ψ
k
x
))
→
Prog
IntoLaterN
n
([
∗
map
]
k
↦
x
∈
m
,
Φ
k
x
)
([
∗
map
]
k
↦
x
∈
m
,
Ψ
k
x
)
.
Proof
.
rewrite
/
IntoLaterN
=>
?
.
rewrite
big_sepM_laterN
;
by
apply
big_sepM_mono
.
rewrite
/
Prog
IntoLaterN
=>
?
.
rewrite
big_sepM_laterN
;
by
apply
big_sepM_mono
.
Qed
.
Global
Instance
into_laterN_big_sepS
n
`{
Countable
A
}
(
Φ
Ψ
:
A
→
uPred
M
)
(
X
:
gset
A
)
:
(
∀
x
,
IntoLaterN
n
(
Φ
x
)
(
Ψ
x
))
→
IntoLaterN
n
([
∗
set
]
x
∈
X
,
Φ
x
)
([
∗
set
]
x
∈
X
,
Ψ
x
)
.
(
∀
x
,
Prog
IntoLaterN
n
(
Φ
x
)
(
Ψ
x
))
→
Prog
IntoLaterN
n
([
∗
set
]
x
∈
X
,
Φ
x
)
([
∗
set
]
x
∈
X
,
Ψ
x
)
.
Proof
.
rewrite
/
IntoLaterN
=>
?
.
rewrite
big_sepS_laterN
;
by
apply
big_sepS_mono
.
rewrite
/
Prog
IntoLaterN
=>
?
.
rewrite
big_sepS_laterN
;
by
apply
big_sepS_mono
.
Qed
.
Global
Instance
into_laterN_big_sepMS
n
`{
Countable
A
}
(
Φ
Ψ
:
A
→
uPred
M
)
(
X
:
gmultiset
A
)
:
(
∀
x
,
IntoLaterN
n
(
Φ
x
)
(
Ψ
x
))
→
IntoLaterN
n
([
∗
mset
]
x
∈
X
,
Φ
x
)
([
∗
mset
]
x
∈
X
,
Ψ
x
)
.
(
∀
x
,
Prog
IntoLaterN
n
(
Φ
x
)
(
Ψ
x
))
→
Prog
IntoLaterN
n
([
∗
mset
]
x
∈
X
,
Φ
x
)
([
∗
mset
]
x
∈
X
,
Ψ
x
)
.
Proof
.
rewrite
/
IntoLaterN
=>
?
.
rewrite
big_sepMS_laterN
;
by
apply
big_sepMS_mono
.
rewrite
/
Prog
IntoLaterN
=>
?
.
rewrite
big_sepMS_laterN
;
by
apply
big_sepMS_mono
.
Qed
.
(* FromLater *)
...
...
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