Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
iris
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
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
Paolo G. Giarrusso
iris
Commits
0d16f5a1
Commit
0d16f5a1
authored
1 year ago
by
Robbert Krebbers
Browse files
Options
Downloads
Patches
Plain Diff
Make `R` argument of `principal` implicit, it can be infered from the type of `mra R`.
parent
77bdb4c8
Branches
test-bigop-synchanges
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
iris_unstable/algebra/monotone.v
+13
-13
13 additions, 13 deletions
iris_unstable/algebra/monotone.v
tests/monotone.v
+2
-2
2 additions, 2 deletions
tests/monotone.v
with
15 additions
and
15 deletions
iris_unstable/algebra/monotone.v
+
13
−
13
View file @
0d16f5a1
...
@@ -23,7 +23,7 @@ following paper for more details:
...
@@ -23,7 +23,7 @@ following paper for more details:
*)
*)
Record
mra
{
A
}
(
R
:
relation
A
)
:=
{
mra_car
:
list
A
}
.
Record
mra
{
A
}
(
R
:
relation
A
)
:=
{
mra_car
:
list
A
}
.
Definition
principal
{
A
}
(
R
:
relation
A
)
(
a
:
A
)
:
mra
R
:=
Definition
principal
{
A
}
{
R
:
relation
A
}
(
a
:
A
)
:
mra
R
:=
{|
mra_car
:=
[
a
]
|}
.
{|
mra_car
:=
[
a
]
|}
.
Global
Arguments
mra_car
{_
_}
_
.
Global
Arguments
mra_car
{_
_}
_
.
...
@@ -34,7 +34,7 @@ Section mra.
...
@@ -34,7 +34,7 @@ Section mra.
Local
Definition
below
(
a
:
A
)
(
x
:
mra
R
)
:=
∃
b
,
b
∈
mra_car
x
∧
R
a
b
.
Local
Definition
below
(
a
:
A
)
(
x
:
mra
R
)
:=
∃
b
,
b
∈
mra_car
x
∧
R
a
b
.
Local
Lemma
below_principal
a
b
:
below
a
(
principal
R
b
)
↔
R
a
b
.
Local
Lemma
below_principal
a
b
:
below
a
(
principal
b
)
↔
R
a
b
.
Proof
.
set_solver
.
Qed
.
Proof
.
set_solver
.
Qed
.
(* OFE *)
(* OFE *)
...
@@ -92,20 +92,20 @@ Section mra.
...
@@ -92,20 +92,20 @@ Section mra.
Lemma
principal_R_op
`{
!
Transitive
R
}
a
b
:
Lemma
principal_R_op
`{
!
Transitive
R
}
a
b
:
R
a
b
→
R
a
b
→
principal
R
a
⋅
principal
R
b
≡
principal
R
b
.
principal
a
⋅
principal
b
≡
principal
b
.
Proof
.
intros
Hab
c
.
set_solver
.
Qed
.
Proof
.
intros
Hab
c
.
set_solver
.
Qed
.
Lemma
principal_included
`{
!
PreOrder
R
}
a
b
:
Lemma
principal_included
`{
!
PreOrder
R
}
a
b
:
principal
R
a
≼
principal
R
b
↔
R
a
b
.
principal
a
≼
principal
b
↔
R
a
b
.
Proof
.
Proof
.
split
.
split
.
-
move
=>
[
z
Hz
]
.
specialize
(
Hz
a
)
.
set_solver
.
-
move
=>
[
z
Hz
]
.
specialize
(
Hz
a
)
.
set_solver
.
-
intros
?;
exists
(
principal
R
b
)
.
by
rewrite
principal_R_op
.
-
intros
?;
exists
(
principal
b
)
.
by
rewrite
principal_R_op
.
Qed
.
Qed
.
Lemma
mra_local_update_grow
`{
!
Transitive
R
}
a
x
b
:
Lemma
mra_local_update_grow
`{
!
Transitive
R
}
a
x
b
:
R
a
b
→
R
a
b
→
(
principal
R
a
,
x
)
~l
~>
(
principal
R
b
,
principal
R
b
)
.
(
principal
a
,
x
)
~l
~>
(
principal
b
,
principal
b
)
.
Proof
.
Proof
.
intros
Hana
.
apply
local_update_unital_discrete
=>
z
_
Habz
.
intros
Hana
.
apply
local_update_unital_discrete
=>
z
_
Habz
.
split
;
first
done
.
intros
c
.
specialize
(
Habz
c
)
.
set_solver
.
split
;
first
done
.
intros
c
.
specialize
(
Habz
c
)
.
set_solver
.
...
@@ -113,7 +113,7 @@ Section mra.
...
@@ -113,7 +113,7 @@ Section mra.
Lemma
mra_local_update_get_frag
`{
!
PreOrder
R
}
a
b
:
Lemma
mra_local_update_get_frag
`{
!
PreOrder
R
}
a
b
:
R
b
a
→
R
b
a
→
(
principal
R
a
,
ε
)
~l
~>
(
principal
R
a
,
principal
R
b
)
.
(
principal
a
,
ε
)
~l
~>
(
principal
a
,
principal
b
)
.
Proof
.
Proof
.
intros
Hana
.
apply
local_update_unital_discrete
=>
z
_
.
intros
Hana
.
apply
local_update_unital_discrete
=>
z
_
.
rewrite
left_id
.
intros
<-.
split
;
first
done
.
rewrite
left_id
.
intros
<-.
split
;
first
done
.
...
@@ -126,7 +126,7 @@ Global Arguments mraR {_} _.
...
@@ -126,7 +126,7 @@ Global Arguments mraR {_} _.
Global
Arguments
mraUR
{_}
_
.
Global
Arguments
mraUR
{_}
_
.
(** If [R] is a partial order, relative to a reflexive relation [S] on the
(** If [R] is a partial order, relative to a reflexive relation [S] on the
carrier [A], then [principal
R
] is proper and injective. The theory for
carrier [A], then [principal] is proper and injective. The theory for
arbitrary relations [S] is overly general, so we do not declare the results
arbitrary relations [S] is overly general, so we do not declare the results
as instances. Below we provide instances for [S] being [=] and [≡]. *)
as instances. Below we provide instances for [S] being [=] and [≡]. *)
Section
mra_over_rel
.
Section
mra_over_rel
.
...
@@ -137,13 +137,13 @@ Section mra_over_rel.
...
@@ -137,13 +137,13 @@ Section mra_over_rel.
Lemma
principal_rel_proper
:
Lemma
principal_rel_proper
:
Reflexive
S
→
Reflexive
S
→
Proper
(
S
==>
S
==>
iff
)
R
→
Proper
(
S
==>
S
==>
iff
)
R
→
Proper
(
S
==>
(
≡
))
(
principal
R
)
.
Proper
(
S
==>
(
≡
@
{
mra
R
}
))
(
principal
)
.
Proof
.
intros
?
HR
a1
a2
Ha
b
.
rewrite
!
below_principal
.
by
apply
HR
.
Qed
.
Proof
.
intros
?
HR
a1
a2
Ha
b
.
rewrite
!
below_principal
.
by
apply
HR
.
Qed
.
Lemma
principal_rel_inj
:
Lemma
principal_rel_inj
:
Reflexive
R
→
Reflexive
R
→
AntiSymm
S
R
→
AntiSymm
S
R
→
Inj
S
(
≡
)
(
principal
R
)
.
Inj
S
(
≡
@
{
mra
R
}
)
(
principal
)
.
Proof
.
Proof
.
intros
??
a
b
Hab
.
move
:
(
Hab
a
)
(
Hab
b
)
.
rewrite
!
below_principal
.
intros
??
a
b
Hab
.
move
:
(
Hab
a
)
(
Hab
b
)
.
rewrite
!
below_principal
.
intros
.
apply
(
anti_symm
R
);
naive_solver
.
intros
.
apply
(
anti_symm
R
);
naive_solver
.
...
@@ -153,17 +153,17 @@ End mra_over_rel.
...
@@ -153,17 +153,17 @@ End mra_over_rel.
Global
Instance
principal_inj
{
A
}
{
R
:
relation
A
}
:
Global
Instance
principal_inj
{
A
}
{
R
:
relation
A
}
:
Reflexive
R
→
Reflexive
R
→
AntiSymm
(
=
)
R
→
AntiSymm
(
=
)
R
→
Inj
(
=
)
(
≡
)
(
principal
R
)
|
0
.
(* Lower cost than [principal_inj] *)
Inj
(
=
)
(
≡
@
{
mra
R
}
)
(
principal
)
|
0
.
(* Lower cost than [principal_inj] *)
Proof
.
intros
.
by
apply
(
principal_rel_inj
(
=
))
.
Qed
.
Proof
.
intros
.
by
apply
(
principal_rel_inj
(
=
))
.
Qed
.
Global
Instance
principal_proper
`{
Equiv
A
}
{
R
:
relation
A
}
:
Global
Instance
principal_proper
`{
Equiv
A
}
{
R
:
relation
A
}
:
Reflexive
(
≡@
{
A
})
→
Reflexive
(
≡@
{
A
})
→
Proper
((
≡
)
==>
(
≡
)
==>
iff
)
R
→
Proper
((
≡
)
==>
(
≡
)
==>
iff
)
R
→
Proper
((
≡
)
==>
(
≡
))
(
principal
R
)
.
Proper
((
≡
)
==>
(
≡
@
{
mra
R
}
))
(
principal
)
.
Proof
.
intros
.
by
apply
(
principal_rel_proper
(
≡
))
.
Qed
.
Proof
.
intros
.
by
apply
(
principal_rel_proper
(
≡
))
.
Qed
.
Global
Instance
principal_equiv_inj
`{
Equiv
A
}
{
R
:
relation
A
}
:
Global
Instance
principal_equiv_inj
`{
Equiv
A
}
{
R
:
relation
A
}
:
Reflexive
R
→
Reflexive
R
→
AntiSymm
(
≡
)
R
→
AntiSymm
(
≡
)
R
→
Inj
(
≡
)
(
≡
)
(
principal
R
)
|
1
.
Inj
(
≡
)
(
≡
@
{
mra
R
}
)
(
principal
)
|
1
.
Proof
.
intros
.
by
apply
(
principal_rel_inj
(
≡
))
.
Qed
.
Proof
.
intros
.
by
apply
(
principal_rel_inj
(
≡
))
.
Qed
.
This diff is collapsed.
Click to expand it.
tests/monotone.v
+
2
−
2
View file @
0d16f5a1
...
@@ -5,10 +5,10 @@ Notation gset_mra K:= (mra (⊆@{gset K})).
...
@@ -5,10 +5,10 @@ Notation gset_mra K:= (mra (⊆@{gset K})).
(* Check if we indeed get [=], i.e., the right [Inj] instance is used. *)
(* Check if we indeed get [=], i.e., the right [Inj] instance is used. *)
Check
"mra_test_eq"
.
Check
"mra_test_eq"
.
Lemma
mra_test_eq
X
Y
:
principal
_
X
≡@
{
gset_mra
nat
}
principal
_
Y
→
X
=
Y
.
Lemma
mra_test_eq
X
Y
:
principal
X
≡@
{
gset_mra
nat
}
principal
Y
→
X
=
Y
.
Proof
.
intros
?
%
(
inj
_)
.
Show
.
done
.
Qed
.
Proof
.
intros
?
%
(
inj
_)
.
Show
.
done
.
Qed
.
Notation
propset_mra
K
:=
(
mra
(
⊆@
{
propset
K
}))
.
Notation
propset_mra
K
:=
(
mra
(
⊆@
{
propset
K
}))
.
Lemma
mra_test_equiv
X
Y
:
principal
_
X
≡@
{
propset_mra
nat
}
principal
_
Y
→
X
≡
Y
.
Lemma
mra_test_equiv
X
Y
:
principal
X
≡@
{
propset_mra
nat
}
principal
Y
→
X
≡
Y
.
Proof
.
intros
?
%
(
inj
_)
.
done
.
Qed
.
Proof
.
intros
?
%
(
inj
_)
.
done
.
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