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
Simcha van Collem
Iris
Commits
2bc4656d
Commit
2bc4656d
authored
7 years ago
by
Ralf Jung
Browse files
Options
Downloads
Patches
Plain Diff
also do least fixpoint; fix naming
parent
90ef23f7
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
theories/base_logic/derived.v
+5
-0
5 additions, 0 deletions
theories/base_logic/derived.v
theories/base_logic/fix.v
+49
-16
49 additions, 16 deletions
theories/base_logic/fix.v
with
54 additions
and
16 deletions
theories/base_logic/derived.v
+
5
−
0
View file @
2bc4656d
...
@@ -541,6 +541,11 @@ Proof.
...
@@ -541,6 +541,11 @@ Proof.
apply
always_intro'
,
impl_intro_r
.
apply
always_intro'
,
impl_intro_r
.
by
rewrite
always_and_sep_l'
always_elim
wand_elim_l
.
by
rewrite
always_and_sep_l'
always_elim
wand_elim_l
.
Qed
.
Qed
.
Lemma
wand_impl_always
P
Q
:
((
□
P
)
-∗
Q
)
⊣⊢
((
□
P
)
→
Q
)
.
Proof
.
apply
(
anti_symm
(
⊢
));
[|
by
rewrite
-
impl_wand
]
.
apply
impl_intro_l
.
by
rewrite
always_and_sep_l'
wand_elim_r
.
Qed
.
Lemma
always_entails_l'
P
Q
:
(
P
⊢
□
Q
)
→
P
⊢
□
Q
∗
P
.
Lemma
always_entails_l'
P
Q
:
(
P
⊢
□
Q
)
→
P
⊢
□
Q
∗
P
.
Proof
.
intros
;
rewrite
-
always_and_sep_l'
;
auto
.
Qed
.
Proof
.
intros
;
rewrite
-
always_and_sep_l'
;
auto
.
Qed
.
Lemma
always_entails_r'
P
Q
:
(
P
⊢
□
Q
)
→
P
⊢
P
∗
□
Q
.
Lemma
always_entails_r'
P
Q
:
(
P
⊢
□
Q
)
→
P
⊢
P
∗
□
Q
.
...
...
This diff is collapsed.
Click to expand it.
theories/base_logic/fix.v
+
49
−
16
View file @
2bc4656d
...
@@ -3,41 +3,74 @@ From iris.proofmode Require Import tactics.
...
@@ -3,41 +3,74 @@ From iris.proofmode Require Import tactics.
Set
Default
Proof
Using
"Type*"
.
Set
Default
Proof
Using
"Type*"
.
Import
uPred
.
Import
uPred
.
(** Greatest fixpoint of a monotone function, defined entirely inside
(** Least and greatest fixpoint of a monotone function, defined entirely inside
the logic.
the logic. *)
TODO: Also do least fixpoint.
*)
Definition
uPred_mono_pred
{
M
A
}
(
F
:
(
A
→
uPred
M
)
→
(
A
→
uPred
M
))
:=
Definition
uPred_mono_pred
{
M
A
}
(
F
:
(
A
→
uPred
M
)
→
(
A
→
uPred
M
))
:=
∀
P
Q
,
((
□
∀
x
,
P
x
-∗
Q
x
)
-∗
∀
x
,
F
P
x
-∗
F
Q
x
)
%
I
.
∀
P
Q
,
((
□
∀
x
,
P
x
-∗
Q
x
)
-∗
∀
x
,
F
P
x
-∗
F
Q
x
)
%
I
.
Definition
iGFix
{
M
A
}
(
F
:
(
A
→
uPred
M
)
→
(
A
→
uPred
M
))
(
x
:
A
)
:
uPred
M
:=
Definition
uPred_least_fixpoint
{
M
A
}
(
F
:
(
A
→
uPred
M
)
→
(
A
→
uPred
M
))
(
x
:
A
)
:
uPred
M
:=
(
∀
P
,
□
(
∀
x
,
F
P
x
-∗
P
x
)
→
P
x
)
%
I
.
Definition
uPred_greatest_fixpoint
{
M
A
}
(
F
:
(
A
→
uPred
M
)
→
(
A
→
uPred
M
))
(
x
:
A
)
:
uPred
M
:=
(
∃
P
,
□
(
∀
x
,
P
x
-∗
F
P
x
)
∧
P
x
)
%
I
.
(
∃
P
,
□
(
∀
x
,
P
x
-∗
F
P
x
)
∧
P
x
)
%
I
.
Section
iGFix
.
Section
least
.
Context
{
M
:
ucmraT
}
{
A
}
(
F
:
(
A
→
uPred
M
)
→
(
A
→
uPred
M
))
(
Hmono
:
uPred_mono_pred
F
)
.
Lemma
F_fix_implies_least_fixpoint
x
:
F
(
uPred_least_fixpoint
F
)
x
⊢
uPred_least_fixpoint
F
x
.
Proof
.
iIntros
"HF"
(
P
)
.
iApply
wand_impl_always
.
iIntros
"#Hincl"
.
iApply
"Hincl"
.
iApply
(
Hmono
_
P
);
last
done
.
iIntros
"!#"
(
y
)
"Hy"
.
iApply
"Hy"
.
done
.
Qed
.
Lemma
least_fixpoint_implies_F_fix
x
:
uPred_least_fixpoint
F
x
⊢
F
(
uPred_least_fixpoint
F
)
x
.
Proof
.
iIntros
"HF"
.
iApply
"HF"
.
iIntros
"!#"
(
y
)
"Hy"
.
iApply
Hmono
;
last
done
.
iIntros
"!#"
(
z
)
"?"
.
by
iApply
F_fix_implies_least_fixpoint
.
Qed
.
Corollary
uPred_least_fixpoint_unfold
x
:
uPred_least_fixpoint
F
x
≡
F
(
uPred_least_fixpoint
F
)
x
.
Proof
.
apply
(
anti_symm
_);
auto
using
least_fixpoint_implies_F_fix
,
F_fix_implies_least_fixpoint
.
Qed
.
Lemma
uPred_least_fixpoint_ind
(
P
:
A
→
uPred
M
)
(
x
:
A
)
:
uPred_least_fixpoint
F
x
-∗
□
(
∀
y
,
F
P
y
-∗
P
y
)
-∗
P
x
.
Proof
.
iIntros
"HF #HP"
.
iApply
"HF"
.
done
.
Qed
.
End
least
.
Section
greatest
.
Context
{
M
:
ucmraT
}
{
A
}
(
F
:
(
A
→
uPred
M
)
→
(
A
→
uPred
M
))
(
Hmono
:
uPred_mono_pred
F
)
.
Context
{
M
:
ucmraT
}
{
A
}
(
F
:
(
A
→
uPred
M
)
→
(
A
→
uPred
M
))
(
Hmono
:
uPred_mono_pred
F
)
.
Lemma
iGFix_implies_F_iGFix
x
:
iGFix
F
x
⊢
F
(
iGFix
F
)
x
.
Lemma
greatest_fixpoint_implies_F_fix
x
:
uPred_greatest_fixpoint
F
x
⊢
F
(
uPred_greatest_fixpoint
F
)
x
.
Proof
.
Proof
.
iDestruct
1
as
(
P
)
"[#Hincl HP]"
.
iDestruct
1
as
(
P
)
"[#Hincl HP]"
.
iApply
(
Hmono
P
(
iGFix
F
))
.
iApply
(
Hmono
P
(
uPred_greatest_fixpoint
F
))
.
-
iAlways
.
iIntros
(
y
)
"Hy"
.
iExists
P
.
by
iSplit
.
-
iAlways
.
iIntros
(
y
)
"Hy"
.
iExists
P
.
by
iSplit
.
-
by
iApply
"Hincl"
.
-
by
iApply
"Hincl"
.
Qed
.
Qed
.
Lemma
F_iGFix_implies_iGFix
x
:
F
(
iGFix
F
)
x
⊢
iGFix
F
x
.
Lemma
F_fix_implies_greatest_fixpoint
x
:
F
(
uPred_greatest_fixpoint
F
)
x
⊢
uPred_greatest_fixpoint
F
x
.
Proof
.
Proof
.
iIntros
"HF"
.
iExists
(
F
(
iGFix
F
))
.
iIntros
"HF"
.
iExists
(
F
(
uPred_greatest_fixpoint
F
))
.
iIntros
"{$HF} !#"
;
iIntros
(
y
)
"Hy"
.
iApply
(
Hmono
with
"[] Hy"
)
.
iIntros
"{$HF} !#"
;
iIntros
(
y
)
"Hy"
.
iApply
(
Hmono
with
"[] Hy"
)
.
iAlways
.
iIntros
(
z
)
.
by
iApply
iGFix
_implies_F_
iGF
ix
.
iAlways
.
iIntros
(
z
)
.
by
iApply
greatest_fixpoint
_implies_F_
f
ix
.
Qed
.
Qed
.
Corollary
iGFix_unfold
x
:
iGFix
F
x
≡
F
(
iGFix
F
)
x
.
Corollary
uPred_greatest_fixpoint_unfold
x
:
uPred_greatest_fixpoint
F
x
≡
F
(
uPred_greatest_fixpoint
F
)
x
.
Proof
.
Proof
.
apply
(
anti_symm
_);
auto
using
iGFix
_implies_F_
iGF
ix
,
F_
iGF
ix_implies_
iGFix
.
apply
(
anti_symm
_);
auto
using
greatest_fixpoint
_implies_F_
f
ix
,
F_
f
ix_implies_
greatest_fixpoint
.
Qed
.
Qed
.
Lemma
Fix
_coind
(
P
:
A
→
uPred
M
)
(
x
:
A
)
:
Lemma
uPred_greatest_fixpoint
_coind
(
P
:
A
→
uPred
M
)
(
x
:
A
)
:
□
(
∀
y
,
P
y
-∗
F
P
y
)
-∗
P
x
-∗
iGFix
F
x
.
□
(
∀
y
,
P
y
-∗
F
P
y
)
-∗
P
x
-∗
uPred_greatest_fixpoint
F
x
.
Proof
.
iIntros
"#HP Hx"
.
iExists
P
.
by
iIntros
"{$Hx} !#"
.
Qed
.
Proof
.
iIntros
"#HP Hx"
.
iExists
P
.
by
iIntros
"{$Hx} !#"
.
Qed
.
End
iGFix
.
End
greatest
.
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