Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
stdpp
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
Model registry
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
Iris
stdpp
Commits
26691820
Commit
26691820
authored
7 years ago
by
Johannes Kloos
Browse files
Options
Downloads
Patches
Plain Diff
Moved Infinite typeclass to infinite
parent
93a88ce7
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!13
Provide an Infinite typeclass and a generic implementation of Fresh.
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
theories/base.v
+0
-7
0 additions, 7 deletions
theories/base.v
theories/infinite.v
+8
-1
8 additions, 1 deletion
theories/infinite.v
with
8 additions
and
8 deletions
theories/base.v
+
0
−
7
View file @
26691820
...
...
@@ -1125,13 +1125,6 @@ Class FreshSpec A C `{ElemOf A C,
is_fresh
(
X
:
C
)
:
fresh
X
∉
X
}
.
(** The class [Infinite] axiomatizes types with infinitely many elements
by giving an injection from the natural numbers into the type. It is mostly
used to provide a generic [fresh] algorithm. *)
Class
Infinite
A
:=
{
inject
:
nat
→
A
;
inject_injective
:>
Inj
(
=
)
(
=
)
inject
}
.
(** * Miscellaneous *)
Class
Half
A
:=
half
:
A
→
A
.
Hint
Mode
Half
!
:
typeclass_instances
.
...
...
This diff is collapsed.
Click to expand it.
theories/infinite.v
+
8
−
1
View file @
26691820
...
...
@@ -2,6 +2,13 @@
(* This file is distributed under the terms of the BSD license. *)
From
stdpp
Require
Import
pretty
fin_collections
.
(** The class [Infinite] axiomatizes types with infinitely many elements
by giving an injection from the natural numbers into the type. It is mostly
used to provide a generic [fresh] algorithm. *)
Class
Infinite
A
:=
{
inject
:
nat
→
A
;
inject_injective
:>
Inj
(
=
)
(
=
)
inject
}
.
Instance
string_infinite
:
Infinite
string
:=
{|
inject
:=
λ
x
,
"~"
+:+
pretty
x
|}
.
Instance
nat_infinite
:
Infinite
nat
:=
{|
inject
:=
id
|}
.
Instance
N_infinite
:
Infinite
N
:=
{|
inject_injective
:=
Nat2N
.
inj
|}
.
...
...
@@ -21,4 +28,4 @@ Section StringFresh.
Context
`{
FinCollection
string
C
,
∀
(
x
:
string
)
(
s
:
C
),
Decision
(
x
∈
s
)}
.
Global
Instance
string_fresh
:
Fresh
string
C
:=
fresh_generic
.
Global
Instance
string_fresh_spec
:
FreshSpec
string
C
:=
_
.
End
StringFresh
.
\ No newline at end of file
End
StringFresh
.
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