text stringlengths 4 690k |
|---|
------------------------------------------------------------------------
-- The Agda standard library
--
-- Bounded vectors
------------------------------------------------------------------------
-- Vectors of a specified maximum length.
{-# OPTIONS --without-K --safe #-}
module Data.BoundedVec where
open import D... |
primitive
data D : Set where
-- Bad error message WAS:
-- A postulate block can only contain type signatures or instance blocks
|
-- Andreas, 2016-07-29 issue #707, comment of 2012-10-31
open import Common.Nat
data Vec (A : Set) : Nat โ Set where
[] : Vec A zero
_โท_ : โ {n} (x : A) (xs : Vec A n) โ Vec A (suc n)
v0 v1 v2 : Vec Nat _
v0 = []
v1 = 0 โท v0
v2 = 1 โท v1
-- Works, but maybe questionable.
-- The _ is triplicated into three diffe... |
{-# OPTIONS --without-K --safe --no-universe-polymorphism
--no-sized-types --no-guardedness --no-subtyping #-}
module Agda.Builtin.Unit where
record โค : Set where
instance constructor tt
{-# BUILTIN UNIT โค #-}
{-# COMPILE GHC โค = data () (()) #-}
|
{- The trivial resource -}
module Relation.Ternary.Separation.Construct.Unit where
open import Data.Unit
open import Data.Product
open import Relation.Unary
open import Relation.Binary hiding (_โ_)
open import Relation.Binary.PropositionalEquality as P
open import Relation.Ternary.Separation
open RawSep
instance uni... |
{-# OPTIONS --with-K #-}
open import Axiom.Extensionality.Propositional using (Extensionality)
open import Relation.Nullary.Negation using (contradiction)
open import Relation.Binary using (Irrelevant)
open import Relation.Binary.PropositionalEquality using (_โก_; _โข_)
open import Relation.Binary.PropositionalEquality.W... |
module _ where
module A where
postulate
!_ : Setโ โ Setโ
infix 1 !_
module B where
postulate
!_ : Setโ โ Setโ
infix 3 !_
open A
open B
postulate
#_ : Setโ โ Setโ
infix 2 #_
okโ : Setโ โ Setโ
okโ X = ! # X
okโ : Setโ โ Setโ
... |
module foldl where
import Relation.Binary.PropositionalEquality as Eq
open Eq using (_โก_; refl; sym; trans; cong)
open Eq.โก-Reasoning
open import lists using (List; []; _โท_; [_,_,_])
foldl : โ {A B : Set} โ (B โ A โ B) โ B โ List A โ B
foldl _โ_ e [] = e
foldl _โ_ e (x โท xs) = foldl _โ_ (e โ x) xs
test-foldl ... |
------------------------------------------------------------------------
-- The Agda standard library
--
-- The extensional sublist relation over setoid equality.
------------------------------------------------------------------------
{-# OPTIONS --without-K --safe #-}
open import Relation.Binary
module Data.List.R... |
open import MJ.Types
import MJ.Classtable.Core as Core
import MJ.Classtable.Code as Code
import MJ.Syntax as Syntax
module MJ.Semantics.Objects.Flat {c}(Ct : Core.Classtable c)(โ : Code.Code Ct) where
open import Prelude
open import Level renaming (suc to lsuc; zero to lzero)
open import Data.Vec hiding (_++_; looku... |
-- Andreas, 2020-05-01, issue #4631
--
-- We should not allow @-patterns to shadow constructors!
open import Agda.Builtin.Bool
test : Set โ Set
test true@_ = true
-- WAS: succees
-- EXPECTED:
--
-- Bool !=< Set
-- when checking that the expression true has type Set
--
-- โโโโ Warning(s) โโโโโโโโโโโโโโโโโโโโโโโโโโโโ... |
------------------------------------------------------------------------------
-- Propositional equality on inductive PA
------------------------------------------------------------------------------
{-# OPTIONS --exact-split #-}
{-# OPTIONS --no-sized-types #-}
{-# OPTIONS --no-universe-polymor... |
{-# OPTIONS --without-K #-}
open import lib.Basics
module lib.types.Sigma where
-- Cartesian product
_ร_ : โ {i j} (A : Type i) (B : Type j) โ Type (lmax i j)
A ร B = ฮฃ A (ฮป _ โ B)
infixr 5 _ร_
module _ {i j} {A : Type i} {B : A โ Type j} where
pair : (a : A) (b : B a) โ ฮฃ A B
pair a b = (a , b)
-- pair= h... |
{-# OPTIONS --without-K --exact-split --safe #-}
module 06-universes where
import 05-identity-types
open 05-identity-types public
--------------------------------------------------------------------------------
-- Section 6.3 Observational equality on the natural numbers
-- Definition 6.3.1
Eq-โ : โ โ โ โ UU lzer... |
{-# OPTIONS --cubical --no-import-sorts --allow-unsolved-metas #-}
module Number.Instances.QuoQ.Definitions where
open import Agda.Primitive renaming (_โ_ to โ-max; lsuc to โ-suc; lzero to โ-zero)
open import Cubical.Foundations.Everything renaming (_โปยน to _โปยนแต; assoc to โ-assoc)
open import Cubical.Foundations.Logic... |
-- TODO: Generalize and move to Structure.Categorical.Proofs
module Structure.Category.Proofs where
import Lvl
open import Data
open import Data.Tuple as Tuple using (_,_)
open import Functional using (const ; swap ; _$_)
open import Lang.Instance
open import Logic
open import Logic.Propositional
open import Logi... |
module OscarEverything where
open import OscarPrelude
open import HasSubstantiveDischarge
|
{-# OPTIONS --cubical --safe #-}
module Cardinality.Finite.SplitEnumerable.Instances where
open import Cardinality.Finite.SplitEnumerable
open import Cardinality.Finite.SplitEnumerable.Inductive
open import Cardinality.Finite.ManifestBishop using (_|ฮ |_)
open import Data.Fin
open import Prelude
open import Data.List.... |
-- 2012-03-08 Andreas
module _ where
{-# TERMINATING #-}
-- error: misplaced pragma
|
-- Andreas, 2014-01-16, issue 1406
-- Agda with K again is inconsistent with classical logic
-- {-# OPTIONS --cubical-compatible #-}
open import Common.Level
open import Common.Prelude
open import Common.Equality
cast : {A B : Set} (p : A โก B) (a : A) โ B
cast refl a = a
data HEq {ฮฑ} {A : Set ฮฑ} (a : A) : {B : Set ... |
{-# OPTIONS --cubical-compatible #-}
------------------------------------------------------------------------
-- Universe levels
------------------------------------------------------------------------
module Common.Level where
open import Agda.Primitive public using (Level; lzero; lsuc; _โ_)
-- Lifting.
record Lif... |
{- Byzantine Fault Tolerant Consensus Verification in Agda, version 0.9.
Copyright (c) 2021, Oracle and/or its affiliates.
Licensed under the Universal Permissive License v 1.0 as shown at https://opensource.oracle.com/licenses/upl
-}
{-# OPTIONS --allow-unsolved-metas #-}
-- This module provides some scaffoldi... |
module utm where
open import turing
open import Data.Product
-- open import Data.Bool
open import Data.List
open import Data.Nat
open import logic
data utmStates : Set where
reads : utmStates
read0 : utmStates
read1 : utmStates
read2 : utmStates
read3 : utmStates
read4 : utmStates
r... |
{-# OPTIONS --safe #-}
module Cubical.HITs.TypeQuotients where
open import Cubical.HITs.TypeQuotients.Base public
open import Cubical.HITs.TypeQuotients.Properties public
|
data _โก_ {A : Set} (x : A) : A โ Set where
refl : x โก x
cong : โ {A B : Set} (f : A โ B) {x y : A} โ x โก y โ f x โก f y
cong f refl = refl
data โ : Set where
zero : โ
suc : โ โ โ
data Fin : โ โ Set where
zero : {n : โ} โ Fin (suc n)
suc : {n : โ} (i : Fin n) โ Fin (suc n)
data _โค_ : โ โ โ โ Set where
... |
{-# OPTIONS --no-positivity-check #-}
module IIRDg where
import LF
import DefinitionalEquality
import IIRD
open LF
open DefinitionalEquality
open IIRD
mutual
data Ug {I : Set}{D : I -> Set1}(ฮณ : OPg I D) : I -> Set where
introg : (a : Gu ฮณ (Ug ฮณ) (Tg ฮณ)) -> Ug ฮณ (Gi ฮณ (Ug ฮณ) (Tg ฮณ) a)
Tg : {I : Set}{D : I ... |
module Oscar.Category.Setoid where
open import Oscar.Builtin.Objectevel
open import Oscar.Property
record IsSetoid {๐ฌ} {๐ : ร ๐ฌ} {๐ฎ} (_โ_ : ๐ด 1 ๐ ๐ฎ) : ร ๐ฌ โฬ ๐ฎ where
field
reflexivity : โ x โ x โ x
symmetry : โ {x y} โ x โ y โ y โ x
transitivity : โ {x y} โ x โ y โ โ {z} โ y โ z โ x โ z
open ... |
module _ where
data Flat (A : Set) : Set where
flat : @โญ A โ Flat A
-- the lambda cohesion annotation must match the domain.
into : {A : Set} โ A โ Flat A
into = ฮป (@โญ a) โ flat a
|
{-# OPTIONS --cubical --safe #-}
module Data.String where
open import Agda.Builtin.String using (String) public
open import Agda.Builtin.String
open import Agda.Builtin.String.Properties
open import Agda.Builtin.Char using (Char) public
open import Agda.Builtin.Char
open import Agda.Builtin.Char.Properties
open impor... |
-- Example usage of solver
{-# OPTIONS --without-K --safe #-}
open import Categories.Category
module Experiment.Categories.Solver.Category.Example
{o โ e} (๐ : Category o โ e) where
open import Experiment.Categories.Solver.Category ๐
open Category ๐
open HomReasoning
private
variable
A B C D E : Obj
m... |
----------------------------------------------------------------
-- This file contains the definition of isomorphisms. --
----------------------------------------------------------------
module Category.Iso where
open import Category.Category
record Iso {l : Level}{โ : Cat {l}}{A B : Obj โ} (f : el (Hom โ A B... |
------------------------------------------------------------------------
-- The Agda standard library
--
-- The Cowriter type and some operations
------------------------------------------------------------------------
{-# OPTIONS --without-K --safe --sized-types #-}
module Codata.Cowriter where
open import Size
imp... |
module Dave.Algebra.Naturals.Bin where
open import Dave.Algebra.Naturals.Definition
open import Dave.Algebra.Naturals.Addition
open import Dave.Algebra.Naturals.Multiplication
open import Dave.Embedding
data Bin : Set where
โจโฉ : Bin
_t : Bin โ Bin
_f : Bin โ Bin
inc : Bin โ Bin
inc โจโฉ = โจโฉ... |
open import ExtractSac as ES using ()
open import Extract (ES.kompile-fun)
open import Data.Nat as N using (โ; zero; suc; _โค_; _โฅ_; _<_; _>_; sโคs; zโคn; _โธ_)
import Data.Nat.DivMod as N
open import Data.Nat.Properties as N
open import Data.List as L using (List; []; _โท_)
open import Data.Vec as V using (Vec; []; _... |
module Properties.Base where
open import Data.Maybe hiding (All)
open import Data.List
open import Data.List.All
open import Data.Product
open import Data.Sum
open import Relation.Nullary
open import Relation.Binary.PropositionalEquality
open import Typing
open import Global
open import Values
open import Session
op... |
open import Oscar.Prelude
open import Oscar.Class.IsFunctor
open import Oscar.Class.Reflexivity
open import Oscar.Class.Smap
open import Oscar.Class.Surjection
open import Oscar.Class.Transitivity
module Oscar.Class.Functor where
record Functor ๐ฌโ ๐ฏโ โโ ๐ฌโ ๐ฏโ โโ : ร โฬ (๐ฌโ โฬ ๐ฏโ โฬ โโ โฬ ๐ฌโ โฬ ๐ฏโ โฬ โโ) wher... |
------------------------------------------------------------------------
-- INCREMENTAL ฮป-CALCULUS
--
-- Overloading โฆ_โง notation
--
-- This module defines a general mechanism for overloading the
-- โฆ_โง notation, using Agdaโs instance arguments.
------------------------------------------------------------------------
... |
{-# OPTIONS --allow-unsolved-metas #-}
module IsLiteralProblem where
open import OscarPrelude
open import IsLiteralSequent
open import Problem
record IsLiteralProblem (๐ : Problem) : Set
where
constructor _ยถ_
field
{problem} : Problem
isLiteralInferences : All IsLiteralSequent (inferences ๐)
isLite... |
module Pi-.Invariants where
open import Data.Empty
open import Data.Unit
open import Data.Sum
open import Data.Product
open import Relation.Binary.Core
open import Relation.Binary
open import Relation.Nullary
open import Relation.Binary.PropositionalEquality
open import Data.Nat
open import Data.Nat.Properties
open imp... |
------------------------------------------------------------------------
-- Two logically equivalent axiomatisations of equality
------------------------------------------------------------------------
{-# OPTIONS --without-K --safe #-}
module Equality where
open import Logical-equivalence hiding (id; _โ_)
open impo... |
{-# OPTIONS -v tc.conv.irr:50 #-}
-- {-# OPTIONS -v tc.lhs.unify:50 #-}
module IndexInference where
data Nat : Set where
zero : Nat
suc : Nat -> Nat
data Vec (A : Set) : Nat -> Set where
[] : Vec A zero
_::_ : {n : Nat} -> A -> Vec A n -> Vec A (suc n)
infixr 40 _::_
-- The length of the vector can be in... |
{-# OPTIONS --safe #-}
module Definition.Typed.Properties where
open import Definition.Untyped
open import Definition.Untyped.Properties
open import Definition.Typed
open import Definition.Typed.RedSteps
import Definition.Typed.Weakening as Twk
open import Tools.Empty using (โฅ; โฅ-elim)
open import Tools.Product
ope... |
{-# OPTIONS --cubical --safe #-}
module Data.Nat.Properties where
open import Data.Nat.Base
open import Agda.Builtin.Nat using () renaming (_<_ to _<แดฎ_; _==_ to _โกแดฎ_) public
open import Prelude
open import Cubical.Data.Nat using (caseNat; injSuc) public
open import Data.Nat.DivMod
mutual
_-1โ_ : โ โ โ โ โ
zero ... |
------------------------------------------------------------------------
-- Paths and extensionality
------------------------------------------------------------------------
{-# OPTIONS --erased-cubical --safe #-}
module Equality.Path where
import Bijection
open import Equality hiding (module Derived-definitions-and... |
-- Andreas, 2017-07-26
-- Better error message when constructor not fully applied.
open import Agda.Builtin.Nat
test : (Nat โ Nat) โ Nat
test suc = suc zero
-- WAS: Type mismatch
-- NOW: Cannot pattern match on functions
-- when checking that the pattern suc has type Nat โ Nat
|
-- Andreas, 2018-10-17, re #2757
--
-- Don't project from erased matches.
open import Agda.Builtin.List
open import Common.Prelude
data IsCons {A : Set} : List A โ Set where
isCons : โ{@0 x : A} {@0 xs : List A} โ IsCons (x โท xs)
headOfErased : โ{A} (@0 xs : List A) โ IsCons xs โ A
headOfErased (x โท xs) isCons = x... |
------------------------------------------------------------------------------
-- Well-founded induction on the lexicographic order on natural numbers
------------------------------------------------------------------------------
{-# OPTIONS --exact-split #-}
{-# OPTIONS --no-sized-types #-}
{-#... |
module Numeral.Natural.Oper.Divisibility where
import Lvl
open import Data
open import Data.Boolean
open import Numeral.Natural
open import Numeral.Natural.Oper.Comparisons
open import Numeral.Natural.Oper.Modulo
-- Divisibility check
_โฃ?_ : โ โ โ โ Bool
๐ โฃ? _ = ๐น
๐(y) โฃ? x = zero?(x mod ๐(y))
-- Divisi... |
record R (A : Set) : Set where field giveA : A
open R โฆ โฆ โฆ
record WrapR (A : Set) : Set where field instance โฆ wrappedR โฆ : R A
open WrapR โฆ โฆ โฆ
postulate
instance R-instance : โ {X} โ WrapR X
data D : Set where
works : D
works = giveA โฆ WrapR.wrappedR (R-instance {D}) โฆ
fails : D
fails = giveA โฆ {!!} โฆ
-- No ... |
{-# OPTIONS --safe --warning=error --without-K #-}
open import LogicalFormulae
open import Setoids.Setoids
open import Functions.Definition
open import Agda.Primitive using (Level; lzero; lsuc; _โ_)
open import Numbers.Naturals.Naturals
open import Numbers.Integers.Integers
open import Groups.Definition
open import Gr... |
------------------------------------------------------------------------
-- The partiality monad's monad instance, defined via an adjunction
------------------------------------------------------------------------
{-# OPTIONS --cubical --safe #-}
module Partiality-monad.Inductive.Monad.Adjunction where
open import E... |
------------------------------------------------------------------------------
-- The group commutator
------------------------------------------------------------------------------
{-# OPTIONS --exact-split #-}
{-# OPTIONS --no-sized-types #-}
{-# OPTIONS --no-universe-polymorphism #-}
{-# OPTI... |
module Categories.Congruence where
open import Level
open import Relation.Binary hiding (_โ_; Setoid)
open import Categories.Support.PropositionalEquality
open import Categories.Support.Equivalence
open import Categories.Support.EqReasoning
open import Categories.Category hiding (module Heterogeneous; _[_โผ_])
recor... |
--------------------------------------------------------------------------------
-- This is part of Agda Inference Systems
{-# OPTIONS --sized-types --guardedness #-}
open import Agda.Builtin.Equality
open import Data.Product
open import Data.Sum
open import Codata.Thunk
open import Size
open import Level
open impor... |
module Data.Bin.Minus where
open import Data.Bin hiding (suc; fromโ)
open Data.Bin using (2+_)
open import Data.Bin.Bijection using (fromโ)
open import Data.Fin hiding (_-_; _+_; toโ; _<_; fromโ)
open import Data.List
open import Data.Digit
open import Relation.Binary.PropositionalEquality
open import ... |
------------------------------------------------------------------------
-- The Agda standard library
--
-- Homogeneously-indexed binary relations
------------------------------------------------------------------------
-- The contents of this module should be accessed via
-- `Relation.Binary.Indexed.Homogeneous`.
{-... |
------------------------------------------------------------------------------
-- FOTC combinators for lists, colists, streams, etc.
------------------------------------------------------------------------------
{-# OPTIONS --exact-split #-}
{-# OPTIONS --no-sized-types #-}
{-# OPTIONS --no-univ... |
{-# OPTIONS --no-syntactic-equality #-}
open import Agda.Primitive
variable
a : Level
postulate
A : Set a
|
module MultipleIdentifiersOneSignature where
data Bool : Set where
false true : Bool
data Suit : Set where
โฅ โข โ โฃ : Suit
record R : Setโ where
field
A B C : Set
postulate
A Char : Set
B C : Set
{-# BUILTIN CHAR Char #-}
{-# BUILTIN BOOL Bool #-}
{-# BUILTIN TRUE true #-}
{-# BUILTIN FALSE f... |
{-# OPTIONS --type-in-type #-}
module Spire.DarkwingDuck.Primitive where
----------------------------------------------------------------------
infixr 4 _,_
infixr 5 _โท_
----------------------------------------------------------------------
postulate String : Set
{-# BUILTIN STRING String #-}
---------------------... |
{-# OPTIONS --safe #-}
module Cubical.Algebra.CommRing.Instances.Int where
open import Cubical.Foundations.Prelude
open import Cubical.Algebra.CommRing
open import Cubical.Data.Int as Int
renaming ( โค to โคType ; _+_ to _+โค_; _ยท_ to _ยทโค_; -_ to -โค_)
open CommRingStr
โค : CommRing โ-zero
fst โค = โคType
0r (snd โค) = 0... |
open import eq
open import bool
open import bool-relations using (transitive; total)
open import maybe
open import nat
open import nat-thms using (โค-trans; โค-total)
open import product
module z05-01-hc-sorted-list-test where
open import bool-relations _โค_ hiding (transitive; total)
import z05-01-hc-sorted-list... |
-- A variant of code reported by Andreas Abel.
{-# OPTIONS --guardedness --sized-types #-}
open import Agda.Builtin.Size
data โฅ : Set where
mutual
data D (i : Size) : Set where
inn : D' i โ D i
record D' (i : Size) : Set where
coinductive
field โญ : {j : Size< i} โ D j
open D'
bla : โ{i} โ D' i
โญ... |
postulate
H I : Set โ Set โ Set
!_ : Set โ Set
X : Set
infix 1 !_
infix 0 H
syntax H X Y = X , Y
syntax I X Y = Y , X
-- This parsed when default fixity was 'unrelated', but with
-- an actual default fixity (of any strength) in place it really
-- should not.
Foo : Set
Foo = ! X , X
|
open import Nat
open import Prelude
open import core
open import contexts
open import lemmas-consistency
open import type-assignment-unicity
open import lemmas-progress-checks
-- taken together, the theorems in this file argue that for any expression
-- d, at most one summand of the labeled sum that results from progr... |
-- Haskell-like do-notation.
module Syntax.Do where
open import Functional
import Lvl
open import Syntax.Idiom
open import Type
private variable โ โโ โโ : Lvl.Level
private variable A B : Type{โ}
private variable F : Type{โโ} โ Type{โโ}
record DoNotation (F : Type{โโ} โ Type{โโ}) : Type{Lvl.๐(โโ) Lvl.โ โโ} whe... |
{-# OPTIONS --without-K #-}
module Model.Terminal where
open import Cats.Category
open import Model.Type.Core
open import Util.HoTT.HLevel
open import Util.Prelude hiding (โค)
โค : โ {ฮ} โ โฆTypeโง ฮ
โค = record
{ ObjHSet = ฮป _ โ HLevel-suc โค-HProp
; eqHProp = ฮป _ _ _ โ โค-HProp
}
instance
hasTerminal : โ {ฮ} โ... |
module tree-io-example where
open import io
open import list
open import maybe
open import string
open import tree
open import unit
open import nat-to-string
errmsg = "Run with a single (small) number as the command-line argument.\n"
processArgs : ๐ string โ IO โค
processArgs (s :: []) with string-to-โ s
... | not... |
module STLC.Syntax where
open import Prelude public
--------------------------------------------------------------------------------
-- Types
infixr 7 _โ_
data ๐ฏ : Set
where
โต : ๐ฏ
_โ_ : (A B : ๐ฏ) โ ๐ฏ
--------------------------------------------------------------------------------
-- Contexts
... |
open import Relation.Binary
open import Relation.Binary.PropositionalEquality
open import Data.Product
open import Level
module IndexedMap
{Index : Set} {Key : Index โ Set} {_โ_ _<_ : Rel (โ Key) zero}
(isOrderedKeySet : IsStrictTotalOrder _โ_ _<_)
-- Equal keys must have equal indices.
... |
-- 2012-03-08 Andreas
module NoTerminationCheck1 where
{-# NO_TERMINATION_CHECK #-}
-- error: misplaced pragma
|
------------------------------------------------------------------------
-- The Agda standard library
--
-- Convenient syntax for "equational reasoning" using a partial order
------------------------------------------------------------------------
open import Relation.Binary
module Relation.Binary.PartialOrderReasoni... |
open import Level
module Ordinals where
open import zf
open import Data.Nat renaming ( zero to Zero ; suc to Suc ; โ to Nat ; _โ_ to _nโ_ )
open import Data.Empty
open import Relation.Binary.PropositionalEquality
open import logic
open import nat
open import Data.Unit using ( โค )
open import Relation.Nullary
ope... |
module Fin where
data Nat : Set where
zero : Nat
succ : Nat -> Nat
data Fin : Nat -> Set where
fzero : {n : Nat} -> Fin (succ n)
fsucc : {n : Nat} -> Fin n -> Fin (succ n)
|
module sets.nat.ordering.leq.alternative where
open import equality.core
open import equality.calculus
open import function.isomorphism
open import hott.equivalence.logical
open import hott.level.core
open import hott.level.sets
open import sets.nat.core
open import sets.nat.properties
open import sets.nat.ordering.le... |
module Type.Properties.Empty.Proofs where
import Data.Tuple
open import Data
open import Functional
open import Logic.Propositional
import Lvl
open import Type.Properties.Inhabited
open import Type.Properties.Empty
open import Type
private variable โ : Lvl.Level
private variable A B T : Type{โ}
-- A type i... |
-- Andreas, 2011-05-30
-- {-# OPTIONS -v tc.lhs.unify:50 #-}
module Issue292 where
data Bool : Set where true false : Bool
data Bool2 : Set where true2 false2 : Bool2
data โฅ : Set where
infix 3 ยฌ_
ยฌ_ : Set โ Set
ยฌ P = P โ โฅ
infix 4 _โ
_
data _โ
_ {A : Set} (x : A) : โ {B : Set} โ B โ Set where
refl : x โ
x
r... |
module Structure.Relator.Equivalence.Proofs where
import Lvl
open import Functional
open import Structure.Relator.Equivalence
open import Structure.Relator.Properties.Proofs
open import Type
private variable โ : Lvl.Level
private variable T A B : Type{โ}
private variable _โซ_ : T โ T โ Type{โ}
private variable f ... |
{-# OPTIONS --universe-polymorphism #-}
module Categories.Category.Construction.F-Algebras where
open import Level
open import Data.Product using (projโ; projโ)
open import Categories.Category
open import Categories.Functor hiding (id)
open import Categories.Functor.Algebra
open import Categories.Object.Initial
impor... |
-- ----------------------------------------------------------------------
-- The Agda Descriptor Library
--
-- (Open) Descriptors
-- ----------------------------------------------------------------------
module Data.Desc where
open import Data.List using (List; []; _โท_)
open import Data.List.Relation.Unary.All using... |
module _ where
module M where
F : Set โ Set
F A = A
open M
infix 0 F
syntax F A = [ A ]
G : Set โ Set
G A = [ A ]
|
{-# OPTIONS --without-K --safe #-}
-- Composition of pseudofunctors
module Categories.Pseudofunctor.Composition where
open import Data.Product using (_,_)
open import Categories.Bicategory using (Bicategory)
import Categories.Bicategory.Extras as BicategoryExt
open import Categories.Category using (Category)
open i... |
-- notes-01-monday.agda
open import Data.Nat
open import Data.Bool
f : โ โ โ
f x = x + 2
{-
f 3 =
= (x + 2)[x:=3] =
= 3 + 2 =
= 5
-}
n : โ
n = 3
f' : โ โ โ
f' = ฮป x โ x + 2 -- ฮป function (nameless function)
{-
f' 3 =
= (ฮป x โ x + 2) 3 =
= (x + 2)[x := 3] = -- ฮฒ-reduction
= 3 + 2 =
= 5
-}
g ... |
------------------------------------------------------------------------
-- Strict ฯ-continuous functions
------------------------------------------------------------------------
{-# OPTIONS --cubical --safe #-}
module Partiality-monad.Inductive.Strict-omega-continuous where
open import Equality.Propositional.Cubica... |
-- The positivity checker should not be run twice for the same mutual
-- block. (If we decide to turn Agda into a total program, then we may
-- want to revise this decision.)
{-# OPTIONS -vtc.pos.graph:5 #-}
module Positivity-once where
A : Setโ
module M where
B : Setโ
B = A
A = Set
|
-- This module introduces built-in types and primitive functions.
module Introduction.Built-in where
{- Agda supports four built-in types :
- integers,
- floating point numbers,
- characters, and
- strings.
Note that strings are not defined as lists of characters (as is the case in
Haskell).
... |
{- Example by Andreas (2015-09-18) -}
{-# OPTIONS --rewriting --local-confluence-check #-}
open import Common.Prelude
open import Common.Equality
{-# BUILTIN REWRITE _โก_ #-}
module _ (A : Set) where
postulate
plus0p : โ{x} โ (x + zero) โก x
{-# REWRITE plus0p #-}
|
module <-trans where
open import Data.Nat using (โ)
open import Relations using (_<_; z<s; s<s)
<-trans : โ {m n p : โ}
โ m < n
โ n < p
-----
โ m < p
<-trans z<s (s<s _) = z<s
<-trans (s<s a) (s<s b) = s<s (<-trans a b)
|
module BTree {A : Set} where
open import Data.List
data BTree : Set where
leaf : BTree
node : A โ BTree โ BTree โ BTree
flatten : BTree โ List A
flatten leaf = []
flatten (node x l r) = (flatten l) ++ (x โท flatten r)
|
module FunctorCat where
open import Categories
open import Functors
open import Naturals
FunctorCat : โ{a b c d} โ Cat {a}{b} โ Cat {c}{d} โ Cat
FunctorCat C D = record{
Obj = Fun C D;
Hom = NatT;
iden = idNat;
comp = compNat;
idl = idlNat;
idr = idrNat;
ass = ฮป{_}{_}{_}{_}{ฮฑ}{ฮฒ}{ฮท} โ assNat {ฮฑ = ฮฑ... |
module agdaFunction where
addOne : N -> N
addOne Z = suc Z
addOne (suc a) = suc (suc a)
|
{- modified from a bug report given to me by Ulf Norell, for a
previous, incorrect version of bt-remove-min. -}
module braun-tree-test where
open import nat
open import list
open import product
open import sum
open import eq
import braun-tree
open braun-tree nat _<_
test : braun-tree 4
test = bt-node 2
... |
{-# OPTIONS --allow-unsolved-metas #-}
module Control.Monad.Free where
open import Prelude
data Free (F : Type a โ Type a) (A : Type a) : Type (โsuc a) where
lift : F A โ Free F A
return : A โ Free F A
_>>=_ : Free F B โ (B โ Free F A) โ Free F A
>>=-idหก : isSet A โ (f : B โ Free F A) (x : B) โ (return x... |
module 747Quantifiers where
-- Library
import Relation.Binary.PropositionalEquality as Eq
open Eq using (_โก_; refl)
open import Data.Nat using (โ; zero; suc; _+_; _*_; _โค_; zโคn; sโคs) -- added โค
open import Relation.Nullary using (ยฌ_)
open import Data.Product using (_ร_; projโ; projโ) renaming (_,_ to โจ_,_โฉ) -- added ... |
-- Andreas, 2014-01-09, illegal double hiding info in typed bindings.
postulate
ok : ({A} : Set) โ Set
bad : {{A} : Set} โ Set
|
{-# OPTIONS --without-K --safe #-}
-- Definitions for the types of a polynomial stored in sparse horner
-- normal form.
--
-- These definitions ensure that the polynomial is actually in fully
-- canonical form, with no trailing zeroes, etc.
open import Polynomial.Parameters
module Polynomial.NormalForm.Definition
... |
{-# OPTIONS --warning=error --safe --without-K --guardedness #-}
open import Sets.EquivalenceRelations
open import Functions.Definition
open import Functions.Lemmas
open import Sets.FinSet.Definition
open import Sets.FinSet.Lemmas
open import Sets.Cardinality.Finite.Definition
open import LogicalFormulae
open import G... |
open import Function using (_โ_)
open import Category.Functor
open import Category.Monad
open import Data.Fin as Fin using (Fin) renaming (suc to fs; zero to fz)
import Data.Fin.Properties as FinProps
open import Data.Maybe as Maybe using (Maybe; maybe; just; nothing)
open import Data.Nat as Nat using (โ; suc; zero; _... |
{-# OPTIONS --exact-split #-}
{-# OPTIONS --no-sized-types #-}
{-# OPTIONS --no-universe-polymorphism #-}
{-# OPTIONS --without-K #-}
module SL where
open import Data.Nat
open import Data.Product
open import Data.Sum
open import Relation.Binary.PropositionalEquality
-- Example f... |
module Irrelevant where
open import Common.IO
open import Common.Nat
open import Common.Unit
A : Set
A = Nat
record R : Set where
id : A โ A
id x = x
postulate r : R
id2 : .A โ A โ A
id2 x y = y
open R
main : IO Unit
main = printNat (id2 10 20) ,,
printNat (id r 30) ,,
return unit
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.