text
stringlengths
4
690k
------------------------------------------------------------------------ -- The Agda standard library -- -- Properties of rose trees ------------------------------------------------------------------------ {-# OPTIONS --without-K --safe --sized-types #-} module Data.Tree.Rose.Properties where open import Level using...
module Day2 where open import Data.String as String open import Data.Maybe open import Foreign.Haskell using (Unit) open import Data.List as List hiding (fromMaybe) open import Data.Nat open import Data.Nat.DivMod import Data.Nat.Show as ℕs open import Data.Char open import Data.Vec as Vec renaming (_>>=_ to _VV=_ ;...
module OlderBasicILP.Indirect where open import Common.Context public -- Propositions of intuitionistic logic of proofs, without ∨, ⊥, or +. infixr 10 _⦂_ infixl 9 _∧_ infixr 7 _▻_ data Ty (X : Set) : Set where α_ : Atom → Ty X _▻_ : Ty X → Ty X → Ty X _⦂_ : X → Ty X → Ty X _∧_ : Ty X → Ty X → Ty X ⊤ : ...
------------------------------------------------------------------------------ -- Group theory properties using Agsy ------------------------------------------------------------------------------ {-# OPTIONS --allow-unsolved-metas #-} {-# OPTIONS --exact-split #-} {-# OPTIONS --no-sized-types ...
data Bool : Set where true false : Bool data Eq : Bool → Bool → Set where refl : (x : Bool) → Eq x x test : (x : Bool) → Eq true x → Set test _ (refl false) = Bool
------------------------------------------------------------------------ -- Some decision procedures for equality ------------------------------------------------------------------------ {-# OPTIONS --without-K --safe #-} open import Equality module Equality.Decision-procedures {reflexive} (eq : ∀ {a p} → Equality...
module Cats.Category.Cat.Facts.Exponential where open import Data.Product using (_,_) open import Level using (_⊔_) open import Relation.Binary using (IsEquivalence) open import Cats.Bifunctor using (Bifunctor ; Bifunctor→Functor₁ ; transposeBifunctor₁ ; transposeBifunctor₁-resp) open import Cats.Category open impo...
{-# OPTIONS --without-K --safe #-} open import Categories.Category using (Category) open import Categories.Category.Monoidal.Core using (Monoidal) module Categories.Category.Monoidal.Utilities {o ℓ e} {C : Category o ℓ e} (M : Monoidal C) where open import Level open import Function using (_$_) open import Data.Prod...
------------------------------------------------------------------------ -- A library of parser combinators ------------------------------------------------------------------------ -- This module also provides examples of parsers for which the indices -- cannot be inferred. module RecursiveDescent.Hybrid.Lib where o...
open import Data.Proofs open import Function.Proofs open import Logic.Propositional.Theorems open import Structure.Container.SetLike open import Structure.Relator open import Structure.Relator.Properties open import Syntax.Transitivity instance ImageSet-setLike : SetLike(_∈_ {ℓᵢ}) SetLike._⊆_ ...
module Issue180 where module Example₁ where data C : Set where c : C → C data Indexed : (C → C) → Set where i : Indexed c foo : Indexed c → Set foo i = C module Example₂ where data List (A : Set) : Set where nil : List A cons : A → List A → List A postulate A : Set x : A T...
{- Byzantine Fault Tolerant Consensus Verification in Agda, version 0.9. Copyright (c) 2020, 2021, Oracle and/or its affiliates. Licensed under the Universal Permissive License v 1.0 as shown at https://opensource.oracle.com/licenses/upl -} open import Optics.All open import LibraBFT.Prelude open import LibraBFT...
------------------------------------------------------------------------ -- The SKI encoding into types ------------------------------------------------------------------------ {-# OPTIONS --safe --without-K #-} module FOmegaInt.Undecidable.Encoding where open import Data.Context.WellFormed open import Data.List usi...
{-# OPTIONS --safe #-} module Cubical.Algebra.OrderedCommMonoid.Instances where open import Cubical.Foundations.Prelude open import Cubical.Algebra.OrderedCommMonoid.Base open import Cubical.Data.Nat open import Cubical.Data.Nat.Order ℕ≤+ : OrderedCommMonoid ℓ-zero ℓ-zero ℕ≤+ .fst = ℕ ℕ≤+ .snd .OrderedCommMonoidStr...
module _ where open import Common.Prelude open import Common.Reflection open import Common.Equality record Foo (A : Set) : Set where field foo : A → Nat open Foo {{...}} instance FooNat : Foo Nat foo {{FooNat}} n = n FooBool : Foo Bool foo {{FooBool}} true = 1 foo {{FooBool}} false = 0 macro d...
------------------------------------------------------------------------ -- The Agda standard library -- -- Properties of membership of vectors based on propositional equality. ------------------------------------------------------------------------ {-# OPTIONS --without-K --safe #-} module Data.Vec.Membership.Propos...
module Issue357a where module M (X : Set) where data R : Set where r : X → R postulate P Q : Set q : Q open M P open M.R works : M.R Q → Q works (M.R.r q) = q fails : M.R Q → Q fails (r q) = q
{-# OPTIONS --without-K --safe #-} open import Algebra.Structures.Bundles.Field import Algebra.Linear.Structures.Bundles.FiniteDimensional as FDB module Algebra.Linear.Space.FiniteDimensional.Product {k ℓᵏ} (K : Field k ℓᵏ) {n a₁ ℓ₁} (V₁-space : FDB.FiniteDimensional K a₁ ℓ₁ n) {p a₂ ℓ₂} (V₂-spac...
module Numeral.Sign.Oper where open import Data.Boolean open import Numeral.Sign -- Negation −_ : (+|−) → (+|−) − (➕) = (➖) − (➖) = (➕) -- Addition _+_ : (+|−) → (+|−) → (+|0|−) (➕) + (➕) = (➕) (➖) + (➖) = (➖) (➕) + (➖) = (𝟎) (➖) + (➕) = (𝟎) -- Multiplication _⨯_ : (+|−) → (+|−) → (+|−) (➕) ⨯ (➕) = (➕) (➖) ⨯ (➖) ...
{-# OPTIONS --without-K #-} module FinEquivCat where -- We will define a rig category whose objects are Fin types and whose -- morphisms are type equivalences; and where the equivalence of -- morphisms ≋ is extensional open import Level using () renaming (zero to lzero; suc to lsuc) open import Data.Fin using (Fin;...
{-# OPTIONS --cubical --safe #-} module Classical where open import Prelude open import Relation.Nullary.Stable using (Stable) public open import Relation.Nullary.Decidable.Properties using (Dec→Stable) public Classical : Type a → Type a Classical A = ¬ ¬ A pure : A → Classical A pure x k = k x _>>=_ : Classical A...
------------------------------------------------------------------------ -- Bi-invertibility with erased proofs ------------------------------------------------------------------------ -- The development is based on the presentation of bi-invertibility -- (for types and functions) and related things in the HoTT book, ...
------------------------------------------------------------------------------ -- The gcd is divisible by any common divisor (using equational reasoning) ------------------------------------------------------------------------------ {-# OPTIONS --exact-split #-} {-# OPTIONS --no-sized-types #-} ...
{-# OPTIONS --without-K #-} module Control.Category where open import Level using (suc; _⊔_) open import Relation.Binary hiding (_⇒_) open import Relation.Binary.PropositionalEquality -- Module HomSet provides notation A ⇒ B for the Set of morphisms -- from between objects A and B and names _≈_ and ≈-refl/sym/trans ...
module Cats.Category.Cat.Facts.Initial where open import Cats.Category open import Cats.Category.Cat using (Cat) open import Cats.Category.Zero using (Zero) open import Cats.Functor module _ {lo la l≈} where open Category (Cat lo la l≈) Zero-Initial : IsInitial (Zero lo la l≈) Zero-Initial X = ∃!-intro f _ ...
module Issue361 where data _==_ {A : Set}(a : A) : A -> Set where refl : a == a postulate A : Set a b : A F : A -> Set record R (a : A) : Set where constructor c field p : A beta : (x : A) -> R.p {b} (c {b} x) == x beta x = refl lemma : (r : R a) -> R.p {b} (c {b} (R.p {a} r)) == R.p {a} r lemma ...
open import lib module rtn (gratr2-nt : Set) where gratr2-rule : Set gratr2-rule = maybe string × maybe string × maybe gratr2-nt × 𝕃 (gratr2-nt ⊎ char) record gratr2-rtn : Set where field start : gratr2-nt _eq_ : gratr2-nt → gratr2-nt → 𝔹 gratr2-start : gratr2-nt → 𝕃 gratr2-rule gratr2-ret...
------------------------------------------------------------------------ -- Definitions of combinatorial functions on integers ------------------------------------------------------------------------ {-# OPTIONS --without-K --safe --exact-split #-} module Math.Combinatorics.IntegerFunction where open import Data.Nat...
open import Agda.Builtin.Unit open import Agda.Builtin.List open import Agda.Builtin.Reflection id : {A : Set} → A → A id x = x macro tac : Term → TC ⊤ tac hole = unify hole (def (quote id) (arg (arg-info visible (modality relevant quantity-ω)) (var 0 []) ∷ [])) test : ...
{-# OPTIONS --safe #-} module Squaring where open import Relation.Binary.PropositionalEquality open import Data.Nat open import Data.Product open import Data.Bool hiding (_≤_;_<_) open import Data.Nat.Properties open ≡-Reasoning div-mod2 : ℕ → ℕ × Bool div-mod2 0 = 0 , false div-mod2 (suc 0) = 0 , true div-mod2 (suc...
module TemporalOps.StrongMonad where open import CategoryTheory.Instances.Reactive open import CategoryTheory.Functor open import CategoryTheory.Monad open import CategoryTheory.Comonad open import CategoryTheory.NatTrans open import CategoryTheory.BCCCs open import CategoryTheory.CartesianStrength open import Tempo...
module Numeral.Natural.Relation.Order.Existence where import Lvl open import Logic open import Logic.Propositional open import Logic.Predicate open import Numeral.Natural open import Numeral.Natural.Oper open import Numeral.Natural.Oper.Proofs import Numeral.Natural.Relation.Order as [≤def] open import Relat...
------------------------------------------------------------------------ -- The Agda standard library -- -- Greatest common divisor ------------------------------------------------------------------------ {-# OPTIONS --without-K --safe #-} module Data.Nat.GCD where open import Data.Nat.Base open import Data.Nat.Divi...
open import Nat open import Prelude open import contexts open import dynamics-core module canonical-value-forms where canonical-value-forms-num : ∀{Δ d} → Δ , ∅ ⊢ d :: num → d val → Σ[ n ∈ Nat ] (d == N n) canonical-value-for...
{-# OPTIONS --cubical --no-import-sorts --safe #-} module Cubical.DStructures.Meta.Isomorphism where open import Cubical.Foundations.Prelude open import Cubical.Foundations.Equiv open import Cubical.Foundations.HLevels open import Cubical.Foundations.Isomorphism open import Cubical.Foundations.Univalence open import ...
module Structure.Function.Multi where open import Data open import Data.Boolean open import Data.Tuple.Raise import Data.Tuple.Raiseᵣ.Functions as Raise open import Data.Tuple.RaiseTypeᵣ import Data.Tuple.RaiseTypeᵣ.Functions as RaiseType open import Function.DomainRaise as DomainRaise using (_→̂_) import ...
------------------------------------------------------------------------ -- If the "Outrageous but Meaningful Coincidences" approach is used to -- formalise a language, then you can end up with an extensional type -- theory (with equality reflection) ---------------------------------------------------------------------...
module Issue888 (A : Set) where -- Check that let-bound variables show up in "show context" data ℕ : Set where zero : ℕ suc : ℕ → ℕ f : Set -> Set f X = let Y : ℕ -> Set Y n = ℕ m : ℕ m = {!!} in {!!} -- Issue 1112: dependent let-bindings data Singleton : ℕ → Set where mkSi...
------------------------------------------------------------------------ -- The Agda standard library -- -- An explanation about the `Axiom` modules. ------------------------------------------------------------------------ module README.Axiom where open import Level using (Level) private variable ℓ : Level --------...
module Human.String where open import Human.Bool open import Human.List renaming ( length to llength ) open import Human.Char open import Human.Nat postulate String : Set {-# BUILTIN STRING String #-} primitive primStringToList : String → List Char primStringFromList : List Char → String primStringAppend :...
{-# OPTIONS --cubical --safe #-} module Cubical.Structures.Group where open import Cubical.Foundations.Prelude open import Cubical.Foundations.Equiv open import Cubical.Foundations.Isomorphism open import Cubical.Foundations.HLevels open import Cubical.Foundations.FunExtEquiv open import Cubical.Data.Prod.Base hiding ...
data D : Set where @0 c : D -- The following definition should be rejected. Matching on an erased -- constructor in an *erased* position should not on its own make it -- possible to use erased definitions in the right-hand side. f : @0 D → D f c = c x : D x = f c
{- Byzantine Fault Tolerant Consensus Verification in Agda, version 0.9. Copyright (c) 2020, 2021, Oracle and/or its affiliates. Licensed under the Universal Permissive License v 1.0 as shown at https://opensource.oracle.com/licenses/upl -} open import LibraBFT.Prelude open import LibraBFT.Lemmas open import Lib...
{-# OPTIONS --cubical #-} open import Cubical.Foundations.Prelude open import Cubical.Relation.Nullary open import Cubical.Data.Empty open import Cubical.Data.Nat open import Cubical.Data.Unit open import Cubical.Data.Prod open import Cubical.Data.Bool module Direction where -- some nat things. move to own module? ...
{-# OPTIONS --irrelevant-projections #-} data _≡_ {A : Set} : A → A → Set where refl : (x : A) → x ≡ x module Erased where record Erased (A : Set) : Set where constructor [_] field @0 erased : A open Erased record _↔_ (A B : Set) : Set where field to : A → B from : B →...
------------------------------------------------------------------------ -- A virtual machine ------------------------------------------------------------------------ {-# OPTIONS --cubical --safe #-} module Lambda.Simplified.Partiality-monad.Inductive.Virtual-machine where open import Equality.Propositional open i...
{-# OPTIONS --without-K #-} open import HoTT open import experimental.TwoConstancyHIT module experimental.TwoConstancy {i j} {A : Type i} {B : Type j} (B-is-gpd : is-gpd B) (f : A → B) (f-is-const₀ : ∀ a₁ a₂ → f a₁ == f a₂) (f-is-const₁ : ∀ a₁ a₂ a₃ → f-is-const₀ a₁ a₂ ∙' f-is-const₀ a₂ a₃ == f-is-const₀ ...
------------------------------------------------------------------------ -- The Agda standard library -- -- Applicative functors ------------------------------------------------------------------------ -- Note that currently the applicative functor laws are not included -- here. {-# OPTIONS --without-K --safe #-} mo...
------------------------------------------------------------------------ -- A definitional interpreter that is instrumented with information -- about the number of steps required to run the compiled program ------------------------------------------------------------------------ open import Prelude import Lambda.Synt...
open import Agda.Primitive postulate ∞ : ∀ {a} (A : Set a) → Set (lsuc a) {-# BUILTIN INFINITY ∞ #-}
-- {-# OPTIONS -v tc.lhs.problem:10 #-} -- {-# OPTIONS --compile --ghc-flag=-i.. #-} module Issue727 where open import Common.Prelude renaming (Nat to ℕ) open import Common.MAlonzo hiding (main) Sum : ℕ → Set Sum 0 = ℕ Sum (suc n) = ℕ → Sum n sum : (n : ℕ) → ℕ → Sum n sum 0 acc = acc sum (suc n) acc m ...
{-# OPTIONS --type-in-type #-} module IDescTT where --******************************************** -- Prelude --******************************************** -- Some preliminary stuffs, to avoid relying on the stdlib --**************** -- Sigma and friends --**************** data Sigma (A : Set) (B : A -> Set) : S...
module STLC2 where open import Data.Nat -- open import Data.List open import Data.Empty using (⊥-elim) open import Relation.Binary.PropositionalEquality using (_≡_; refl; sym; trans; cong; cong₂; subst) open import Relation.Nullary open import Data.Product -- de Bruijn indexed lambda calculus infix 5 ƛ_ infixl 7...
open import Agda.Primitive using (Level; lzero; lsuc; _⊔_) open import Relation.Binary.PropositionalEquality using (_≡_; refl; setoid; cong; trans) import Function.Equality open import Relation.Binary using (Setoid) open import Categories.Category open import Categories.Functor open import Categories.Category.Instance...
open import Preliminaries open import Preorder module PreorderExamples where -- there is a preorder on Unit unit-p : Preorder Unit unit-p = preorder (preorder-structure (λ x x₁ → Unit) (λ x → <>) (λ x y z _ _ → <>)) -- there is a preorder on Nat _≤n_ : Nat → Nat → Set _≤n_ Z Z = Unit _≤n_ Z (S n) = Unit ...
-- Andreas, 2020-06-17, issue #4135 -- Do not allow meta-solving during projection disambiguation! data Bool : Set where true false : Bool module Foo (b : Bool) where record R : Set where field f : Bool open R public open module True = Foo true open module False = Foo false test : Foo.R {!!} test .f = {!...
-- 2010-10-15 and 2012-03-09 {-# OPTIONS -v tc.conv.irr:50 -v tc.decl.ax:10 #-} module Issue351 where import Common.Irrelevance data _==_ {A : Set1}(a : A) : A -> Set where refl : a == a record R : Set1 where constructor mkR field fromR : Set reflR : (r : R) -> r == (mkR _) reflR r = refl {a = _} record...
open import Prelude module Implicits.Semantics.Type where open import Data.Vec open import Implicits.Syntax open import SystemF.Everything as F using () ⟦_⟧tp→ : ∀ {ν} → Type ν → F.Type ν ⟦ simpl (tc n) ⟧tp→ = F.tc n ⟦ simpl (tvar n) ⟧tp→ = F.tvar n ⟦ simpl (a →' b) ⟧tp→ = ⟦ a ⟧tp→ F.→' ⟦ b ⟧tp→ ⟦ a ⇒ b ⟧tp→ = ⟦ a ⟧...
-- Andreas, 2011-04-05 module EtaContractToMillerPattern where data _==_ {A : Set}(a : A) : A -> Set where refl : a == a record Prod (A B : Set) : Set where constructor _,_ field fst : A snd : B open Prod postulate A B C : Set test : let X : (Prod A B -> C) -> (Prod A B -> C) X = _ i...
{-# OPTIONS --safe #-} module Cubical.Foundations.Path where open import Cubical.Foundations.Prelude open import Cubical.Foundations.GroupoidLaws open import Cubical.Foundations.Equiv open import Cubical.Foundations.Isomorphism open import Cubical.Foundations.Transport open import Cubical.Foundations.Univalence open ...
{- 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 -} open import LibraBFT.Base.Types import LibraBFT.Impl.Consensus.Consensus...
{-# OPTIONS --safe --warning=error --without-K #-} open import LogicalFormulae open import Setoids.Setoids open import Groups.Definition open import Sets.EquivalenceRelations module Groups.Groups where reflGroupWellDefined : {lvl : _} {A : Set lvl} {m n x y : A} {op : A → A → A} → m ≡ x → n ≡ y → (op m n) ≡ (op x y)...
module Punctaffy.Hypersnippet.Dim where open import Level using (Level; suc; _⊔_) open import Algebra.Bundles using (IdempotentCommutativeMonoid) open import Algebra.Morphism using (IsIdempotentCommutativeMonoidMorphism) -- For all the purposes we have for it so far, a `DimSys` is a bounded -- semilattice. The `agda...
{-# OPTIONS --without-K #-} module equality.groupoid where open import equality.core _⁻¹ : ∀ {i}{X : Set i}{x y : X} → x ≡ y → y ≡ x _⁻¹ = sym left-unit : ∀ {i}{X : Set i}{x y : X} → (p : x ≡ y) → p · refl ≡ p left-unit refl = refl right-unit : ∀ {i}{X : Set i}{x y : X} → (p : x ≡ y) ...
{-# OPTIONS --safe #-} module Issue2250-2 where open import Agda.Builtin.Bool open import Agda.Builtin.Equality data ⊥ : Set where abstract f : Bool → Bool f x = true {-# INJECTIVE f #-} same : f true ≡ f false same = refl not-same : f true ≡ f false → ⊥ not-same () absurd : ⊥ absurd = not-same same
-- Andreas, 2011-05-09 -- {-# OPTIONS -v tc.meta:15 -v tc.inj:40 #-} module Issue383 where data D (A : Set) : A → Set where data Unit : Set where unit : Unit D′ : (A : Set) → A → Unit → Set D′ A x unit = D A x postulate Q : (A : Set) → A → Set q : (u : Unit) (A : Set) (x : A) → D′ A x u → Q A x A : Set x...
{-# OPTIONS --without-K #-} open import HoTT import homotopy.HopfConstruction open import homotopy.CircleHSpace open import homotopy.SuspensionJoin using () renaming (e to suspension-join) open import homotopy.S1SuspensionS0 using () renaming (e to S¹≃SuspensionS⁰) import homotopy.JoinAssoc module homotopy.Hopf where...
{-# OPTIONS --rewriting #-} open import Common.Prelude open import Common.Equality {-# BUILTIN REWRITE _≡_ #-} postulate is-id : ∀ {A : Set} → (A → A) → Bool postulate is-id-true : ∀ {A} → is-id {A} (λ x → x) ≡ true {-# REWRITE is-id-true #-} test₁ : is-id {Nat} (λ x → x) ≡ true test₁ = refl postulate is-const : ...
module Numeral.Real where open import Data.Tuple open import Logic import Lvl open import Numeral.Natural open import Numeral.Natural.Oper open import Numeral.Rational open import Numeral.Rational.Oper open import Relator.Equals open import Type open import Type.Quotient -- TODO: This will not work, but it is th...
------------------------------------------------------------------------------ -- The division program is correct ------------------------------------------------------------------------------ {-# OPTIONS --exact-split #-} {-# OPTIONS --no-sized-types #-} {-# OPTIONS --no-universe-polymorphism #...
module Data.Num.Bij.Properties where open import Data.Num.Bij renaming (_+B_ to _+_; _*B_ to _*_) open import Data.List open import Relation.Binary.PropositionalEquality as PropEq using (_≡_; _≢_; refl; cong; sym; trans) open PropEq.≡-Reasoning --------------------------------------------------------------------...
{-# OPTIONS --safe #-} module Cubical.Algebra.OrderedCommMonoid.Properties where open import Cubical.Foundations.Prelude open import Cubical.Foundations.Structure open import Cubical.Foundations.HLevels open import Cubical.Foundations.SIP using (TypeWithStr) open import Cubical.Data.Sigma open import Cubical.Algebra...
{-# OPTIONS --allow-unsolved-metas #-} -- {-# OPTIONS -v tc.conv.elim:100 #-} module Issue814 where record IsMonoid (M : Set) : Set where field unit : M _*_ : M → M → M record Monoid : Set₁ where field carrier : Set is-mon : IsMonoid carrier record Structure (Struct : Set₁) (HasS...
{-# OPTIONS --rewriting #-} module Properties.Subtyping where open import Agda.Builtin.Equality using (_≡_; refl) open import FFI.Data.Either using (Either; Left; Right; mapLR; swapLR; cond) open import FFI.Data.Maybe using (Maybe; just; nothing) open import Luau.Subtyping using (_<:_; _≮:_; Tree; Language; ¬Language...
open import Nat open import Prelude open import List open import core open import judgemental-erase module moveerase where -- type actions don't change the term other than moving the cursor -- around moveeraset : {t t' : τ̂} {δ : direction} → (t + move δ +> t') → (t ◆t) == (t' ◆t) movee...
{-# OPTIONS --cubical --no-import-sorts --safe #-} module Cubical.Data.Bool.Properties where open import Cubical.Core.Everything open import Cubical.Functions.Involution open import Cubical.Foundations.Prelude open import Cubical.Foundations.Equiv open import Cubical.Foundations.Isomorphism open import Cubical.Found...
-- There were some serious bugs in the termination checker -- which were hidden by the fact that it didn't go inside -- records. They should be fixed now. module Issue222 where record R (A : Set) : Set where module M (a : A) where -- Bug.agda:4,17-18 -- Panic: unbound variable A -- when checking that the expressio...
-- {-# OPTIONS -v scope.decl.trace:50 #-} data D : Set where D : Set
-- A Simple selection of modules with some renamings to -- make my (your) life easier when starting a new agda module. -- -- This includes standard functionality to work on: -- 1. Functions, -- 2. Naturals, -- 3. Products and Coproducts (projections and injections are p1, p2, i1, i2). -- 4. Finite Types (zero and s...
module Control.Monad.Free.Quotiented where open import Prelude open import Data.List hiding (map) open import Data.Fin.Sigma open import Algebra postulate uip : isSet A -------------------------------------------------------------------------------- -- Some functors ------------------------------------------------...
------------------------------------------------------------------------ -- Container combinators ------------------------------------------------------------------------ {-# OPTIONS --sized-types #-} module Indexed-container.Combinators where open import Equality.Propositional open import Logical-equivalence using ...
module Lib.Vec where open import Common.Nat renaming (zero to Z; suc to S) open import Lib.Fin open import Common.Unit import Common.List -- using (List ; [] ; _∷_) data Vec (A : Set) : Nat -> Set where _∷_ : forall {n} -> A -> Vec A n -> Vec A (S n) [] : Vec A Z infixr 30 _++_ _++_ : {A : Set}{m n : Nat} ->...
{-# OPTIONS --without-K #-} module Agda.Builtin.Nat where open import Agda.Builtin.Bool data Nat : Set where zero : Nat suc : (n : Nat) → Nat {-# BUILTIN NATURAL Nat #-} infix 4 _==_ _<_ infixl 6 _+_ _-_ infixl 7 _*_ _+_ : Nat → Nat → Nat zero + m = m suc n + m = suc (n + m) {-# BUILTIN NATPLUS _+_ #-} _...
{-# OPTIONS --allow-unsolved-metas #-} open import Agda.Builtin.List open import Agda.Builtin.Nat infixl 6 _∷ʳ_ _∷ʳ_ : {A : Set} → List A → A → List A [] ∷ʳ x = x ∷ [] (hd ∷ tl) ∷ʳ x = hd ∷ tl ∷ʳ x infixl 5 _∷ʳ′_ data InitLast {A : Set} : List A → Set where [] : InitLast [] _∷ʳ′_ : (xs : List A) (x :...
open import Nat open import Prelude open import core open import contexts open import progress open import htype-decidable open import lemmas-complete module complete-progress where -- as in progress, we define a datatype for the possible outcomes of -- progress for readability. data okc : (d : ihexp) (Δ : hct...
{-# OPTIONS --without-K --safe #-} open import Definition.Typed.EqualityRelation module Definition.LogicalRelation.Substitution.Introductions.Natrec {{eqrel : EqRelSet}} where open EqRelSet {{...}} open import Definition.Untyped open import Definition.Untyped.Properties open import Definition.Typed open import Defin...
module Element where open import OscarPrelude record Element : Set where constructor ⟨_⟩ field element : Nat open Element public instance EqElement : Eq Element Eq._==_ EqElement ⟨ ε₁ ⟩ ⟨ ε₂ ⟩ with ε₁ ≟ ε₂ Eq._==_ EqElement ⟨ _ ⟩ ⟨ _ ⟩ | yes refl = yes refl Eq._==_ EqElement ⟨ _ ⟩ ⟨ _ ⟩ | no ε₁≢ε₂ = no ...
{-# OPTIONS --type-in-type #-} module Selective.Theorems where open import Prelude.Equality open import Selective -- Now let's typecheck some theorems cong-handle : ∀ {A B} {F : Set → Set} {{_ : Selective F}} {x y : F (Either A B)} {f : F (A → B)} → x ≡ y → handle x f ≡ handle y f cong-...
open import Prelude hiding (_≤_) open import Data.Nat.Properties open import Induction.Nat module Implicits.Resolution.GenericFinite.Examples.Haskell where open import Implicits.Resolution.GenericFinite.TerminationCondition open import Implicits.Resolution.GenericFinite.Resolution open import Implicits.Resolution.G...
{-# OPTIONS --safe --warning=error --without-K #-} open import LogicalFormulae open import Setoids.Setoids open import Sets.EquivalenceRelations open import Groups.Definition module Groups.Subgroups.Examples {a b : _} {A : Set a} {S : Setoid {a} {b} A} {_+_ : A → A → A} (G : Group S _+_) where open import Groups.Sub...
module nat where data N : Set where zero : N suc : N -> N _+_ : N -> N -> N n + zero = n n + (suc m) = suc (n + m) _*_ : N -> N -> N n * zero = zero n * (suc m) = (m * n) + m
module _ where module N (_ : Set₁) where data D : Set₁ where c : Set → D open N Set using (D) renaming (module D to MD) open import Common.Equality -- No longer two ways to qualify twoWaysToQualify : D.c ≡ MD.c twoWaysToQualify = refl
{-# OPTIONS --cubical --safe #-} module Cubical.Data.Strict2Group.Explicit.Notation where open import Cubical.Foundations.Prelude hiding (comp) open import Cubical.Data.Group.Base module S2GBaseNotation {ℓ : Level} (C₀ C₁ : Group ℓ) (s t : morph C₁ C₀) (i : morph C₀ C₁) (∘ : (g f : Group.type C₁) → (s .fst) g ≡ (t ....
------------------------------------------------------------------------ -- Application of substitutions ------------------------------------------------------------------------ -- Given an operation which applies a substitution to a term, subject -- to some conditions, more operations and lemmas are defined/proved. ...
---------------------------------------------------------------------------- -- Well-founded induction on the natural numbers ---------------------------------------------------------------------------- {-# OPTIONS --allow-unsolved-metas #-} {-# OPTIONS --exact-split #-} {-# OPTIONS --no-sized-types ...
------------------------------------------------------------------------ -- The Agda standard library -- -- Property that elements are grouped ------------------------------------------------------------------------ {-# OPTIONS --without-K --safe #-} module Data.List.Relation.Unary.Grouped where open import Data.Lis...
-- Convert between `X` and `X-Bool` {-# OPTIONS --without-K --safe --exact-split #-} module Constructive.Axiom.Properties.Bool where -- agda-stdlib open import Level renaming (suc to lsuc; zero to lzero) open import Data.Empty open import Data.Unit using (⊤; tt) open import Data.Bool using (Bool; true; false; not) o...
{-# OPTIONS --cubical #-} open import Agda.Builtin.Cubical.Path data D : Set where c : D data E : Set where c : (x y : E) → x ≡ y postulate A : Set f : (x y : E) → x ≡ y → (u v : A) → u ≡ v works : E → A works (c x y i) = f x y (E.c x y) (works x) (works y) i fails : E → A fails (c x y i) = f x y ( c x y...
module Selective.Examples.TestCall where open import Selective.Libraries.Call open import Prelude AddReplyMessage : MessageType AddReplyMessage = ValueType UniqueTag ∷ [ ValueType ℕ ]ˡ AddReply : InboxShape AddReply = [ AddReplyMessage ]ˡ AddMessage : MessageType AddMessage = ValueType UniqueTag ∷ ReferenceType Add...
open import Common.Level open import Common.Prelude open import Common.Reflection open import Common.Equality postulate a b : Level data Check : Set where check : (x y : Term) → x ≡ y → Check pattern _==_ x y = check x y refl pattern `a = def (quote a) [] pattern `b = def (quote b) [] pattern `suc x = def (quo...