text
stringlengths
4
690k
------------------------------------------------------------------------ -- Products ------------------------------------------------------------------------ module Data.Product where open import Data.Function open import Relation.Nullary.Core infixr 4 _,_ infix 4 ,_ infixr 2 _×_ _-×-_ _-,-_ ----------------------...
{-# OPTIONS --cubical --no-import-sorts --safe #-} module Cubical.Foundations.Equiv.Base where open import Cubical.Foundations.Function open import Cubical.Foundations.Prelude open import Cubical.Core.Glue public using ( isEquiv ; equiv-proof ; _≃_ ; equivFun ; equivProof ) fiber : ∀ {ℓ ℓ'} {A : Type ℓ} {B : Type ...
module Prelude.List.Base where open import Prelude.Nat open import Prelude.Bool open import Prelude.Maybe open import Prelude.Product open import Prelude.Empty open import Prelude.Function open import Prelude.Functor open import Prelude.Applicative open import Prelude.Monad open import Prelude.Decidable open import Pr...
import Relation.Binary.PropositionalEquality as Eq open Eq using (_≡_; refl; sym; trans; cong; cong-app) open Eq.≡-Reasoning open import Data.Nat using (ℕ; zero; suc; _+_; _*_) open import Data.Product using (∃; _,_) +-assoc : ∀ (m n p : ℕ) → m + (n + p) ≡ (m + n) + p +-assoc zero n p = begin zero + (n + p) ≡⟨...
module ExportTestAgda where open import Common.Prelude itWorksText : String itWorksText = "It works!" {-# COMPILED_EXPORT itWorksText itWorksText #-}
-- There was a bug when unifying things of function type during pattern matching -- (the T argument to P is unified with D below) module Issue199 where data D (A : Set) : Set where data P {A : Set} : {T : Set → Set} → T A → Set where p : ∀ d → P {_} {D} d foo : ∀ {A} {l : D A} → P l → Set₁ foo (p _) = Set
open import Type module Relator.Converse {ℓ₁ ℓ₂} {T : Type{ℓ₁}} (_▫_ : T → T → Type{ℓ₂}) where import Lvl open import Functional Converse : T → T → Type{ℓ₂} Converse = swap(_▫_)
module Issue4954 where open import Issue4954.M Set
module Relator.Ordering.Proofs where open import Data import Lvl open import Functional open import Lang.Instance open import Logic open import Logic.Classical open import Logic.Propositional open import Logic.Propositional.Theorems open import Type import Relator.Ordering open import Structure.Relator.Order...
module HasSatisfaction where open import OscarPrelude open import Interpretation record HasSatisfaction (A : Set) : Set₁ where field _⊨_ : Interpretation → A → Set _⊭_ : Interpretation → A → Set _⊭_ I = ¬_ ∘ I ⊨_ open HasSatisfaction ⦃ … ⦄ public {-# DISPLAY HasSatisfaction._⊨_ _ = _⊨_ #-} {-# DISPLAY ...
{-# OPTIONS --without-K --safe #-} open import Algebra open import Relation.Unary open import Relation.Binary hiding (Decidable) module Data.FingerTree.Split.Intermediate {r m} (ℳ : Monoid r m) {s} {ℙ : Pred (Monoid.Carrier ℳ) s} (ℙ-resp : ℙ Respects (Monoid._≈_ ℳ)) (ℙ? : Decidable ℙ) where open import...
{-# OPTIONS --safe #-} module Cubical.Algebra.AbGroup.Instances.Unit where open import Cubical.Foundations.Prelude open import Cubical.Foundations.HLevels open import Cubical.Data.Unit renaming (Unit* to UnitType) open import Cubical.Algebra.AbGroup open import Cubical.Algebra.Group.Instances.Unit using (UnitGroup) ...
-- Andreas, 2019-05-30, issue #3824: -- Named where module should be in scope even if defined under a rewrite. open import Agda.Builtin.Equality postulate A : Set a b : A a≡b : a ≡ b P : A → Set cast : P a → P b cast p rewrite a≡b = q module M where q = p test : P b → P b test = M.q -- ERROR WAS:...
module TelescopingLet4 where module Star where ★ : Set₁ ★ = Set ★₁ : Set₂ ★₁ = Set₁ data D5 (open Star using (★₁)) : ★₁ where
open import Data.Bool.Base using (Bool) ------------------------------------------------------------------------ -- The Agda standard library -- -- IO ------------------------------------------------------------------------ open import Coinduction open import Data.Unit open import Data.String open import Data.Colist o...
open import Relation.Binary.PropositionalEquality as P open import Function open import Streams tl' : ∀{A} → Stream A → Stream A tl' s = tl s coind : ∀{A X : Set} → (f g : X → Stream A) → hd ∘ f ≡ hd ∘ g → (u : ?) → ((v : ∀ x → f x ~ g x) → v ∘ u ∀ x → f x ~ g x hd~ (coind f g p x) = ...
------------------------------------------------------------------------ -- The Agda standard library -- -- Coinductive vectors ------------------------------------------------------------------------ module Data.Covec where open import Coinduction open import Data.Nat using (ℕ; zero; suc) open import Data.Conat as C...
-- Andreas, 2022-03-28, issue #5856, reported by Szumi Xie. -- Patterns in path-lambdas were simply ignored, but should be illegal. {-# OPTIONS --cubical #-} -- {-# OPTIONS -v tc.term.lambda:30 #-} open import Agda.Builtin.Cubical.Path postulate A E : Set a : A data C : Set where c : E → C p : a ≡ a p = λ (...
{- Reported by Nils Anders Danielsson, 2011-07-06 From the release notes for Agda 2.2.10: "Projections now preserve sizes, both in patterns and expressions." However, the following code is rejected: -} module Issue425 where record _×_ (A B : Set) : Set where constructor _,_ field proj₁ : A proj₂ : B ...
module Structure.Category.Functor.Functors where import Functional as Fn open import Function.Proofs open import Logic.Predicate import Lvl open import Structure.Category open import Structure.Category.Functor open import Structure.Categorical.Properties open import Structure.Function open import Structure.R...
open import Everything module Test.UnifiesSubstitunction {𝔭} (𝔓 : Ø 𝔭) where open Substitunction 𝔓 open Term 𝔓 open Substitist 𝔓 ≡-Unifies₀-Term : ∀ {m} → Term m → Term m → Ṗroperty ∅̂ (Arrow Fin Term m) ≡-Unifies₀-Term = ≡-surjcollation ≡-Unifies₀-Term' : ∀ {m} → Term m → Term m → Ṗroperty ∅̂ ...
-- Modified: Andreas, 2011-04-11 freezing Metas module HereditarilySingletonRecord where data _≡_ {A : Set} (x : A) : A → Set where refl : x ≡ x -- * trivial unit type record Singleton : Set where foo : Singleton foo = _ -- * product of unit types record HereditarilySingleton : Set where field singleton ...
-- Andreas, 2018-11-15, issue #3394 and testcase by Guillaume Brunerie -- -- Internal error in termination checking the type of Ploop -- due to uninitialized terSizeDepth. postulate A : Set B : Set P : B → Set mutual loop : A → B → B loop a b = loop a b Ploop : (b : B) → P (loop _ b) -- Unsolved meta c...
{- defining Nat as a kind of List -} -- the need for ‼ is unfortunate module Oscar.Data2 where record ⊤ : Set where constructor tt -- List data ⟦_⟧ {a} (A : Set a) : Set a where ∅ : ⟦ A ⟧ _∷_ : A → ⟦ A ⟧ → ⟦ A ⟧ -- Nat ⟦⟧ = ⟦ ⊤ ⟧ pattern ‼ ⟦A⟧ = tt ∷ ⟦A⟧ -- Fin data ⟦⟧[_] : ⟦⟧ → Set where ∅ : ∀ {n} → ⟦⟧[ ‼ ...
------------------------------------------------------------------------ -- Lemmas related to strong similarity for CCS ------------------------------------------------------------------------ {-# OPTIONS --sized-types #-} open import Prelude module Similarity.CCS {ℓ} {Name : Type ℓ} where open import Equality.Prop...
{-# OPTIONS --type-in-type #-} module RevisedHutton where --******************************************** -- Prelude --******************************************** -- Some preliminary stuffs, to avoid relying on the stdlib --**************** -- Sigma and friends --**************** data Sigma (A : Set) (B : A -> Se...
------------------------------------------------------------------------ -- Untyped kind/type/term equality in Fω with interval kinds ------------------------------------------------------------------------ {-# OPTIONS --safe --without-K #-} module FOmegaInt.Syntax.WeakEquality where open import Data.Fin using (Fin;...
{- Byzantine Fault Tolerant Consensus Verification in Agda, version 0.9. Copyright (c) 2020 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 Level using (0ℓ) -- This module incl...
-- {-# OPTIONS --verbose tc.records.ifs:15 #-} -- {-# OPTIONS --verbose tc.rec.proj:15 #-} -- {-# OPTIONS --verbose tc.rec:15 #-} -- {-# OPTIONS --verbose tc.constr.findInScope:15 #-} -- {-# OPTIONS --verbose tc.term.args.ifs:15 #-} -- {-# OPTIONS --verbose tc.section.apply:15 #-} -- {-# OPTIONS --verbose tc.mod.apply:...
{-# OPTIONS --cubical --safe #-} module Data.Bits.Strict where open import Data.Bits open import Prelude infixr 8 0∷!_ 1∷!_ 0∷!_ : Bits → Bits 0∷!_ = λ! xs →! 0∷ xs {-# INLINE 0∷!_ #-} 1∷!_ : Bits → Bits 1∷!_ = λ! xs →! 1∷ xs {-# INLINE 1∷!_ #-} 0∷!≡0∷ : ∀ xs → 0∷! xs ≡ 0∷ xs 0∷!≡0∷ = $!-≡ 0∷_ 1∷!≡1∷ : ∀ xs → 1∷!...
{-# OPTIONS --without-K #-} module CauchyProofsT where -- Proofs about permutations defined in module Cauchy (multiplicative) open import Level using (Level; _⊔_) renaming (zero to lzero; suc to lsuc) open import Relation.Binary.PropositionalEquality using (_≡_; refl; sym; trans; subst; subst₂; cong; cong₂; seto...
-- Andreas, 2016-07-29 issue #707 -- {-# OPTIONS -v tc.ip:20 #-} postulate A B : {!!} -- Should not create two interaction points! -- Also not two sort metas!
------------------------------------------------------------------------ -- The Agda standard library -- -- Examples showing how the case expressions can be used with anonymous -- pattern-matching lambda abstractions ------------------------------------------------------------------------ {-# OPTIONS --without-K --saf...
open import Oscar.Prelude open import Oscar.Data.¶ module Oscar.Data.Vec where data ⟨_⟩¶⟨≤_⟩ {𝔭} (𝔓 : ¶ → Ø 𝔭) : ¶ → Ø 𝔭 where ∅ : ⟨ 𝔓 ⟩¶⟨≤ ∅ ⟩ _,_ : ∀ {n} → 𝔓 n → ⟨ 𝔓 ⟩¶⟨≤ n ⟩ → ⟨ 𝔓 ⟩¶⟨≤ ↑ n ⟩ Vec⟨_⟩ = ⟨_⟩¶⟨≤_⟩
module Logic.Structure.Applicative where data Applicative (f : Set -> Set) : Set1 where applicative : (pure : {a : Set} -> a -> f a) (_<*>_ : {a b : Set} -> f (a -> b) -> f a -> f b) -> Applicative f module Applicative {f : Set -> Set}(App : Applicative f) where private pure' : Applicativ...
{-# OPTIONS --without-K --rewriting #-} open import HoTT module groups.ProductRepr {i j} {G : Group (lmax i j)} {H₁ : Group i} {H₂ : Group j} (i₁ : H₁ →ᴳ G) (i₂ : H₂ →ᴳ G) (j₁ : G →ᴳ H₁) (j₂ : G →ᴳ H₂) (p₁ : ∀ h₁ → GroupHom.f j₁ (GroupHom.f i₁ h₁) == h₁) (p₂ : ∀ h₂ → GroupHom.f j₂ (GroupHom.f i₂ h₂) == h₂) ...
-- Intuitionistic propositional logic, de Bruijn approach, final encoding module Bf.Ip where open import Lib using (List; _,_; LMem; lzero; lsuc) -- Types infixl 2 _&&_ infixl 1 _||_ infixr 0 _=>_ data Ty : Set where UNIT : Ty _=>_ : Ty -> Ty -> Ty _&&_ : Ty -> Ty -> Ty _||_ : Ty -> Ty -> T...
------------------------------------------------------------------------ -- Experiments related to equality -- -- Nils Anders Danielsson -- -- Some files have been developed in collaboration with others, see -- the individual files. ------------------------------------------------------------------------ {-# OPTIONS -...
{-# OPTIONS --universe-polymorphism #-} open import Categories.Category -- small indexed products of specific shapes module Categories.Object.IndexedProducts {o ℓ e} (C : Category o ℓ e) where open Category C -- open Equiv open import Level open import Categories.Support.Equivalence using (Setoid; module Setoid) ...
module Issue807b where open import Common.Coinduction data Unit : Set where unit : Unit From-unit : Unit → Set From-unit unit = Unit from-unit : (x : Unit) → From-unit x from-unit unit = unit data D : Set where d₁ : D d₂ : ∞ D → D foo : D → Unit foo d₁ = unit foo (d₂ x) with ♭ x foo (d₂ x) | d₁ = unit...
{-# OPTIONS --cubical --safe --postfix-projections #-} open import Prelude open import Relation.Binary module Relation.Binary.Construct.UpperBound {e} {E : Type e} {r₁ r₂} (totalOrder : TotalOrder E r₁ r₂) where open TotalOrder totalOrder renaming (refl to <-refl) import Data.Unit.UniversePolymorphic as Poly import...
variable A : Set f : A f = {!!} -- The goal type should be printed as A, not A₁. -- Introducing the hidden variable with C-c C-c should choose name A.
------------------------------------------------------------------------ -- The Agda standard library -- -- Propositional equality -- -- This file contains some core definitions which are re-exported by -- Relation.Binary.PropositionalEquality. ------------------------------------------------------------------------ {...
module objectOrientedGui where open import Data.Product hiding (map) open import Data.List open import Data.Bool.Base open import SizedIO.Base open import NativeIO open import Relation.Binary.PropositionalEquality hiding ([_]) open import Size open import Function open import StateSizedIO.GUI.BaseStateDependent open...
------------------------------------------------------------------------ -- The Agda standard library -- -- Consequences of a monomorphism between magma-like structures ------------------------------------------------------------------------ -- See Data.Nat.Binary.Properties for examples of how this and similar -- mod...
{-# OPTIONS --safe #-} module Cubical.Algebra.Algebra where open import Cubical.Algebra.Algebra.Base public open import Cubical.Algebra.Algebra.Properties public
{- Type classes and instances for categories. -} module CategoryTheory.Categories where open import Relation.Binary.PropositionalEquality using (_≡_ ; refl ; sym ; trans ; subst ; cong) public open import Relation.Binary using (IsEquivalence) open import Agda.Primitive using (Level ; _⊔_ ; lzero ; lsuc) p...
module GGT.Group.Structures {a b ℓ} where open import Relation.Unary using (Pred) open import Relation.Binary open import Algebra.Bundles using (Group) open import Level open import GGT.Group.Definitions record IsSubGroup (G : Group a ℓ) (P : Pred (Group.Carrier G) b) : Set (a ⊔ b ⊔ ℓ) where open Group G fiel...
{-# OPTIONS --type-in-type #-} module Structure where open import Data.Nat open import Prelude record Struct (A : Set) : Set where field ℜ : {n : ℕ} → A ^ n → Set 𝔉 : {n : ℕ} → A ^ n → A
module ctxt-types where open import lib open import cedille-types open import general-util open import syntax-util location : Set location = string × posinfo -- file path and starting position in the file -- file path and starting / ending position in file span-location = string × posinfo × posinfo -- missing loca...
{- 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 -} -- This module contains definitions allowing RWS programs to be written using...
{-# OPTIONS --rewriting --prop #-} open import common open import common using (_===_) open import syntx open import derivability open import structuralrules open import typingrules {- Type theories -} Σ₀ : Signature Symbols Σ₀ ar = Empty E₀ : DerivabilityStructure Σ₀ E₀ = StructuralRules Σ₀ data TypeTheory : Se...
open import Agda.Builtin.Nat data Bal : Nat → Nat → Nat → Set where leanR : ∀ {n} → Bal n (suc n) (suc n) leanL : ∀ {n} → Bal (suc n) n (suc n) data Tree : Nat → Set where leaf : Tree 0 node : ∀ {hˡ hʳ h} (t : Tree hʳ) (b : Bal hˡ hʳ h) → Tree (suc h) join : ∀ {hˡ hʳ} h → Bal hˡ hʳ h → Tree (suc hˡ) → Nat j...
------------------------------------------------------------------------ -- Lemmas related to weak bisimilarity and CCS ------------------------------------------------------------------------ {-# OPTIONS --sized-types #-} open import Prelude hiding (step-→) module Bisimilarity.Weak.CCS {ℓ} {Name : Type ℓ} where op...
{-# OPTIONS --without-K #-} module sets.empty where open import level data ⊥ {i} : Set i where ⊥-elim : ∀ {i j}{A : Set j} → ⊥ {i} → A ⊥-elim () ¬_ : ∀ {i} → Set i → Set i ¬ X = X → ⊥ {lzero} infix 3 ¬_
{-# OPTIONS --type-in-type #-} module chu.lens where open import prelude open import functors open import chu open import poly.core →∫ : Chu → ∫ →∫ (A⁺ , A⁻ ! Ω) = A⁺ , λ a⁺ → ∃ (Ω a⁺) →Lens : {A B : Chu} → Chu[ A , B ] → ∫[ →∫ A , →∫ B ] →Lens (f ↔ fᵗ ! †) a⁺ = f a⁺ , λ (b⁻ , fa⁺Ωb⁻) → fᵗ b⁻ , subst id († a⁺ ...
open import Agda.Builtin.Equality open import Agda.Builtin.Nat data AB : Set where A B : AB foo : Nat → AB → AB foo 0 t = A foo (suc n) t = foo n A -- NB tail-recursive test : foo 100000 A ≡ A test = refl -- memory blows up here data N : Set where z : N s : N → N produce : Nat → AB → N produce 0 ...
open import Type module Structure.Container.IndexedIterable {ℓᵢ} {Index : Type{ℓᵢ}} where import Lvl open import Data open import Data.Boolean open import Data.Boolean.Stmt open import Data.Option import Data.Option.Functions as Option open import Data.Tuple as Tuple using (_⨯_ ; _,_) open import Functional...
------------------------------------------------------------------------------ -- The division result is correct ------------------------------------------------------------------------------ {-# OPTIONS --exact-split #-} {-# OPTIONS --no-sized-types #-} {-# OPTIONS --no-universe-polymorphism #-...
{-# OPTIONS --without-K #-} module Cham.Agent where open import Cham.Context open import Cham.Label open import Cham.Name open import Data.Nat open import Data.Product data Agent : Context → Set where Nil : Agent ∅ _∙_ : ∀ {Γ} → (Valence : Label) → Agent Γ → Agent (Γ ⊢ Valence) _∣_ : ...
module GUIgeneric.GUIExampleBankAccount where open import GUIgeneric.Prelude renaming (inj₁ to firstBtn; inj₂ to secondBtn; WxColor to Color;_∸_ to _-_) hiding (addButton; _>>_ ; show) open import GUIgeneric.GUIDefinitions renaming (add to add'; add' to add) open import GUIgeneric.GUI open import GUIgeneric.GUIExa...
-- {-# OPTIONS -v 100 -v tc.meta.name:100 -v interactive.meta:10 #-} module Issue526 where -- Don't just write _49, -- include the corresponding implicit variable name as well (if any) postulate f : {A : Set} → {a : A} → Set1 → {B : Set} → Set test : Set test = f Set test₁ : Set test₁ = f {A = _} Set postulate ...
module MLib.Prelude.RelProps where open import MLib.Prelude.FromStdlib import Relation.Binary.Indexed as I open FE using (cong) import Data.Product.Relation.SigmaPropositional as OverΣ Σ-bij : ∀ {a b c} {A : Set a} {B : A → Set b} {C : A → Set c} → (∀ x → B x ↔ C x) → Σ A B ↔ Σ A C Σ-bij pw = record { to = ≡.→-to-...
module Imports.A where postulate A : Set
module _ where import Issue1168 ; module I = Issue1168 import PrettyInterface ; module P = PrettyInterface id : {A : Set} → A → A id {A = A} a = a
module Dot where postulate h : Set f : Set -> Set -> Set f .n n = h
{-# OPTIONS --cubical --no-exact-split --safe #-} module Cubical.Data.Nat.Properties where open import Cubical.Core.Everything open import Cubical.Foundations.Prelude open import Cubical.Data.Nat.Base open import Cubical.Data.Empty open import Cubical.Data.Prod.Base open import Cubical.Relation.Nullary open import ...
{- 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 Haskell.Modules.RWS.RustAnyHow import LibraBFT.Impl.Consensu...
module Data.BitVector.ContainmentOrder where open import Data.Empty open import Data.Sum open import Data.Vec open import Relation.Nullary open import Relation.Binary open import Relation.Binary.PropositionalEquality open import Data.Nat hiding (_≟_; _≤_; _≤?_) renaming (zero to Nzero; suc to Nsuc) open import Data...
------------------------------------------------------------------------ -- The Agda standard library -- -- Properties of sums (disjoint unions) ------------------------------------------------------------------------ {-# OPTIONS --without-K --safe #-} module Data.Sum.Properties where open import Level open import D...
{-# OPTIONS --cubical --no-import-sorts --safe #-} module Cubical.Displayed.Properties where open import Cubical.Foundations.Prelude open import Cubical.Foundations.HLevels open import Cubical.Foundations.Isomorphism open import Cubical.Foundations.Equiv open import Cubical.Foundations.Univalence using (pathToEquiv) ...
{- This file contains: - the abelianization of groups as a coequalizer of sets as performed in https://1lab.dev/Algebra.Group.Ab.Free.html - the proof that this way of defining the abelianization of groups is equivalent to defining it as a HIT, more precisely that there is a unique isomorphism betw...
module list-to-string where open import list open import string 𝕃-to-string : ∀ {ℓ} {A : Set ℓ} → (f : A → string) → (separator : string) → 𝕃 A → string 𝕃-to-string f sep [] = "" 𝕃-to-string f sep (x1 :: (x2 :: xs)) = (f x1) ^ sep ^ (𝕃-to-string f sep (x2 :: xs)) 𝕃-to-string f sep (x1 :: []) = (f x1)
module AbstractRationals where open import Algebra open import Data.Integer.Base using (+0) open import Data.Maybe.Base using (just; nothing; decToMaybe) open import Data.Rational.Base as ℚ public hiding (_+_; _*_; _-_) open import Data.Rational.Properties as ℚ public using (module ≤-Reasoning; <⇒≤) open import Re...
module Issue461 where data D : Set where data D : Set where
{-# OPTIONS --no-auto-inline #-} module Where where open import Haskell.Prelude hiding (_+_; _*_; _-_) open import Agda.Builtin.Nat postulate bool2nat : Bool → Nat -- no outer arguments ex1 : Nat ex1 = mult num + bool2nat true where num : Nat num = 42 mult : Nat → Nat mult = _* 100 -- nested wh...
-- Andreas, 2015-10-05, issue reported by mechvel, test case by Jesper Cockx -- {-# OPTIONS -v tc.term.exlam:20 #-} abstract foo : Set₁ foo = Set where AbstractSet₁ : Set₂ AbstractSet₁ = Set₁ f : Set → AbstractSet₁ f = λ { _ → Set } {-# NON_TERMINATING #-} loop : Set → Set loop = λ { ...
module Issue65 where open import Haskell.Prelude yeet : (c : Bool) → ({{c ≡ true}} → a) → ({{c ≡ false}} → a) → a yeet false x y = y {{refl}} yeet true x y = x {{refl}} {-# COMPILE AGDA2HS yeet #-} -- The branches start with instance lambdas that should be dropped. xx : Int xx = yeet true 1 2 {-# COMPILE AGDA2HS x...
{-# OPTIONS --safe #-} module Cubical.Algebra.Polynomials.Multivariate.Base where open import Cubical.Foundations.Prelude open import Cubical.Foundations.HLevels open import Cubical.Data.Nat renaming (_+_ to _+n_) open import Cubical.Data.Vec open import Cubical.Algebra.Ring open import Cubical.Algebra.CommRing pri...
open import Agda.Builtin.Sigma renaming (fst to proj₁; snd to proj₂) open import Agda.Builtin.Nat renaming (Nat to ℕ) NEX : Set₁ NEX = Σ Set λ A → (ℕ → A) variable A : NEX B : A .proj₁ → NEX [Σ] : (A : NEX) → (B : A .proj₁ → NEX) → NEX [Σ] A B .proj₁ = Σ (A .proj₁) λ x → B x .proj₁ [Σ] A B .proj₂ n = A .proj₂ n...
module Haskell.Prim.Tuple where open import Agda.Builtin.List open import Haskell.Prim private variable as : List Set -------------------------------------------------- -- Tuples infixr 5 _∷_ data Tuple : List Set → Set where [] : Tuple [] _∷_ : a → Tuple as → Tuple (a ∷ as) infix 3 _×_ _×_×_ _×_ : (...
module Prelude.Vec where open import Prelude.Nat open import Prelude.Fin open import Prelude.Function open import Prelude.Functor open import Prelude.Applicative open import Prelude.List open import Prelude.Equality open import Prelude.Decidable open import Prelude.Ord open import Prelude.Semiring infixr 5 _∷_ data ...
-- 2010-10-04 -- termination checker no longer counts stripping off a record constructor -- as decrease -- 2019-10-18 -- It does if it's an inductive non-eta record. module Issue334b where data Unit : Set where unit : Unit record E : Set where inductive constructor mkE field fromE : E spam : Unit f ...
module Structure.Setoid.Size where import Lvl open import Logic open import Logic.Propositional open import Logic.Predicate open import Structure.Setoid open import Structure.Function.Domain open import Structure.Function open import Syntax.Function open import Type private variable ℓ ℓ₁ ℓ₂ ℓₑ₁ ℓₑ₂ : Lvl.Level ...
------------------------------------------------------------------------ -- The Agda standard library -- -- Containers, based on the work of Abbott and others ------------------------------------------------------------------------ {-# OPTIONS --without-K --safe --sized-types #-} module Data.Container where open imp...
{-# OPTIONS --cubical --no-import-sorts --safe #-} module Cubical.Foundations.Logic where import Cubical.Data.Empty as ⊥ open import Cubical.Data.Sum as ⊎ using (_⊎_) open import Cubical.Data.Unit open import Cubical.Data.Sigma open import Cubical.Foundations.Prelude as FP open import Cubical.Functions.Embedding ope...
module Nat where import Prelude import Equiv import Datoid open Prelude open Equiv open Datoid data Nat : Set where zero : Nat suc : Nat -> Nat one : Nat one = suc zero _+_ : Nat -> Nat -> Nat zero + n = n suc m + n = suc (m + n) private eqNat : Nat -> Nat -> Bool eqNa...
------------------------------------------------------------------------ -- Incorrect coinductive axiomatisation of subtyping ------------------------------------------------------------------------ -- This module shows that if we remove transitivity from -- RecursiveTypes.Subtyping.Axiomatic.Coinductive._≤_, and take...
open import Mockingbird.Forest using (Forest) module Mockingbird.Forest.Combination.Vec.Properties {b ℓ} (forest : Forest {b} {ℓ}) where open import Data.Vec as Vec using (Vec; []; _∷_; _++_) import Data.Vec.Relation.Unary.Any as Any open import Data.Vec.Relation.Unary.Any.Properties as Anyₚ using (++⁺ˡ; ++⁺ʳ) open i...
{-# OPTIONS --postfix-projections #-} open import Agda.Builtin.Nat record R : Set where field x : Nat → Nat open R {{...}} f : R f .x = {!!} -- WAS: Case splitting on result produces the following nonsense: -- f ⦃ .x ⦄ x₁ = ? -- SHOULD: produce -- f .x x₁ = ?
module Thesis.DeriveCorrect where open import Thesis.Lang open import Thesis.Changes open import Thesis.LangChanges open import Thesis.Derive open import Relation.Binary.PropositionalEquality open import Theorem.Groups-Nehemiah fromtoDeriveConst : ∀ {τ : Type} (c : Const τ) → ch ⟦ c ⟧ΔConst from ⟦ c ⟧Const to ⟦ c...
module Logic.Convenience {ℓ} where import Lvl open import Data.Tuple as Tuple using (_⨯_ ; _,_) open import Functional open import Logic.Propositional{ℓ} open import Type record [⇒]-proof (Proof : Stmt → Stmt → Type{ℓ}) : Type{Lvl.𝐒(ℓ)} where infixl 10 _⇒_ infixr 10 _⇐_ field _⇒_ : ∀{X Y : Stmt} → X ...
-- Andreas, 2016-05-04, discussion with Ulf -- Projections should be treated in the same way asonstructors, -- what parameters concerns -- {-# OPTIONS -v tc.mod.apply:15 #-} -- {-# OPTIONS -v tc.term.con:50 -v tc.term.def:10 #-} module _ where module M (A : Set) where data D : Set where c : A → D record R...
module Control.Monad.Except where open import Prelude open import Control.Monad.Zero open import Control.Monad.Identity open import Control.Monad.Transformer record ExceptT {a} (E : Set a) (M : Set a → Set a) (A : Set a) : Set a where no-eta-equality constructor maybeT field runExceptT : M (Either E A) open E...
module type-level where open import bool open import level open import nat {- multiApply{n} applies a sequence f1, f2, ..., f_n of functions to a starting point a: multiApply{n} a f1 f2 ... f_n = f_n (... (f2 (f1 a))) -} multiApplyTh : ℕ → Set → Set lone multiApplyTh 0 A = Lift A multiApplyTh (suc n) A = ∀{...
module Oscar.Category.Monoid where open import Oscar.Level record Monoid 𝔬 𝔪 𝔮 : Set (lsuc (𝔬 ⊔ 𝔪 ⊔ 𝔮)) where
module Numeral.Integer.Oper where open import Numeral.Natural as ℕ using (ℕ) import Numeral.Natural.Oper as ℕ open import Numeral.Integer open import Numeral.Integer.Sign import Numeral.Sign as Sign import Numeral.Sign.Oper0 as Sign -- Unclosed total subtraction from natural numbers to integ...
------------------------------------------------------------------------ -- A formalisation of some definitions and laws from Section 2.4 of -- Ralf Hinze's paper "Streams and Unique Fixed Points" ------------------------------------------------------------------------ -- Note: Using the approach of Stream.Programs an...
{- This second-order equational theory was created from the following second-order syntax description: syntax Monad | M type T : 1-ary term ret : α -> T α bind : T α α.(T β) -> T β | _>>=_ r10 theory (LU) a : α b : α.(T β) |> bind (ret(a), x. b[x]) = b[a] (RU) t : T α |> bind (t, x. ret(x)) = t ...
module PiQ.Opsem where open import Data.Empty open import Data.Unit hiding (_≟_) open import Data.Sum open import Data.Product open import Data.Maybe open import Relation.Binary.Core open import Relation.Binary open import Relation.Nullary open import Relation.Binary.PropositionalEquality open import Function using (_∘...