Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Iris
stdpp
Commits
26691820
Commit
26691820
authored
Oct 31, 2017
by
Johannes Kloos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved Infinite typeclass to infinite
parent
93a88ce7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
8 deletions
+8
-8
theories/base.v
theories/base.v
+0
-7
theories/infinite.v
theories/infinite.v
+8
-1
No files found.
theories/base.v
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
.
...
...
theories/infinite.v
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
.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment