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
f826c648
Commit
f826c648
authored
2 years ago
by
Robbert Krebbers
Browse files
Options
Downloads
Patches
Plain Diff
Document `Make` classes.
parent
6e22d910
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
iris/proofmode/class_instances_frame.v
+0
-9
0 additions, 9 deletions
iris/proofmode/class_instances_frame.v
iris/proofmode/classes_make.v
+31
-9
31 additions, 9 deletions
iris/proofmode/classes_make.v
with
31 additions
and
18 deletions
iris/proofmode/class_instances_frame.v
+
0
−
9
View file @
f826c648
...
@@ -5,15 +5,6 @@ Import bi.
...
@@ -5,15 +5,6 @@ Import bi.
(** This file defines the instances that make up the framing machinery. *)
(** This file defines the instances that make up the framing machinery. *)
(** When framing below logical connectives/modalities, framing will perform
some "clean up" to remove connectives/modalities if the result of framing is
[True] or [emp]. For example, framing [P] in [P ∗ Q] or [<affine> P] will
result in [Q] and [emp], respectively, instead of [emp ∗ Q] and [<affine> emp],
respectively. One could imagine a smarter way of cleaning up, as implemented in
https://gitlab.mpi-sws.org/iris/iris/-/merge_requests/450 for some modalities,
but that makes framing less predictable and might have some performance impact.
Hence, we only perform such cleanup for [True] and [emp]. *)
Section
class_instances_frame
.
Section
class_instances_frame
.
Context
{
PROP
:
bi
}
.
Context
{
PROP
:
bi
}
.
Implicit
Types
P
Q
R
:
PROP
.
Implicit
Types
P
Q
R
:
PROP
.
...
...
This diff is collapsed.
Click to expand it.
iris/proofmode/classes_make.v
+
31
−
9
View file @
f826c648
From
iris
.
bi
Require
Export
bi
.
From
iris
.
bi
Require
Export
bi
.
From
iris
.
prelude
Require
Import
options
.
From
iris
.
prelude
Require
Import
options
.
(* For each of the [MakeXxxx] class, there is a [KnownMakeXxxx]
(** The [MakeX] classes are "smart constructors" for the logical connectives
variant, that only succeeds if the parameter(s) is not an evar. In
and modalities that perform some trivial logical simplifications to give "clean"
the case the parameter(s) is an evar, then [MakeXxxx] will not
results.
instantiate it arbitrarily.
For example, when framing below logical connectives/modalities, framing should
The reason for this is that if given an evar, these typeclasses
remove connectives/modalities if the result of framing is [emp]. For example,
would typically try to instantiate this evar with some arbitrary
when framing [P] (using [iFrame]) in goal [P ∗ Q], the result should be [Q]. The
logical constructs such as emp or True. Therefore, we use a Hint
result should not be [emp ∗ Q], where [emp] would be the result of (recursively)
Mode to disable all the instances that would have this behavior. *)
framing [P] in [P]. Hence, in the recursive calls, the framing machinery uses
the class [MakeSep P Q PQ]. If either [P] or [Q] is [emp] (or [True] in case of
appropriate assumptions w.r.t. affinity), the result [PQ] is [Q] or [P],
respectively. In other cases, the result is [PQ] is simply [P ∗ Q].
The [MakeX] classes are used in each recursive step of the framing machinery.
Hence, they should be constant time, which is typically achieved by only looking
at the top-level symbol of the input.
One could imagine a smarter way of "cleaning up", as implemented in
https://gitlab.mpi-sws.org/iris/iris/-/merge_requests/450 for some modalities,
but that makes framing less predictable and might have some performance impact
(i.e., not be constant time). Hence, we only perform such cleanup for [True]
and [emp].
For each of the [MakeX] class, there is a [KnownMakeX] variant, which only
succeeds if the parameter(s) is not an evar. In the case the parameter(s) is an
evar, then [MakeX] will not instantiate it arbitrarily.
The reason for this is that if given an evar, these typeclasses would typically
try to instantiate this evar with some arbitrary logical constructs such as
[emp] or [True]. Therefore, we use a [Hint Mode] to disable all the instances
that would have this behavior. *)
Class
MakeEmbed
{
PROP
PROP'
:
bi
}
`{
BiEmbed
PROP
PROP'
}
(
P
:
PROP
)
(
Q
:
PROP'
)
:=
Class
MakeEmbed
{
PROP
PROP'
:
bi
}
`{
BiEmbed
PROP
PROP'
}
(
P
:
PROP
)
(
Q
:
PROP'
)
:=
make_embed
:
⎡
P
⎤
⊣⊢
Q
.
make_embed
:
⎡
P
⎤
⊣⊢
Q
.
...
...
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