text
stringlengths
4
690k
------------------------------------------------------------------------ -- Representation-independent results for non-dependent lenses ------------------------------------------------------------------------ {-# OPTIONS --cubical --safe #-} import Equality.Path as P module Lens.Non-dependent {e⁺} (eq : ∀ {a p} → ...
module _ where open import Agda.Primitive -- Named implicit parameters data D₁ {a b} (A : Set a) (B : Set b) : Set (a ⊔ lsuc b) data D₁ {b = c} X Y where mkD₁ : Set c → D₁ X Y -- Trailing implicit parameters data D₂ {a} : Set a data D₂ where tt : D₂
{-# OPTIONS --cubical --safe #-} module Data.List where open import Data.List.Base public
module Data.Tuple.Function where open import Data open import Data.Tuple as Tuple using (_⨯_ ; _,_) open import Functional open import Type module _ {ℓ₁ ℓ₂ ℓ₃} {T₁ : Type{ℓ₁}} {T₂ : Type{ℓ₂}} {T₃ : Type{ℓ₃}} where _,⃝_ : (T₁ → T₂) → (T₁ → T₃) → (T₁ → (T₂ ⨯ T₃)) _,⃝_ f g x = (f(x) , g(x)) left : (T₁ → (T₂ ⨯ T₃)...
{-# OPTIONS --cubical --no-import-sorts --safe #-} module Cubical.Data.Nat where open import Cubical.Data.Nat.Base public open import Cubical.Data.Nat.Properties public
-- The <local hints> in an ATP pragma <prove> can be data constructors. module ATPLocalHints1 where postulate D : Set zero : D succ : D → D data N : D → Set where zN : N zero sN : ∀ {n} → N n → N (succ n) postulate 0-N : N zero {-# ATP prove 0-N zN #-}
module UselessAbstractAbstract where A : Set₁ abstract abstract A = Set
module Pair where postulate _,_ : Set → Set → Set fst : {A B : Set} → (A , B) → A snd : {A B : Set} → (A , B) → B {-# COMPILE GHC _,_ = type (,) #-} {-# COMPILE GHC fst = \ _ _ -> fst #-} {-# COMPILE GHC snd = \ _ _ -> snd #-}
-- Andreas, 2017-09-16, issue #2759 -- Allow empty declaration blocks in the parser. open import Agda.Builtin.Nat x0 = zero mutual x1 = suc x0 abstract x2 = suc x1 private x3 = suc x2 instance x4 = suc x3 macro x5 = suc x4 postulate x6 = suc x5 -- Expected: 6 warnings about empty blocks mutual postulate -- Empty...
---------------------------------------------------------------------- -- Copyright: 2013, Jan Stolarek, Lodz University of Technology -- -- -- -- License: See LICENSE file in root of the repo -- -- Repo address: https://github.com/...
---------------------------------------------------------------------- -- This file contains constructions of new categories from existing -- -- categories. -- ---------------------------------------------------------------------- module Category.CategoryCons where ...
open import Data.Product renaming (_×_ to _∧_) ×-comm : {A B : Set} → (A ∧ B) → (B ∧ A) ×-comm (fst , snd) = snd , fst id : {A : Set} → A → A id a = a K : {A B : Set} → A → B → A K a b = a app : {A B : Set} → (A → B) → A → B app f a = f a flip : {A B C : Set} → (A → B → C) → B → A → C flip f b a = f a b comp : {...
------------------------------------------------------------------------ -- Contexts, variables, context morphisms, etc. ------------------------------------------------------------------------ -- Based on Conor McBride's "Outrageous but Meaningful Coincidences: -- Dependent type-safe syntax and evaluation". -- The c...
{-# OPTIONS --without-K #-} module Agda.Builtin.IO where postulate IO : ∀ {a} → Set a → Set a {-# BUILTIN IO IO #-} {-# HASKELL type AgdaIO a b = IO b #-} {-# COMPILED_TYPE IO MAlonzo.Code.Agda.Builtin.IO.AgdaIO #-}
------------------------------------------------------------------------ -- Some character parsers ------------------------------------------------------------------------ -- This code also illustrates how a library can make use of another -- library. module RecursiveDescent.Inductive.Char where open import Data.Uni...
------------------------------------------------------------------------ -- A map function for the substitutions ------------------------------------------------------------------------ open import Data.Universe.Indexed module deBruijn.Substitution.Data.Map {i u e} {Uni : IndexedUniverse i u e} where import deBrui...
{-# OPTIONS --without-K --safe #-} module Categories.Comonad where open import Level open import Categories.Category using (Category) open import Categories.Functor using (Functor; Endofunctor; _∘F_) renaming (id to idF) open import Categories.NaturalTransformation renaming (id to idN) open import Categories.NaturalT...
-- {-# OPTIONS -v tc.mod.apply:80 #-} module Issue1985 where module Def where postulate A : Set module Par (X : Set₁) where postulate B : Set open Def public -- module Works where -- module Ren B = Par B -- module App = Ren Set module Fails where module RenP (X : Set₁) = Par X module Ren = Par -- ...
{-# OPTIONS --allow-unsolved-metas #-} open import Agda.Primitive postulate A : Set F : ∀ {ℓ} (XF : Set ℓ) → Set ℓ record R (Q : ∀ {ℓ} (XQ : Set ℓ) → Set ℓ) ℓ : Set (lsuc ℓ) where field f : {A : Set ℓ} (fa : F A) → Q A open R module M (X : Set₁) where postulate G : ∀ {ℓ} (XG : Set ℓ) → Set ℓ modul...
module Imports.StaleMetaLiteral where open import Common.Prelude hiding (_>>=_) open import Common.Reflection open import Common.Equality macro metaLit : Tactic metaLit hole = checkType unknown (def (quote Nat) []) >>= λ { (meta m args) → unify hole (lit (meta m)) >>= λ _ → unify (meta m args...
module Verifier where open import Definitions open import NatEquality using (_≟_ ; equality-disjoint) check1 : (m n : ℕ) → Equal? m n check1 = _≟_ check2 : (m n : ℕ) → m ≡ n → m ≢ n → ⊥ check2 = equality-disjoint
{-# OPTIONS --cubical --no-import-sorts --safe #-} module Cubical.HITs.MappingCones.Properties where open import Cubical.Foundations.Prelude open import Cubical.Foundations.Function open import Cubical.Foundations.Isomorphism open import Cubical.Data.Unit open import Cubical.Data.Sum open import Cubical.HITs.Pushout...
{- This second-order term syntax was created from the following second-order syntax description: syntax PCF type N : 0-ary _↣_ : 2-ary | r30 B : 0-ary term app : α ↣ β α -> β | _$_ l20 lam : α.β -> α ↣ β | ƛ_ r10 tr : B fl : B ze : N su : N -> N pr : N -> N iz : N -> B | 0?...
{- An agda file contains a single module. The module name should correspond to the name and path of the file. The path is relative to the project root. In this case the project root is the root of Agda II. Modules can be parameterised, but in this case we choose not to parameterise the top-level modul...
module LitDistinct where {-# BUILTIN STRING String #-} data _==_ {A : Set}(x : A) : A -> Set where refl : x == x data False : Set where foo : "bar" == "baz" -> False foo ()
open import Data.List hiding ([_]) renaming (_∷_ to _∷ₗ_) open import Data.Maybe open import Data.Product open import AEff open import EffectAnnotations open import Renamings open import Substitutions open import Types open import Relation.Binary.PropositionalEquality hiding ([_]) open import Relation.Nullary module...
{-# OPTIONS --without-K --rewriting #-} open import HoTT {- Proof that if [A] and [B] are two propositions, then so is [A * B]. -} module homotopy.PropJoinProp {i} {A : Type i} (pA : is-prop A) {j} {B : Type j} (pB : is-prop B) where contr-left : (a : A) → is-contr (A * B) contr-left a = left a , Pushout-elim ...
module Categories.Comonad where
{-# OPTIONS --cubical --safe --postfix-projections #-} module Data.Binary.Skew where open import Prelude open import Data.Nat open import Data.List 𝔹 : Type 𝔹 = List ℕ inc : 𝔹 → 𝔹 inc [] = zero ∷ [] inc (x ∷ []) = zero ∷ x ∷ [] inc (x₁ ∷ zero ∷ xs) = suc x₁ ∷ xs inc (x₁ ∷ suc x₂ ∷ xs) = zero ∷ x₁ ∷ x₂ ∷ xs ⟦...
-- Andreas, 2011-05-30 -- {-# OPTIONS -v tc.lhs.unify:50 #-} module Issue292c where data ⊥ : Set where infix 3 ¬_ ¬_ : Set → Set ¬ P = P → ⊥ infix 4 _≅_ data _≅_ {A : Set} (x : A) : ∀ {B : Set} → B → Set where refl : x ≅ x record Σ (A : Set) (B : A → Set) : Set where constructor _,_ field proj₁ : A ...
{- This second-order term syntax was created from the following second-order syntax description: syntax FOL type * : 0-ary N : 0-ary term false : * | ⊥ or : * * -> * | _∨_ l20 true : * | ⊤ and : * * -> * | _∧_ l20 not : * -> * | ¬_ r50 eq : N N -> * | _≟_ l20 all : N.* -> ...
open import Agda.Builtin.Equality data ⊥ : Set where cong : {A B : Set} (f : A → B) {x y : A} → x ≡ y → f x ≡ f y cong f refl = refl postulate funExt : ∀ {A B : Set} {f g : A → B} → (∀ x → f x ≡ g x) → f ≡ g data D : Set where c1 : D → ⊥ → D c2 : (⊥ → D) → D cycle : ∀ {n} → c2 (c1 n) ≡ n → ⊥ cycle (...
open import Data.List open import Data.List.Any open import Data.Nat as ℕ data capn-kind : Set where cKStruct : capn-kind ckInter : capn-kind open import Relation.Binary.PropositionalEquality open Membership (setoid capn-kind) capn-ctx = List capn-kind data capn-τ : {Γ : capn-ctx} → Set data capn-field : {Γ : capn-c...
{- This file contains a direct proof that the Brunerie number (the number n s.t. π₄(S³)≅ℤ/nℤ) is 2, not relying on any of the more advanced constructions in chapters 4-6 in Brunerie's thesis (but still using chapters 1-3 for the construction). The Brunerie number is defined via S³ ≃ S¹ * S¹ -ᵂ→ S² ∨ S² -ᶠᵒˡᵈ→ S² wher...
-- Basic intuitionistic propositional calculus, without ∨ or ⊥. -- Kripke-style semantics with contexts as concrete worlds, and glueing for α and ▻. -- Hilbert-style syntax. module BasicIPC.Semantics.KripkeConcreteGluedHilbert where open import BasicIPC.Syntax.Common public open import Common.Semantics public open C...
{-# OPTIONS --without-K --rewriting #-} open import HoTT open import cohomology.Theory {- Ordinary cohomology groups of the n-torus Tⁿ = (S¹)ⁿ. - We have Cᵏ(Tⁿ) == C⁰(S⁰)^(n choose' k) where _choose'_ defined as below. - This argument could give Cᵏ((Sᵐ)ⁿ) with a little more work. -} module cohomology.Torus {i} (OT...
------------------------------------------------------------------------ -- Some derivable properties ------------------------------------------------------------------------ open import Algebra module Algebra.Props.Lattice (l : Lattice) where open Lattice l open import Algebra.Structures import Algebra.FunctionProp...
------------------------------------------------------------------------ -- Code related to the paper "Bag Equivalence via a Proof-Relevant -- Membership Relation" -- -- Nils Anders Danielsson ------------------------------------------------------------------------ -- Note that the code does not follow the paper exact...
{-# OPTIONS --without-K --safe #-} module Cham.Label where open import Cham.Name data Label : Set where _⁺ : Name → Label _⁻ : Name → Label
module prelude where open import Function using (id; _∘_) public open import Data.Sum renaming (inj₁ to Σ₁; inj₂ to Σ₂) using (_⊎_) public open import Data.Product renaming (proj₁ to π₁; proj₂ to π₂) using (Σ; _×_; _,_; ∃; Σ-syntax) public open import Agda.Builtin.Unit using (⊤; tt) public open import Data.Empty using ...
module Data.Vec.Membership.Propositional.Distinct.Properties where open import Data.Fin as Fin open import Relation.Binary.PropositionalEquality as P open import Data.Vec as Vec using (Vec; [] ; _∷_ ; _++_) open import Data.Vec.Any open import Data.Vec.Membership.Propositional.Distinct open import Data.Vec.Membership.P...
module Utils where open import Data.Fin using (Fin) import Data.Fin as F open import Data.Nat data Fromℕ (n : ℕ) : ℕ → Set where yes : (m : Fin n) → Fromℕ n (F.toℕ m) no : (m : ℕ) → Fromℕ n (n + m) fromℕ : ∀ n m → Fromℕ n m fromℕ zero m = no m fromℕ (suc n) zero = yes F.zero fromℕ (suc n) (suc m) with ...
{-# OPTIONS --without-K --safe #-} open import Definition.Typed.EqualityRelation module Definition.LogicalRelation.Fundamental {{eqrel : EqRelSet}} where open EqRelSet {{...}} open import Definition.Untyped open import Definition.Untyped.Properties open import Definition.Typed open import Definition.LogicalRelation ...
------------------------------------------------------------------------ -- Some auxiliary operations and lemmas ------------------------------------------------------------------------ module BreadthFirst.Lemmas where open import Codata.Musical.Notation open import Codata.Musical.Colist as Colist using (Colist; []...
{-# OPTIONS --cubical --no-import-sorts --safe #-} module Cubical.HITs.GroupoidQuotients where open import Cubical.HITs.GroupoidQuotients.Base public open import Cubical.HITs.GroupoidQuotients.Properties public
{-# OPTIONS --copatterns #-} -- 2013-05-30 Andreas, Oury's counterexample to subject reduction in Coq -- 2014-11-04 Andreas: simplified (removed force) module MatchingOnCoinductiveRecord where open import Common.Equality record U : Set where coinductive constructor inn field out : U open U u : U out u = ...
{-# OPTIONS --cubical --safe #-} module Cubical.Data.Sum.Properties where open import Cubical.Core.Everything open import Cubical.Foundations.Prelude open import Cubical.Foundations.HLevels open import Cubical.Data.Empty open import Cubical.Data.Nat open import Cubical.Data.Sum.Base -- Path space of sum type module ...
module Sets.PredicateSet.Finite{ℓₗ}{ℓₒ} where import Lvl open import Functional open import Logic.Propositional{ℓₗ Lvl.⊔ ℓₒ} open import Logic.Predicate{ℓₗ}{ℓₒ} open import Numeral.Finite open import Numeral.Natural import Relator.Equals open import Sets.PredicateSet open import Structure.Function.Domain ope...
{-# OPTIONS --universe-polymorphism #-} module Categories.Monad.Strong where open import Categories.Category open import Categories.Monoidal open import Categories.Functor renaming (id to idF; _∘_ to _∘F_; _≡_ to _≡F_) open import Categories.Functor.Constant open import Categories.NaturalTransformation renaming (...
module OTT.Prelude where open import Level renaming (Level to MetaLevel; zero to lzeroₘ; suc to lsucₘ; _⊔_ to _⊔ₘ_) using () public open import Function public open import Relation.Binary.PropositionalEquality as P using (_≡_) renaming (refl to prefl; trans to ptrans; subst to psubst; cong to pcong; cong₂ to pcong...
{-# OPTIONS --without-K --safe #-} open import Algebra.Structures.Bundles.Field import Algebra.Linear.Structures.Bundles.FiniteDimensional as FDB module Algebra.Linear.Space.FiniteDimensional.Hom {k ℓᵏ} (K : Field k ℓᵏ) {p a₁ ℓ₁} (V₁-space : FDB.FiniteDimensional K a₁ ℓ₁ p) {n a₂ ℓ₂} (V₂-space : ...
------------------------------------------------------------------------ -- The Agda standard library -- -- Properties satisfied by join semilattices ------------------------------------------------------------------------ {-# OPTIONS --without-K --safe #-} open import Relation.Binary.Lattice module Relation.Binary....
open import Agda.Builtin.Nat open import Agda.Builtin.Sigma interleaved mutual data Rec : Set ⟦_⟧ : Rec → Set constructor `Nat : Rec ⟦ `Nat ⟧ = Nat _ : Rec _ = `Σ `Nat (λ _ → `Nat) _ : Rec → Rec _ = λ r → `Σ r (λ _ → `Nat) constructor `Σ : (r : Rec) → (⟦ r ⟧ → Rec) → Rec ⟦ `Σ A B ⟧ = Σ ⟦ A ⟧...
{-# OPTIONS --without-K #-} module Lecture4 where import Lecture3 open Lecture3 public -- the identity type on a type A, given a fixed basepoint x data Id {i : Level} {A : UU i} (x : A) : A → UU i where refl : Id x x _==_ : {i : Level} {A : UU i} (x y : A) → UU i x == y = Id x y ind-Id : {i j : Level} {A : UU i}...
-- Testing how the pragmas are saved in the agda interface files (using -- the program dump-agdai) when they are used from the command-line: -- $ agda --no-termination-check OptionPragmaCommandLine.agda -- 17 October 2012. Because the PragmaOption --no-termination-check -- was used from the command-line it is *not* s...
{-# OPTIONS --cubical-compatible #-} open import Agda.Builtin.Equality subst : {A : Set} {@0 x y : A} (@0 P : A → Set) → x ≡ y → P x → P y subst P refl p = p
module Lists.Reverse where open import Lists open import Nats open import Equality open import Function ------------------------------------------------------------------------ -- internal stuffs private -- rev$v:a=a:rev$v : ∀ {n m} {A : Set n} (a : A) (v : List A m) → -- rev (v ∷ʳ a) ≡ a ∷ rev ...
module Structure.Operator.Monoid.Monoids.Coset where open import Functional open import Function.Equals open import Function.Equals.Proofs import Lvl open import Logic open import Logic.Predicate open import Logic.Predicate.Equiv open import Sets.PredicateSet renaming (_≡_ to _≡ₛ_) open import Structure.Function ...
-- Exponentials and closed categories module CategoryTheory.BCCCs.Closed where open import CategoryTheory.Categories open import CategoryTheory.BCCCs.Cartesian module _ {n} {ℂ : Category n} (Cℂ : Cartesian ℂ) where open Category ℂ open Cartesian Cℂ -- Exponential from two objects record Exponential...
{- Please do not move this file. Changes should only be made if necessary. This file contains benchmarks for the paper: Synthetic Integral Cohomology in Cubical Agda Guillaume Brunerie, Axel Ljungström, Anders Mörtberg Computer Science Logic (CSL) 2022 Command to run the benchmarks and get timings: agda -v profile...
{-# OPTIONS --safe --warning=error --without-K #-} open import LogicalFormulae open import Numbers.Naturals.Definition open import Numbers.Naturals.Naturals open import Numbers.Integers.Integers open import Groups.Groups open import Groups.Definition open import Groups.Lemmas open import Rings.Definition open import R...
{- This second-order term syntax was created from the following second-order syntax description: syntax PropLog | PR type * : 0-ary term false : * | ⊥ or : * * -> * | _∨_ l20 true : * | ⊤ and : * * -> * | _∧_ l30 not : * -> * | ¬_ r50 theory (⊥U∨ᴸ) a |> or (false, a) = a (⊥U∨ᴿ) a |> ...
-- Andreas, 2015-11-18 Fixing de Bruijn indices in debug print for with. {-# OPTIONS -v tc.with.top:25 #-} -- KEEP! postulate Trash A : Set P : A → Set provokeError : Trash -- The trash arguments should not show up in the debug printing! -- If they do, permutations or de Bruijn indices are messed up, -- or th...
{-# OPTIONS --without-K --safe #-} open import Categories.Category module Categories.Category.Complete.Properties.Construction {o ℓ e} (C : Category o ℓ e) where open import Level open import Data.Product using (∃₂; _,_; -,_) open import Categories.Category.Complete open import Categories.Diagram.Equalizer C open i...
{-# OPTIONS --without-K #-} module Leftovers.Utils where open import Data.String using (String) open import Data.List as List -- open import Reflection open import Leftovers.Monad open import Reflection.Term open import Reflection.Pattern as P -- open import Reflection.TypeChecking.Monad.Instances open import Data.Na...
open import Nat open import Prelude open import contexts open import core open import dynamics-core open import lemmas-gcomplete open import disjointness open import dom-eq open import holes-disjoint-checks open import lemmas-disjointness open import lemmas-freshness open import finality open import focus-formation...
{-# OPTIONS --without-K --rewriting #-} module lib.PathSeq where open import lib.path-seq.Ap public open import lib.path-seq.Concat public open import lib.path-seq.Inversion public open import lib.path-seq.Reasoning public open import lib.path-seq.Rotations public open import lib.path-seq.Split public
{-# OPTIONS --safe #-} open import Definition.Typed.EqualityRelation module Definition.LogicalRelation.Substitution.Introductions.IdNat {{eqrel : EqRelSet}} where open EqRelSet {{...}} open import Definition.Untyped open import Definition.Untyped.Properties open import Definition.Typed open import Definition.Typed.P...
module Control.WellFounded where open import Prelude open import Prelude.Nat.Properties using (suc-inj) data Acc {a} {A : Set a} (_<_ : A → A → Set a) (x : A) : Set a where acc : (∀ y → y < x → Acc _<_ y) → Acc _<_ x -- LessNat is well-founded -- private wfNatSlow : (n : Nat) → Acc _<_ n wfNatSlow′ : (n j y...
{-# OPTIONS --without-K --exact-split --safe #-} module Contract where open import Basic_Types open import Identity open import Homotopy_Equivalence -- a contractable space means there is a point which is path-connected to any -- other point in the same space is_contr : Set → Set is_contr A = Σ a ∶ A , (∀ (x : A) →...
{-# OPTIONS --cubical-compatible #-} open import Agda.Builtin.Nat open import Agda.Builtin.Equality data Fin : Nat → Set where zero : {n : Nat} → Fin (suc n) suc : {n : Nat} (i : Fin n) → Fin (suc n) -- From Data.Fin.Properties in the standard library (2016-12-30). suc-injective : ∀ {o} {m n : Fin o} → Fin.suc...
-- Andreas, 2016-11-03, issue #2292 -- Internal error when debugging the coverage checker. {-# OPTIONS -v tc.cover.top:10 #-} -- KEEP! data ⊥ : Set where ⊥-elim : ∀{A : Set} → ⊥ → A ⊥-elim ()
-- Some theorems about operations on non-deterministic values module nondet-thms where open import bool open import bool-thms open import nat open import eq open import nat-thms open import functions open import nondet ---------------------------------------------------------------------- -- Theorems about values co...
-- A minor variant of code reported by Andreas Abel. The code below -- should be rejected. open import Agda.Builtin.Size data ⊥ : Set where data SizeLt (i : Size) : Set where size : (j : Size< i) → SizeLt i <∞ : SizeLt ∞ <∞ = size ∞ data D (i : Size) : SizeLt i → Set where c : ∀ {i' : Size< i} → ((j : SizeLt i...
module Vec where open import SHE-Prelude data Nat : Set where z : Nat s : Nat -> Nat data Vec (X : Set) : Nat -> Set where vNil : Vec X z _:-_ : forall {n} -> X -> Vec X n -> Vec X (s n) _+N_ : Nat -> Nat -> Nat z +N n = n s m +N n = s (m +N n) _vappend_ : forall {X m n} -> Vec X m -> Vec X n ->...
{-# OPTIONS --safe #-} module Cubical.Algebra.CommAlgebra.Base where open import Cubical.Foundations.Prelude open import Cubical.Foundations.Equiv open import Cubical.Foundations.HLevels open import Cubical.Foundations.SIP open import Cubical.Data.Sigma open import Cubical.Algebra.Semigroup open import Cubical.Algeb...
{-# OPTIONS --safe #-} module Definition.Conversion.EqRelInstance where open import Definition.Untyped open import Definition.Untyped.Properties using (wkSingleSubstId) open import Definition.Typed open import Definition.Typed.Properties open import Definition.Typed.Weakening using (_∷_⊆_; wkEq; step; id) open import...
open import Array open import Array.APL open import Data.Nat open import Data.Nat.Properties open import Data.Nat.DivMod hiding (_/_) open import Data.Fin hiding (_≤_; _<_; _+_) --using (Fin; zero; suc; toℕ) open import Data.Vec open import Data.Vec.Properties open import Relation.Binary.PropositionalEquality open im...
data Dec (A : Set) : Set where yes : A → Dec A no : Dec A record ⊤ : Set where constructor tt data _≡_ {A : Set}(x : A) : A → Set where refl : x ≡ x subst : ∀ {A}(P : A → Set){x y} → x ≡ y → P x → P y subst P refl px = px cong : ∀ {A B}(f : A → B){x y} → x ≡ y → f x ≡ f y cong f refl = refl postulate _≟_ :...
open import Common.Prelude open import TestHarness open import TestBool using ( not; _∧_ ; _↔_ ) module TestList where _++_ : ∀ {X} → List X → List X → List X [] ++ ys = ys (x ∷ xs) ++ ys = x ∷ (xs ++ ys) revApp : ∀ {X} → List X → List X → List X revApp [] ys = ys revApp (x ∷ xs) ys = revApp xs (x ∷ ys) ...
{-# OPTIONS --safe #-} module Data.Vec.Sigma where open import Prelude open import Data.Unit.UniversePolymorphic renaming (⊤ to ⊤′) Vec⁺ : Type a → ℕ → Type a Vec⁺ A zero = A Vec⁺ A (suc n) = A × Vec⁺ A n Vec : Type a → ℕ → Type a Vec A 0 = ⊤′ Vec A (suc n) = Vec⁺ A n private variable n : ℕ open import D...
-- Regression, introduced by the fix of issue 1759 module Issue1815 where module _ (A : Set) where record R1 : Set where field f1 : A record R2 : Set where field f2 : R1 open R1 f2 public -- Parameter A is hidden in type of field f1 in R1 ... test1 : ∀ A (r : R1 A) → A test1 A r = R1.f1 r -- ... a...
------------------------------------------------------------------------ -- The Agda standard library -- -- This module is DEPRECATED. Please use -- Data.Vec.Relation.Binary.Equality.Propositional directly. ------------------------------------------------------------------------ {-# OPTIONS --without-K --safe #-} mod...
open import Issue1251.NonTerminating
open import Agda.Builtin.Bool open import Agda.Builtin.Equality open import Agda.Builtin.Float data ⊥ : Set where defNegZero : -0.0 ≡ 0.0 → ⊥ defNegZero () primEqNegZero : primFloatEquality -0.0 0.0 ≡ false primEqNegZero = refl primLtNegZero₁ : primFloatNumericalLess 0.0 -0.0 ≡ false primLtNegZero₁ = refl primLtN...
{-# OPTIONS --universe-polymorphism #-} open import Categories.Category open import Categories.Object.BinaryProducts open import Categories.Object.Exponentiating module Categories.Object.Exponentiating.Adjunction {o ℓ e} (C : Category o ℓ e) (binary : BinaryProducts C) (Σ : Category.Obj C) (exponentiat...
module Test where data Nat : Set where zero : Nat suc : Nat -> Nat module Q where module R where f : Nat -> Nat f n = suc n module B (n : Nat) where open Q.R public q = f n module Bz = B zero postulate _==_ : {A : Set} -> A -> A -> Set refl : {A : Set}{x : A} -> x == x
{-# OPTIONS --cubical --no-import-sorts --safe #-} module Cubical.DStructures.Equivalences.GroupSplitEpiAction where open import Cubical.Foundations.Prelude open import Cubical.Foundations.Isomorphism open import Cubical.Foundations.Function open import Cubical.Foundations.Structure open import Cubical.Data.Sigma ope...
{-# OPTIONS --without-K --rewriting #-} open import lib.Base module lib.PathGroupoid where module _ {i} {A : Type i} where {- Concatenation of paths There are two different definitions of concatenation of paths, [_∙_] and [_∙'_], with different definitionnal behaviour. Maybe we should have only one but it’s ...
module Lec2Start where open import Lec1Done ------------------------------------------------------------------------------ -- Vectors -- the star of exercise 1 ------------------------------------------------------------------------------ data Vec (X : Set) : Nat -> Set where -- like lists, but length-indexed [...
{-# OPTIONS --without-K --rewriting #-} open import lib.Basics open import lib.types.Group open import lib.types.CommutingSquare open import lib.groups.Homomorphism open import lib.groups.Isomorphism module lib.groups.CommutingSquare where -- A new type to keep the parameters. record CommSquareᴳ {i₀ i₁ j₀ j₁} {G₀ ...
module Control.SimplePar where open import Prelude open import Builtin.Float open import Builtin.Coinduction Val : Set Val = Float data IVar (A : Set) : Set where ivar : Int → IVar A data Trace : Set where Get : IVar Val → (Val -> Trace) → Trace Put : IVar Val → Val → Trace → Trace New : (IVar Val -> Tra...
-- Andreas, 2019-05-03, issue #3732 -- -- Do not erase constructor arguments when bound to Haskell data type. -- Otherwise, it is not predictable how the Haskell constructors should look like. -- {-# OPTIONS -v compile:100 #-} open import Agda.Builtin.IO open import Agda.Builtin.Unit {-# FOREIGN GHC data I = Bar #-}...
module Metalogic.Linear.SequentCalculus {ℓₚ} (Proposition : Set(ℓₚ)) where
{-# OPTIONS --without-K --rewriting #-} open import lib.Base open import lib.Function open import lib.PathFunctor open import lib.PathGroupoid module lib.path-seq.Concat {i} {A : Type i} where infixr 80 _∙∙_ _∙∙_ : {a a' a'' : A} → a =-= a' → a' =-= a'' → a =-= a'' _∙∙_ [] t = t _∙∙_ (p ◃∙ s) t = p ◃∙ (s ∙∙ t) ∙∙...
module Pi0 where open import Data.Empty open import Data.Unit open import Data.Sum open import Data.Product open import Groupoid infixr 10 _◎_ infixr 30 _⟷_ ------------------------------------------------------------------------------ -- Level 0: -- Types at this level are just plain sets with no interesting path...
module Issue939 where record Sigma (A : Set)(P : A → Set) : Set where field fst : A .snd : P fst open Sigma postulate A : Set P : A → Set x : A .p : P x ex : Sigma A P ex = record { fst = x ; snd = p } -- Note: we do not need --irrelevant-projections to use them on the lhs. ex...
open import Data.Nat open import Data.Product open import Data.Empty open import Relation.Binary.PropositionalEquality module Stream where record Stream (A : Set) : Set where coinductive field head : A tail : Stream A open Stream public get : ∀ {A : Set} → Stream A → ℕ → A get s zero = h...
{-# OPTIONS --copatterns #-} module EmptyInductiveRecord where mutual data E : Set where e : F -> E record F : Set where inductive constructor c field f : E open F data ⊥ : Set where elim : E → ⊥ elim (e (c x)) = elim x elim' : E → ⊥ elim' (e y) = elim' (f y)
{-# OPTIONS --no-main #-} data List (A : Set) : Set where [] : List A _∷_ : A → List A → List A {-# COMPILE GHC List = data Non (Sense) #-} -- should result in warning when compiling {-# BUILTIN LIST List #-} {-# BUILTIN NIL [] #-} {-# BUILTIN CONS _∷_ #-}