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
Gaëtan Gilbert
Iris
Commits
4fe0183c
Commit
4fe0183c
authored
1 year ago
by
Robbert Krebbers
Browse files
Options
Downloads
Patches
Plain Diff
Tweaks.
parent
9b4b5adc
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
docs/equalities_and_entailments.md
+16
-17
16 additions, 17 deletions
docs/equalities_and_entailments.md
with
16 additions
and
17 deletions
docs/equalities_and_entailments.md
+
16
−
17
View file @
4fe0183c
...
@@ -51,17 +51,17 @@ Here, stdpp adds the following facilities:
...
@@ -51,17 +51,17 @@ Here, stdpp adds the following facilities:
setoid, ofe, ordered arguments), there should be a
`Params f n`
instance. This
setoid, ofe, ordered arguments), there should be a
`Params f n`
instance. This
instance forces Coq's setoid rewriting mechanism not to rewrite in the first
instance forces Coq's setoid rewriting mechanism not to rewrite in the first
`n`
arguments of the function
`f`
. This significantly reduces backtracking
`n`
arguments of the function
`f`
. This significantly reduces backtracking
during
`Proper`
search and thus improves performance/avoids
diverging failing
during
`Proper`
search and thus improves performance/avoids
failing instance
instance searches
. These first arguments typically include type variables
searches that diverge
. These first arguments typically include type variables
(
`A : Type`
or
`B : A → Type`
), type class parameters (
`C A`
), and Leibniz
(
`A : Type`
or
`B : A → Type`
), type class parameters (
`C A`
), and Leibniz
arguments (
`i : nat`
or
`i : Z`
), so they cannot be rewritten or do
n'
t need
arguments (
`i : nat`
or
`i : Z`
), so they cannot be rewritten or do
no
t need
setoid rewriting.
setoid rewriting.
Examples:
Examples:
+
For
`cons : ∀ A, A → list A → list A`
we have
`Params (@cons) 1`
,
+
For
`cons : ∀ A, A → list A → list A`
we have
`Params (@cons) 1`
,
indicating that the type argument named
`A`
is not up to rewriting.
indicating that the type argument named
`A`
is not up to rewriting.
+
For
`replicate : ∀ A, nat → A → list A`
we have
`Params (@replicate) 2`
+
For
`replicate : ∀ A, nat → A → list A`
we have
`Params (@replicate) 2`
indicating that the type argument
`A`
is not up to rewriting and that the
indicating that the type argument
`A`
is not up to rewriting and that the
`nat`
-typed argument also does
n'
t show up as rewriteable in the
`Proper`
`nat`
-typed argument also does
no
t show up as rewriteable in the
`Proper`
instance (because rewriting with
`=`
doesn't need such an instance).
instance (because rewriting with
`=`
doesn't need such an instance).
+
For
`lookup : ∀ {Lookup K A M}, K → M → option A`
we have
+
For
`lookup : ∀ {Lookup K A M}, K → M → option A`
we have
`Params (@lookup) 5`
: there are 3 Type parameters, 1 type class, and a key
`Params (@lookup) 5`
: there are 3 Type parameters, 1 type class, and a key
...
@@ -69,22 +69,21 @@ Here, stdpp adds the following facilities:
...
@@ -69,22 +69,21 @@ Here, stdpp adds the following facilities:
-
Consequenently,
`Proper .. f`
instances are always written in such a way
-
Consequenently,
`Proper .. f`
instances are always written in such a way
that
`f`
is partially applied with the first
`n`
arguments from
`Params f n`
.
that
`f`
is partially applied with the first
`n`
arguments from
`Params f n`
.
Note that implicit arguments count here.
Note that implicit arguments count here.
This means
that
`Proper`
instances never start with
`(=) ==>`
.
Further note
that
`Proper`
instances never start with
`(=) ==>`
.
Examples:
Examples:
+
`Proper ((≡@{A}) ==> (≡@{list A}) ==> (≡@{list A})) cons`
+
`Proper ((≡@{A}) ==> (≡@{list A}) ==> (≡@{list A})) cons`
,
(where
`cons`
is
`@cons A`
, matching the 1 in
`Params`
)
where
`cons`
is
`@cons A`
, matching the 1 in
`Params`
.
+
`Proper ((≡@{A}) ==> (≡@{list A})) (replicate n)`
+
`Proper ((≡@{A}) ==> (≡@{list A})) (replicate n)`
,
(where
`replicate n`
is
`@replicate A n`
)
where
`replicate n`
is
`@replicate A n`
.
+
`Proper ((≡@{M}) ==> (≡@{option A})) (lookup k)`
+
`Proper ((≡@{M}) ==> (≡@{option A})) (lookup k)`
,
(where
`lookup k`
is
`@lookup K A M _ k`
, so 5 parameters are fixed, matching the
`Param`
)
where
`lookup k`
is
`@lookup K A M _ k`
, so 5 parameters are fixed, matching
the
`Params`
instance.
-
Lemmas about higher-order functions often need
`Params`
premises.
-
Lemmas about higher-order functions often need
`Params`
premises.
These are also written using the convention above. Example:
These are also written using the convention above. Example:
```
coq
```
Lemma
set_fold_ind
`{
FinSet
A
C
}
{
B
}
(
P
:
B
→
C
→
Prop
)
(
f
:
A
→
B
→
B
)
(
b
:
B
)
:
Lemma set_fold_ind `{Set A C} {B} (P : B → C → Prop) (f : A → B → B) (b : B) :
(
∀
x
,
Proper
((
≡
)
==>
impl
)
(
P
x
))
→
...
(∀ x, Proper ((≡) ==> impl) (P x)) → ...
```
```
-
For premises involving predicates (such as
`P`
in
`set_fold_ind`
above), we
-
For premises involving predicates (such as
`P`
in
`set_fold_ind`
above), we
always write the weakest
`Proper`
: that is, use
`impl`
instead of
`iff`
(and
always write the weakest
`Proper`
: that is, use
`impl`
instead of
`iff`
(and
in Iris, write
`(⊢)`
instead of
`(⊣⊢)`
). For "simple"
`P`
s, there should be
in Iris, write
`(⊢)`
instead of
`(⊣⊢)`
). For "simple"
`P`
s, there should be
...
...
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