-
Notifications
You must be signed in to change notification settings - Fork 9
Other "standard" libraries
Bas Spitters edited this page Nov 17, 2018
·
21 revisions
There is a cottage industry of alternative standard libraries/extensions to the standard library.
-
Coq
- Grew organically over time, lots of different conventions.
-
coq-ext-lib
- Type classes
- Originally minimal use of dependent types (that has changed a little bit).
- Separation between definitions and proofs, e.g.
Monad
andMonadLaws
. - Disciplined use of notations to avoid trivial import problems with libraries that are compatible except for notations.
- Universe polymorphism and primitive projections everywhere.
- Module naming convention
ExtLib.Data.Nat
,ExtLib.Structures.Monad
, etc. GenerallyCamelCase
for types andsnake_case
for definitions. - License: MIT
-
coq-haskell
- Type classes
- Mostly for smoothing the extraction from Coq to Haskell.
- Module naming convention
Hask.Data.List
, names reflect their Haskell names, e.g.Maybe
instead ofoption
.
-
coq-prelude
- "Inspired by Haskell"
- Mostly focused on Monads
- Module naming convention
Control.Classes
,Control.State
, etc. -
camelCase
for definitions andCamelCase
for types/classes. - License: GPL3
-
mathclasses
- First big library based on Type classes.
- Proposed the unbundled approach, which is now standard.
- Pervasive setoids
- Algebraic hierarchy
- Category theory
- Universal algebra
- Exact real number computation
- License: Public domain
-
ssreflect
- Canonical structures
-
stdpp
- Type classes
- Mostly data types, not a lot of generic interfaces.
- Lots of hints and patterns to improve type class resolution and type checking.
- Module naming convention:
stdpp.fin
, snake_case for identifiers
-
hott-coq
- Based on homotopy type theory
- Very math (e.g. topology) inspired.
- Possibly more difficult to approach from a programming background.
-
Style file describes various conventions, e.g., around typeclass usage, naming conventions, organization, etc
- Typeclasses used for trunctation levels are required to form a DAG; in general, when we have
A <-> B
forA
andB
both classes, we must pick a canonical flow direction so that typeclass resolution neither loops nor misses things.
- Typeclasses used for trunctation levels are required to form a DAG; in general, when we have
- Within the Categories directory:
- Every file contains approximately one "main" theorem or construction
- Related constructions are grouped together in the same directory
- Every directory
Foo/Bar/
has a corresponding moduleFoo/Bar.v
whichRequire
s andInclude
s the relevant files inFoo/Bar/
so that one canRequire Import Foo.Bar
and get access to the relevant things both at top level and with absolute nameFoo.Bar.*
. - Automated proofs are considered to be "not yet polished enough" if they contain more manual structure than (optionally)
induction
followed byrepeat match goal with
/repeat first
.
Last section of https://hal.inria.fr/hal-00816703v1/ provides a comparison between type classes and canonical structures.