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
1411b0a9
Commit
1411b0a9
authored
3 years ago
by
Paolo G. Giarrusso
Browse files
Options
Downloads
Patches
Plain Diff
Only use Existing Instances.
parent
04b066bc
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/resource_algebras.md
+4
-3
4 additions, 3 deletions
docs/resource_algebras.md
with
4 additions
and
3 deletions
docs/resource_algebras.md
+
4
−
3
View file @
1411b0a9
...
...
@@ -15,12 +15,13 @@ not have to expose to clients what exactly their resource algebras are. For
example, in the
[
one-shot example
](
../tests/one_shot.v
)
, we have:
```
coq
Class
one_shotG
Σ
:=
{
one_shot_inG
:
inG
Σ
one_shotR
}
.
Local
Existing
Instance
one_shot_inG
.
Local
Existing
Instance
s
one_shot_inG
.
```
Here, the projection
`one_shot_inG`
is registered as an instance for type-class
resolution. If you need several resource algebras, just add more
`inG`
fields.
If you are using another module as part of yours, add a field like
`one_shot_other : otherG Σ`
. All of these fields should be added to the
`Local Existing Instances`
.
`one_shot_other : otherG Σ`
. All of these fields should be added to the
`Local Existing Instances`
command.
The code above enables these typeclass instances only in the surrounding file
where they are used to define the new abstractions by the library. The
...
...
@@ -132,7 +133,7 @@ Class gen_heapGS (L V : Type) (Σ : gFunctors) `{Countable L} := GenHeapGS {
gen_heap_inG
:
gen_heapGpreS
L
V
Σ
;
gen_heap_name
:
gname
;
}
.
Local
Existing
Instance
gen_heap_inG
.
Local
Existing
Instance
s
gen_heap_inG
.
```
The trailing
`S`
here is for "singleton", because the idea is that only one
instance of
`gen_heapGS`
ever exists. This is important, since two instances
...
...
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