![]() | Name | Last modified | Size | Description |
---|---|---|---|---|
![]() | Parent Directory | - | ||
![]() | Agda.css | 2009-12-23 11:09 | 1.1K | |
![]() | Algebra.FunctionProp..> | 2009-12-23 11:08 | 4.8K | |
![]() | Algebra.FunctionProp..> | 2009-12-23 11:09 | 58K | |
![]() | Algebra.Morphism.html | 2009-12-23 11:09 | 41K | |
![]() | Algebra.Operations.html | 2009-12-23 11:09 | 31K | |
![]() | Algebra.Props.Abelia..> | 2009-12-23 11:07 | 34K | |
![]() | Algebra.Props.Boolea..> | 2009-12-23 11:08 | 494K | |
![]() | Algebra.Props.Distri..> | 2009-12-23 11:07 | 46K | |
![]() | Algebra.Props.Group...> | 2009-12-23 11:07 | 58K | |
![]() | Algebra.Props.Lattic..> | 2009-12-23 11:06 | 20K | |
![]() | Algebra.Props.Ring.html | 2009-12-23 11:07 | 41K | |
![]() | Algebra.RingSolver.A..> | 2009-12-23 11:09 | 54K | |
![]() | Algebra.RingSolver.L..> | 2009-12-23 11:09 | 144K | |
![]() | Algebra.RingSolver.S..> | 2009-12-23 11:08 | 4.3K | |
![]() | Algebra.RingSolver.html | 2009-12-23 11:09 | 194K | |
![]() | Algebra.Structures.html | 2009-12-23 11:09 | 162K | |
![]() | Algebra.html | 2009-12-23 11:09 | 135K | |
![]() | Category.Applicative..> | 2009-12-23 11:07 | 28K | |
![]() | Category.Applicative..> | 2009-12-23 11:09 | 6.3K | |
![]() | Category.Functor.html | 2009-12-23 11:08 | 7.1K | |
![]() | Category.Monad.Conti..> | 2009-12-23 11:08 | 38K | |
![]() | Category.Monad.Ident..> | 2009-12-23 11:08 | 5.1K | |
![]() | Category.Monad.Index..> | 2009-12-23 11:09 | 32K | |
![]() | Category.Monad.Parti..> | 2009-12-23 11:09 | 49K | |
![]() | Category.Monad.State..> | 2009-12-23 11:09 | 71K | |
![]() | Category.Monad.html | 2009-12-23 11:07 | 14K | |
![]() | Coinduction.html | 2009-12-23 11:09 | 6.5K | |
![]() | Data.AVL.IndexedMap...> | 2009-12-23 11:07 | 46K | |
![]() | Data.AVL.Sets.html | 2009-12-23 11:07 | 26K | |
![]() | Data.AVL.html | 2009-12-23 11:06 | 215K | |
![]() | Data.Bin.html | 2009-12-23 11:06 | 173K | |
![]() | Data.Bool.Properties..> | 2009-12-23 11:06 | 148K | |
![]() | Data.Bool.Show.html | 2009-12-23 11:07 | 3.4K | |
![]() | Data.Bool.html | 2009-12-23 11:07 | 26K | |
![]() | Data.BoundedVec.Inef..> | 2009-12-23 11:09 | 18K | |
![]() | Data.BoundedVec.html | 2009-12-23 11:07 | 38K | |
![]() | Data.Char.html | 2009-12-23 11:07 | 15K | |
![]() | Data.Cofin.html | 2009-12-23 11:09 | 19K | |
![]() | Data.Colist.html | 2009-12-23 11:09 | 173K | |
![]() | Data.Conat.html | 2009-12-23 11:09 | 25K | |
![]() | Data.Covec.html | 2009-12-23 11:09 | 123K | |
![]() | Data.DifferenceList...> | 2009-12-23 11:09 | 33K | |
![]() | Data.DifferenceNat.html | 2009-12-23 11:08 | 12K | |
![]() | Data.DifferenceVec.html | 2009-12-23 11:07 | 36K | |
![]() | Data.Digit.html | 2009-12-23 11:09 | 61K | |
![]() | Data.Empty.html | 2009-12-23 11:07 | 3.8K | |
![]() | Data.Fin.Dec.html | 2009-12-23 11:09 | 129K | |
![]() | Data.Fin.Props.html | 2009-12-23 11:09 | 120K | |
![]() | Data.Fin.Subset.Prop..> | 2009-12-23 11:09 | 48K | |
![]() | Data.Fin.Subset.html | 2009-12-23 11:08 | 27K | |
![]() | Data.Fin.Substitutio..> | 2009-12-23 11:07 | 73K | |
![]() | Data.Fin.Substitutio..> | 2009-12-23 11:09 | 497K | |
![]() | Data.Fin.Substitutio..> | 2009-12-23 11:07 | 24K | |
![]() | Data.Fin.Substitutio..> | 2009-12-23 11:07 | 83K | |
![]() | Data.Fin.html | 2009-12-23 11:09 | 103K | |
![]() | Data.Function.Equali..> | 2009-12-23 11:07 | 81K | |
![]() | Data.Function.Inject..> | 2009-12-23 11:09 | 27K | |
![]() | Data.Function.LeftIn..> | 2009-12-23 11:08 | 48K | |
![]() | Data.Function.html | 2009-12-23 11:08 | 55K | |
![]() | Data.Graph.Acyclic.html | 2009-12-23 11:10 | 195K | |
![]() | Data.Integer.Divisib..> | 2009-12-23 11:09 | 13K | |
![]() | Data.Integer.Propert..> | 2009-12-23 11:09 | 80K | |
![]() | Data.Integer.html | 2009-12-23 11:09 | 158K | |
![]() | Data.List.All.Proper..> | 2009-12-23 11:06 | 45K | |
![]() | Data.List.All.html | 2009-12-23 11:09 | 43K | |
![]() | Data.List.Any.Proper..> | 2009-12-23 11:08 | 720K | |
![]() | Data.List.Any.html | 2009-12-23 11:09 | 103K | |
![]() | Data.List.Countdown...> | 2009-12-23 11:07 | 198K | |
![]() | Data.List.NonEmpty.P..> | 2009-12-23 11:09 | 42K | |
![]() | Data.List.NonEmpty.html | 2009-12-23 11:09 | 123K | |
![]() | Data.List.Properties..> | 2009-12-23 11:09 | 243K | |
![]() | Data.List.Reverse.html | 2009-12-23 11:08 | 28K | |
![]() | Data.List.html | 2009-12-23 11:09 | 215K | |
![]() | Data.Map.html | 2009-12-23 11:09 | 58K | |
![]() | Data.Maybe.Core.html | 2009-12-23 11:06 | 4.6K | |
![]() | Data.Maybe.html | 2009-12-23 11:08 | 75K | |
![]() | Data.Nat.Coprimality..> | 2009-12-23 11:09 | 96K | |
![]() | Data.Nat.DivMod.html | 2009-12-23 11:08 | 77K | |
![]() | Data.Nat.Divisibilit..> | 2009-12-23 11:06 | 134K | |
![]() | Data.Nat.GCD.Lemmas...> | 2009-12-23 11:06 | 225K | |
![]() | Data.Nat.GCD.html | 2009-12-23 11:09 | 126K | |
![]() | Data.Nat.InfinitelyO..> | 2009-12-23 11:06 | 57K | |
![]() | Data.Nat.LCM.html | 2009-12-23 11:07 | 90K | |
![]() | Data.Nat.Properties...> | 2009-12-23 11:09 | 432K | |
![]() | Data.Nat.Show.html | 2009-12-23 11:07 | 11K | |
![]() | Data.Nat.html | 2009-12-23 11:07 | 121K | |
![]() | Data.Product.Record...> | 2009-12-23 11:09 | 55K | |
![]() | Data.Product.html | 2009-12-23 11:07 | 94K | |
![]() | Data.Rational.html | 2009-12-23 11:09 | 63K | |
![]() | Data.Sets.html | 2009-12-23 11:09 | 57K | |
![]() | Data.Sign.Properties..> | 2009-12-23 11:09 | 11K | |
![]() | Data.Sign.html | 2009-12-23 11:07 | 11K | |
![]() | Data.Star.BoundedVec..> | 2009-12-23 11:09 | 28K | |
![]() | Data.Star.Decoration..> | 2009-12-23 11:09 | 74K | |
![]() | Data.Star.Environmen..> | 2009-12-23 11:07 | 19K | |
![]() | Data.Star.Fin.html | 2009-12-23 11:09 | 8.8K | |
![]() | Data.Star.List.html | 2009-12-23 11:09 | 9.3K | |
![]() | Data.Star.Nat.html | 2009-12-23 11:09 | 19K | |
![]() | Data.Star.Pointer.html | 2009-12-23 11:07 | 73K | |
![]() | Data.Star.Properties..> | 2009-12-23 11:09 | 94K | |
![]() | Data.Star.Vec.html | 2009-12-23 11:09 | 30K | |
![]() | Data.Star.html | 2009-12-23 11:08 | 84K | |
![]() | Data.Stream.html | 2009-12-23 11:07 | 75K | |
![]() | Data.String.html | 2009-12-23 11:09 | 27K | |
![]() | Data.Sum.html | 2009-12-23 11:09 | 36K | |
![]() | Data.Unit.html | 2009-12-23 11:06 | 23K | |
![]() | Data.Vec.Equality.html | 2009-12-23 11:10 | 74K | |
![]() | Data.Vec.N-ary.html | 2009-12-23 11:09 | 99K | |
![]() | Data.Vec.Properties...> | 2009-12-23 11:09 | 134K | |
![]() | Data.Vec.html | 2009-12-23 11:07 | 181K | |
![]() | Everything.html | 2009-12-23 11:07 | 86K | |
![]() | Foreign.Haskell.html | 2009-12-23 11:06 | 17K | |
![]() | IO.Primitive.html | 2009-12-23 11:09 | 14K | |
![]() | IO.html | 2009-12-23 11:09 | 49K | |
![]() | Induction.Lexicograp..> | 2009-12-23 11:09 | 39K | |
![]() | Induction.Nat.html | 2009-12-23 11:09 | 46K | |
![]() | Induction.WellFounde..> | 2009-12-23 11:09 | 17K | |
![]() | Induction.html | 2009-12-23 11:09 | 28K | |
![]() | Level.html | 2009-12-23 11:07 | 10K | |
![]() | Relation.Binary.Cons..> | 2009-12-23 11:08 | 11K | |
![]() | Relation.Binary.Cons..> | 2009-12-23 11:07 | 88K | |
![]() | Relation.Binary.Core..> | 2009-12-23 11:09 | 125K | |
![]() | Relation.Binary.EqRe..> | 2009-12-23 11:09 | 7.2K | |
![]() | Relation.Binary.Flip..> | 2009-12-23 11:09 | 156K | |
![]() | Relation.Binary.Hete..> | 2009-12-23 11:09 | 140K | |
![]() | Relation.Binary.Indu..> | 2009-12-23 11:07 | 26K | |
![]() | Relation.Binary.List..> | 2009-12-23 11:09 | 107K | |
![]() | Relation.Binary.List..> | 2009-12-23 11:09 | 103K | |
![]() | Relation.Binary.List..> | 2009-12-23 11:08 | 241K | |
![]() | Relation.Binary.NonS..> | 2009-12-23 11:06 | 67K | |
![]() | Relation.Binary.On.html | 2009-12-23 11:06 | 108K | |
![]() | Relation.Binary.Orde..> | 2009-12-23 11:08 | 31K | |
![]() | Relation.Binary.Part..> | 2009-12-23 11:07 | 5.3K | |
![]() | Relation.Binary.Preo..> | 2009-12-23 11:06 | 21K | |
![]() | Relation.Binary.Prod..> | 2009-12-23 11:09 | 121K | |
![]() | Relation.Binary.Prod..> | 2009-12-23 11:06 | 156K | |
![]() | Relation.Binary.Prod..> | 2009-12-23 11:09 | 198K | |
![]() | Relation.Binary.Prop..> | 2009-12-23 11:07 | 18K | |
![]() | Relation.Binary.Prop..> | 2009-12-23 11:07 | 6.5K | |
![]() | Relation.Binary.Prop..> | 2009-12-23 11:09 | 69K | |
![]() | Relation.Binary.Prop..> | 2009-12-23 11:07 | 10K | |
![]() | Relation.Binary.Prop..> | 2009-12-23 11:09 | 9.4K | |
![]() | Relation.Binary.Prop..> | 2009-12-23 11:06 | 10K | |
![]() | Relation.Binary.Prop..> | 2009-12-23 11:09 | 11K | |
![]() | Relation.Binary.Prop..> | 2009-12-23 11:06 | 11K | |
![]() | Relation.Binary.Prop..> | 2009-12-23 11:09 | 8.2K | |
![]() | Relation.Binary.Refl..> | 2009-12-23 11:06 | 47K | |
![]() | Relation.Binary.Simp..> | 2009-12-23 11:09 | 13K | |
![]() | Relation.Binary.Stri..> | 2009-12-23 11:06 | 6.3K | |
![]() | Relation.Binary.Stri..> | 2009-12-23 11:09 | 69K | |
![]() | Relation.Binary.Sum...> | 2009-12-23 11:09 | 270K | |
![]() | Relation.Binary.html | 2009-12-23 11:09 | 113K | |
![]() | Relation.Nullary.Cor..> | 2009-12-23 11:09 | 7.9K | |
![]() | Relation.Nullary.Dec..> | 2009-12-23 11:09 | 36K | |
![]() | Relation.Nullary.Neg..> | 2009-12-23 11:06 | 114K | |
![]() | Relation.Nullary.Pro..> | 2009-12-23 11:06 | 8.4K | |
![]() | Relation.Nullary.Sum..> | 2009-12-23 11:09 | 17K | |
![]() | Relation.Nullary.Uni..> | 2009-12-23 11:06 | 119K | |
![]() | Relation.Nullary.html | 2009-12-23 11:07 | 8.3K | |
![]() | Relation.Unary.html | 2009-12-23 11:09 | 68K | |
![]() | Size.html | 2009-12-23 11:07 | 3.4K | |
module README where ------------------------------------------------------------------------ -- The Agda standard library, version 0.3 -- -- Author: Nils Anders Danielsson, with contributions from -- Jean-Philippe Bernardy, Samuel Bronson, Liang-Ting Chen, Dan Doel, -- Patrik Jansson, Darin Morrison, Shin-Cheng Mu, Ulf Norell, Nicolas -- Pouillard and Andrés Sicard-Ramírez ------------------------------------------------------------------------ -- This version of the library has been tested using Agda 2.2.6. -- Note that no guarantees are currently made about forwards or -- backwards compatibility, the library is still at an experimental -- stage. -- To make use of the library, add the path to the library’s root -- directory (src) to the Agda search path, either using the -- --include-path flag or by customising the Emacs mode variable -- agda2-include-dirs (M-x customize-group RET agda2 RET). -- Contributions to this library are welcome (but to avoid wasted work -- it is suggested that you discuss large changes before implementing -- them). Please send contributions in the form of darcs patches (run -- darcs send --output <patch file> and attach the patch file to an -- email), and include a statement saying that you agree to release -- your library patches under the library's licence. It is appreciated -- if every patch contains a single, complete change, and if the -- coding style used in the library is adhered to. ------------------------------------------------------------------------ -- Module hierarchy ------------------------------------------------------------------------ -- The top-level module names of the library are currently allocated -- as follows: -- -- • Algebra -- Abstract algebra (monoids, groups, rings etc.), along with -- properties needed to specify these structures (associativity, -- commutativity, etc.), and operations on and proofs about the -- structures. -- • Category -- Category theory-inspired idioms used to structure functional -- programs (functors and monads, for instance). -- • Coinduction -- Support for coinduction. -- • Data -- Data types and properties about data types. (Also some -- combinators working solely on and with functions; see -- Data.Function.) -- • Foreign -- Related to the foreign function interface. -- • Induction -- A general framework for induction (includes lexicographic and -- well-founded induction). -- • IO -- Input/output-related functions. -- • Level -- Universe levels. -- • Relation -- Properties of and proofs about relations (mostly homogeneous -- binary relations). -- • Size -- Sizes used by the sized types mechanism. ------------------------------------------------------------------------ -- A selection of useful library modules ------------------------------------------------------------------------ -- Note that module names in source code are often hyperlinked to the -- corresponding module. In the Emacs mode you can follow these -- hyperlinks by typing M-. or clicking with the middle mouse button. -- • Some data types import Data.Bool -- Booleans. import Data.Char -- Characters. import Data.Empty -- The empty type. import Data.Fin -- Finite sets. import Data.List -- Lists. import Data.Maybe -- The maybe type. import Data.Nat -- Natural numbers. import Data.Product -- Products. import Data.Stream -- Streams. import Data.String -- Strings. import Data.Sum -- Disjoint sums. import Data.Unit -- The unit type. import Data.Vec -- Fixed-length vectors. -- • Some types used to structure computations import Category.Functor -- Functors. import Category.Applicative -- Applicative functors. import Category.Monad -- Monads. -- • Equality -- Propositional equality: import Relation.Binary.PropositionalEquality -- Convenient syntax for "equational reasoning" using a preorder: import Relation.Binary.PreorderReasoning -- Solver for commutative ring or semiring equalities: import Algebra.RingSolver -- • Properties of functions, sets and relations -- Monoids, rings and similar algebraic structures: import Algebra -- Negation, decidability, and similar operations on sets: import Relation.Nullary -- Properties of homogeneous binary relations: import Relation.Binary -- • Induction -- An abstraction of various forms of recursion/induction: import Induction -- Well-founded induction: import Induction.WellFounded -- Various forms of induction for natural numbers: import Induction.Nat -- • Support for coinduction import Coinduction -- • IO import IO ------------------------------------------------------------------------ -- Record hierarchies ------------------------------------------------------------------------ -- When an abstract hierarchy of some sort (for instance semigroup → -- monoid → group) is included in the library the basic approach is to -- specify the properties of every concept in terms of a record -- containing just properties, parameterised on the underlying -- operations, sets etc.: -- -- record IsSemigroup {A} (≈ : Rel A) (∙ : Op₂ A) : Set where -- open FunctionProperties ≈ -- field -- isEquivalence : IsEquivalence ≈ -- assoc : Associative ∙ -- ∙-cong : ∙ Preserves₂ ≈ ⟶ ≈ ⟶ ≈ -- -- More specific concepts are then specified in terms of the simpler -- ones: -- -- record IsMonoid {A} (≈ : Rel A) (∙ : Op₂ A) (ε : A) : Set where -- open FunctionProperties ≈ -- field -- isSemigroup : IsSemigroup ≈ ∙ -- identity : Identity ε ∙ -- -- open IsSemigroup isSemigroup public -- -- Note here that open IsSemigroup isSemigroup public ensures that the -- fields of the isSemigroup record can be accessed directly; this -- technique enables the user of an IsMonoid record to use underlying -- records without having to manually open an entire record hierarchy. -- This is not always possible, though. Consider the following definition -- of preorders: -- -- record IsPreorder {A : Set} -- (_≈_ : Rel A) -- The underlying equality. -- (_∼_ : Rel A) -- The relation. -- : Set where -- field -- isEquivalence : IsEquivalence _≈_ -- -- Reflexivity is expressed in terms of an underlying equality: -- reflexive : _≈_ ⇒ _∼_ -- trans : Transitive _∼_ -- ∼-resp-≈ : _∼_ Respects₂ _≈_ -- -- module Eq = IsEquivalence isEquivalence -- -- refl : Reflexive _∼_ -- refl = reflexive Eq.refl -- -- The Eq module in IsPreorder is not opened publicly, because it -- contains some fields which clash with fields or other definitions -- in IsPreorder. -- Records packing up properties with the corresponding operations, -- sets, etc. are sometimes also defined: -- -- record Semigroup : Set₁ where -- infixl 7 _∙_ -- infix 4 _≈_ -- field -- Carrier : Set -- _≈_ : Rel Carrier -- _∙_ : Op₂ Carrier -- isSemigroup : IsSemigroup _≈_ _∙_ -- -- open IsSemigroup isSemigroup public -- -- setoid : Setoid -- setoid = record { isEquivalence = isEquivalence } -- -- record Monoid : Set₁ where -- infixl 7 _∙_ -- infix 4 _≈_ -- field -- Carrier : Set -- _≈_ : Rel Carrier -- _∙_ : Op₂ Carrier -- ε : Carrier -- isMonoid : IsMonoid _≈_ _∙_ ε -- -- open IsMonoid isMonoid public -- -- semigroup : Semigroup -- semigroup = record { isSemigroup = isSemigroup } -- -- open Semigroup semigroup public using (setoid) -- -- Note that the Monoid record does not include a Semigroup field. -- Instead the Monoid /module/ includes a "repackaging function" -- semigroup which converts a Monoid to a Semigroup. -- The above setup may seem a bit complicated, but we think it makes the -- library quite easy to work with, while also providing enough -- flexibility. ------------------------------------------------------------------------ -- More documentation ------------------------------------------------------------------------ -- Some examples showing where the natural numbers and some related -- operations and properties are defined, and how they can be used: import README.Nat ------------------------------------------------------------------------ -- Core modules ------------------------------------------------------------------------ -- Some modules have names ending in ".Core". These modules are -- internal, and have (mostly) been created to avoid mutual recursion -- between modules. They should not be imported directly; their -- contents are reexported by other modules. ------------------------------------------------------------------------ -- All library modules ------------------------------------------------------------------------ -- For short descriptions of every library module, see Everything: import Everything