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
6bd3537f
Commit
6bd3537f
authored
2 years ago
by
Robbert Krebbers
Browse files
Options
Downloads
Patches
Plain Diff
Improve docs for `algebra/proofmode_classes`.
parent
75c9df64
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
iris/algebra/proofmode_classes.v
+26
-13
26 additions, 13 deletions
iris/algebra/proofmode_classes.v
with
26 additions
and
13 deletions
iris/algebra/proofmode_classes.v
+
26
−
13
View file @
6bd3537f
From
iris
.
algebra
Require
Export
cmra
.
From
iris
.
algebra
Require
Export
cmra
.
From
iris
.
prelude
Require
Import
options
.
From
iris
.
prelude
Require
Import
options
.
(* There are various versions of [IsOp] with different modes:
(* The [IsOp a b1 b2] class is used in two directions: to "split" input [a] into
outputs [b1] and [b2], and to "merge" inputs [b1] and [b2] into output [a],
- [IsOp a b1 b2]: this one has no mode, it can be used regardless of whether
where in both cases we have [a ≡ b1 ⋅ b2].
any of the arguments is an evar. This class has only one direct instance:
[IsOp (a ⋅ b) a b].
Since the [IsOp a b1 b2] class is used in two directions, there are some
- [IsOp' a b1 b2]: requires either [a] to start with a constructor, OR [b1] and
subtleties we need to account for:
[b2] to start with a constructor. All usual instances should be of this
class to avoid loops.
- If we want to "merge", we want the "op" instance to be used *last*. That is,
- [IsOp'LR a b1 b2]: requires either [a] to start with a constructor. This one
before using [IsOp (b1 ⋅ b2) b1 b2], we want to traverse the structure of the
has just one instance: [IsOp'LR (a ⋅ b) a b] with a very low precendence.
term to merge constructors, and we want it to combine terms like [q/2] and
This is important so that when performing, for example, an [iDestruct] on
[q/2] into [q] instead of [q/2 ⋅ q/2].
[own γ (q1 + q2)] where [q1] and [q2] are fractions, we actually get
- If we want to "split", we want the "op" instance to be used *first*. That is,
[own γ q1] and [own γ q2] instead of [own γ ((q1 + q2)/2)] twice.
we want to use [IsOp (b1 ⋅ b2) b1 b2] eagerly, so that for instance, a term
like [q1 ⋅ q2] is turned into [q1] and [q2] and not two times [(q1 ⋅ q2) / 2].
To achieve this, there are various classes with different modes:
- [IsOp a b1 b2]. This class has no mode, so it can be used even to
combine/merge evars. This class has only one direct instance
[IsOp (a ⋅ b) a b] with priority 100 (so it is used last), ensuring that the
"op" rule is used last when merging.
- [IsOp' a b1 b2]. This class requires either [a] OR [b1] and [b2] to be inputs.
All usual instances should be of this class to avoid loops.
- [IsOp'LR a b1 b2]. This class requires [a] to be an input and has just one
instance [IsOp'LR (a ⋅ b) a b] with priority 0. This ensures that the "op"
rule is used first when splitting.
*)
*)
Class
IsOp
{
A
:
cmra
}
(
a
b1
b2
:
A
)
:=
is_op
:
a
≡
b1
⋅
b2
.
Class
IsOp
{
A
:
cmra
}
(
a
b1
b2
:
A
)
:=
is_op
:
a
≡
b1
⋅
b2
.
Global
Arguments
is_op
{_}
_
_
_
{_}
.
Global
Arguments
is_op
{_}
_
_
_
{_}
.
...
...
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