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
af27e338
Commit
af27e338
authored
7 years ago
by
Robbert Krebbers
Browse files
Options
Downloads
Patches
Plain Diff
Use a type class for monotone uPred predicates.
parent
e393429d
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
theories/base_logic/fix.v
+9
-10
9 additions, 10 deletions
theories/base_logic/fix.v
with
9 additions
and
10 deletions
theories/base_logic/fix.v
+
9
−
10
View file @
af27e338
...
@@ -5,9 +5,9 @@ Import uPred.
...
@@ -5,9 +5,9 @@ Import uPred.
(** Least and greatest fixpoint of a monotone function, defined entirely inside
(** Least and greatest fixpoint of a monotone function, defined entirely inside
the logic. *)
the logic. *)
Class
BIMonoPred
{
M
A
}
(
F
:
(
A
→
uPred
M
)
→
(
A
→
uPred
M
))
:=
Definition
uPred_mono_pred
{
M
A
}
(
F
:
(
A
→
uPred
M
)
→
(
A
→
uPred
M
))
:=
bi_mono_pred
Φ
Ψ
:
((
□
∀
x
,
Φ
x
-∗
Ψ
x
)
→
∀
x
,
F
Φ
x
-∗
F
Ψ
x
)
%
I
.
∀
Φ
Ψ
,
((
□
∀
x
,
Φ
x
→
Ψ
x
)
→
∀
x
,
F
Φ
x
→
F
Ψ
x
)
%
I
.
Arguments
bi_mono_pred
{_
_
_
_}
_
_
.
Definition
uPred_least_fixpoint
{
M
A
}
(
F
:
(
A
→
uPred
M
)
→
(
A
→
uPred
M
))
Definition
uPred_least_fixpoint
{
M
A
}
(
F
:
(
A
→
uPred
M
)
→
(
A
→
uPred
M
))
(
x
:
A
)
:
uPred
M
:=
(
x
:
A
)
:
uPred
M
:=
...
@@ -18,13 +18,12 @@ Definition uPred_greatest_fixpoint {M A} (F : (A → uPred M) → (A → uPred M
...
@@ -18,13 +18,12 @@ Definition uPred_greatest_fixpoint {M A} (F : (A → uPred M) → (A → uPred M
(
∃
Φ
,
□
(
∀
x
,
Φ
x
→
F
Φ
x
)
∧
Φ
x
)
%
I
.
(
∃
Φ
,
□
(
∀
x
,
Φ
x
→
F
Φ
x
)
∧
Φ
x
)
%
I
.
Section
least
.
Section
least
.
Context
{
M
:
ucmraT
}
.
Context
{
M
A
}
(
F
:
(
A
→
uPred
M
)
→
(
A
→
uPred
M
))
`{
!
BIMonoPred
F
}
.
Context
{
A
}
(
F
:
(
A
→
uPred
M
)
→
(
A
→
uPred
M
))
(
Hmono
:
uPred_mono_pred
F
)
.
Lemma
least_fixpoint_unfold_2
x
:
F
(
uPred_least_fixpoint
F
)
x
⊢
uPred_least_fixpoint
F
x
.
Lemma
least_fixpoint_unfold_2
x
:
F
(
uPred_least_fixpoint
F
)
x
⊢
uPred_least_fixpoint
F
x
.
Proof
.
Proof
.
iIntros
"HF"
(
Φ
)
"#Hincl"
.
iIntros
"HF"
(
Φ
)
"#Hincl"
.
iApply
"Hincl"
.
iApply
(
H
mono
_
Φ
);
last
done
.
iApply
"Hincl"
.
iApply
(
bi_
mono
_pred
_
Φ
);
last
done
.
iIntros
"!#"
(
y
)
"Hy"
.
iApply
"Hy"
.
done
.
iIntros
"!#"
(
y
)
"Hy"
.
iApply
"Hy"
.
done
.
Qed
.
Qed
.
...
@@ -32,7 +31,7 @@ Section least.
...
@@ -32,7 +31,7 @@ Section least.
uPred_least_fixpoint
F
x
⊢
F
(
uPred_least_fixpoint
F
)
x
.
uPred_least_fixpoint
F
x
⊢
F
(
uPred_least_fixpoint
F
)
x
.
Proof
.
Proof
.
iIntros
"HF"
.
iApply
"HF"
.
iIntros
"!#"
(
y
)
"Hy"
.
iIntros
"HF"
.
iApply
"HF"
.
iIntros
"!#"
(
y
)
"Hy"
.
iApply
H
mono
;
last
done
.
iIntros
"!#"
(
z
)
"?"
.
iApply
bi_
mono
_pred
;
last
done
.
iIntros
"!#"
(
z
)
"?"
.
by
iApply
least_fixpoint_unfold_2
.
by
iApply
least_fixpoint_unfold_2
.
Qed
.
Qed
.
...
@@ -48,13 +47,13 @@ Section least.
...
@@ -48,13 +47,13 @@ Section least.
End
least
.
End
least
.
Section
greatest
.
Section
greatest
.
Context
{
M
:
ucmraT
}
{
A
}
(
F
:
(
A
→
uPred
M
)
→
(
A
→
uPred
M
))
(
Hmono
:
uPred_mono_p
red
F
)
.
Context
{
M
A
}
(
F
:
(
A
→
uPred
M
)
→
(
A
→
uPred
M
))
`{
!
BIMonoP
red
F
}
.
Lemma
greatest_fixpoint_unfold_1
x
:
Lemma
greatest_fixpoint_unfold_1
x
:
uPred_greatest_fixpoint
F
x
⊢
F
(
uPred_greatest_fixpoint
F
)
x
.
uPred_greatest_fixpoint
F
x
⊢
F
(
uPred_greatest_fixpoint
F
)
x
.
Proof
.
Proof
.
iDestruct
1
as
(
Φ
)
"[#Hincl HΦ]"
.
iDestruct
1
as
(
Φ
)
"[#Hincl HΦ]"
.
iApply
(
H
mono
Φ
(
uPred_greatest_fixpoint
F
))
.
iApply
(
bi_
mono
_pred
Φ
(
uPred_greatest_fixpoint
F
))
.
-
iIntros
"!#"
(
y
)
"Hy"
.
iExists
Φ
.
auto
.
-
iIntros
"!#"
(
y
)
"Hy"
.
iExists
Φ
.
auto
.
-
by
iApply
"Hincl"
.
-
by
iApply
"Hincl"
.
Qed
.
Qed
.
...
@@ -63,7 +62,7 @@ Section greatest.
...
@@ -63,7 +62,7 @@ Section greatest.
F
(
uPred_greatest_fixpoint
F
)
x
⊢
uPred_greatest_fixpoint
F
x
.
F
(
uPred_greatest_fixpoint
F
)
x
⊢
uPred_greatest_fixpoint
F
x
.
Proof
.
Proof
.
iIntros
"HF"
.
iExists
(
F
(
uPred_greatest_fixpoint
F
))
.
iIntros
"HF"
.
iExists
(
F
(
uPred_greatest_fixpoint
F
))
.
iIntros
"{$HF} !#"
(
y
)
"Hy"
.
iApply
(
H
mono
with
"[] Hy"
)
.
iIntros
"{$HF} !#"
(
y
)
"Hy"
.
iApply
(
bi_
mono
_pred
with
"[] Hy"
)
.
iIntros
"!#"
(
z
)
"?"
.
by
iApply
greatest_fixpoint_unfold_1
.
iIntros
"!#"
(
z
)
"?"
.
by
iApply
greatest_fixpoint_unfold_1
.
Qed
.
Qed
.
...
...
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