text
stringlengths
4
690k
-- For the first task, we are asked to prove that max is idempotent and -- associative. The proves presented in this file are as succint as they -- possibly can. The proves come with added comments to aid understanding as -- the proves are meant to be short and simple but not very legible. The -- solution to task 1 sta...
module PiFrac.Examples where open import Data.Empty open import Data.Unit hiding (_≟_) open import Data.Sum open import Data.Product open import Data.Nat open import Relation.Binary.Core open import Relation.Binary open import Relation.Nullary open import Relation.Binary.PropositionalEquality open import Data.Maybe op...
------------------------------------------------------------------------------ -- The map-iterate property: A property using co-induction ------------------------------------------------------------------------------ {-# OPTIONS --exact-split #-} {-# OPTIONS --no-sized-types #-} {-# OPTIONS --no...
open import Prelude open import Nat open import Bij module NatDelta where instance NatBij : bij Nat Nat NatBij = record { convert = λ n → n; inj = λ n → n; surj = λ n → n , refl} open import Delta Nat {{NatBij}} nat-dd = dd
module Utils.HaskellTypes where postulate String : Set {-# BUILTIN STRING String #-} data Unit : Set where triv : Unit {-# COMPILED_DATA Unit () () #-} data Prod (A : Set) (B : Set) : Set where _,_ : A → B → Prod A B {-# COMPILED_DATA Prod (,) (,) #-} data Triple (A B C : Set) : Set where triple : A → B → C →...
module Numeral.Natural.Relation.DivisibilityWithRemainder.Proofs where import Lvl open import Data open import Data.Boolean.Stmt open import Functional open import Logic.Predicate open import Logic.Propositional open import Numeral.Finite import Numeral.Finite.Proofs as 𝕟 open import Numeral.Natural open im...
{- Maybe structure: X ↦ Maybe (S X) -} {-# OPTIONS --cubical --no-import-sorts --no-exact-split --safe #-} module Cubical.Structures.Maybe where open import Cubical.Foundations.Prelude open import Cubical.Foundations.Equiv open import Cubical.Foundations.Function open import Cubical.Foundations.Isomorphism open im...
{-# OPTIONS --cubical --safe --postfix-projections #-} open import Cubical.Core.Everything open import Cubical.Foundations.Embedding open import Cubical.Foundations.Equiv open import Cubical.Foundations.Function open import Cubical.Foundations.Isomorphism open import Cubical.Foundations.Prelude open import Cubical.Fo...
module Main where open import IO open import Data.String open import Data.List open import Data.Bool {-# IMPORT AST #-} {-# COMPILED_TYPE String AST.Type #-} {-# COMPILED_TYPE String AST.Identifier #-} data Variable : Set where V : String → String → Variable varName : Variable → String varName (V _ name) = name ...
module trees where data Tree (A : Set) : Set where empty : Tree A node : Tree A -> A -> Tree A -> Tree A open import Data.Nat #nodes : {A : Set} -> Tree A -> ℕ #nodes empty = 0 #nodes (node t x t₁) = (#nodes t) + (1 + (#nodes t₁)) #leafs : {A : Set} -> Tree A -> ℕ #leafs empty = zero -- #lea...
------------------------------------------------------------------------ -- Queue instances for the queues in Queue.Truncated ------------------------------------------------------------------------ {-# OPTIONS --erased-cubical --safe #-} import Equality.Path as P open import Prelude import Queue module Queue.Trunca...
open import Relation.Nullary using (Dec; yes; no) open import Relation.Binary.PropositionalEquality using (_≡_; refl; sym) open import Data.Sum using (_⊎_) open _⊎_ module AKS.Nat.Roots where open import AKS.Nat using (ℕ; _≤_; _<_; n≤m⇒n<m⊎n≡m; <-irrefl; *-1-commutativeMonoid) open ℕ open import AKS.Nat using ([_,_]...
{-# OPTIONS --cubical --safe #-} module Function.Surjective.Base where open import Path open import Function.Fiber open import Level open import HITs.PropositionalTruncation open import Data.Sigma Surjective : (A → B) → Type _ Surjective f = ∀ y → ∥ fiber f y ∥ SplitSurjective : (A → B) → Type _ SplitSurjective f =...
module T where postulate x : Set postulate y : Set postulate p : Set -> Set e : Set e = p y
open import Agda.Builtin.Reflection open import Agda.Builtin.Unit @0 A : Set₁ A = Set macro @0 m : Term → TC ⊤ m B = bindTC (quoteTC A) λ A → unify A B B : Set₁ B = m
module Prelude.Bool where open import Prelude.Unit open import Prelude.Empty open import Prelude.Equality open import Prelude.Decidable open import Prelude.Function open import Agda.Builtin.Bool public infix 0 if_then_else_ if_then_else_ : ∀ {a} {A : Set a} → Bool → A → A → A if true then x else y = x if false the...
module Prelude.Char where open import Prelude.Bool postulate Char : Set {-# BUILTIN CHAR Char #-} private primitive primCharEquality : (c c' : Char) -> Bool postulate eof : Char {-# COMPILED_EPIC eof () -> Int = foreign Int "eof" () #-} charEq : Char -> Char -> Bool charEq = primCharEquality
-- Andreas, 2018-06-15, issue #1086 -- Reported by Andrea -- Fixed by Jesper in https://github.com/agda/agda/commit/242684bca62fabe43e125aefae7526be4b26a135 open import Common.Bool open import Common.Equality and : (a b : Bool) → Bool and true b = b and false b = false test : ∀ a b → and a b ≡ true → a ≡ true test ...
------------------------------------------------------------------------ -- Encoder and decoder instances for Atom.χ-ℕ-atoms ------------------------------------------------------------------------ module Coding.Instances.Nat where open import Atom -- The code-Var and code-Const instances are hidden: they are replac...
{-# OPTIONS --warning=error --without-K --guardedness --safe #-} open import LogicalFormulae open import Numbers.Naturals.Definition open import Setoids.Setoids open import Numbers.Naturals.Order open import Vectors module Sequences where record Sequence {a : _} (A : Set a) : Set a where coinductive field he...
{- Properties and Formulae about Cardinality This file contains: - Relation between abstract properties and cardinality in special cases; - Combinatorial formulae, namely, cardinality of A+B, A×B, ΣAB, ΠAB, etc; - A general form of Pigeonhole Principle; - Maximal value of numerical function on finite sets; - Set trun...
------------------------------------------------------------------------ -- The Agda standard library -- -- Decidable setoid membership over vectors. ------------------------------------------------------------------------ {-# OPTIONS --without-K --safe #-} open import Relation.Binary using (DecSetoid) module Data.V...
module _ where open import Agda.Primitive.Cubical postulate PathP : ∀ {ℓ} (A : I → Set ℓ) → A i0 → A i1 → Set ℓ {-# BUILTIN PATHP PathP #-}
module #8 where {- Define multiplication and exponentiation using recN. Verify that (N, +, 0, ×, 1) is a semiring using only indN. You will probably also need to use symmetry and transitivity of equality, Lemmas 2.1.1 and 2.1.2. -} open import Data.Nat recₙ : ∀{c}{C : Set c} → C → (ℕ → C → C) → ℕ → C recₙ c₀ c...
--------------------------------------- -- Pairs of sets --------------------------------------- {-# OPTIONS --allow-unsolved-meta #-} module sv20.assign2.SetTheory.Pairs where -- Everything involving pairs, be them unordered -- or ordered pairs. Also the definition of power set -- and cartesian product between sets...
postulate A : Set I : ..(_ : A) → Set R : A → Set f : ∀ ..(x : A) (r : R x) → I x -- can now be used here ^
module examplesPaperJFP.VariableListForDispatchOnly where open import Data.Product hiding (map) open import Data.List open import NativeIO open import StateSizedIO.GUI.WxBindingsFFI open import Relation.Binary.PropositionalEquality data VarList : Set₁ where [] : VarList addVar : (A : Set) → Var A → VarLi...
{-# OPTIONS --without-K #-} open import lib.Basics {- The generic nonrecursive higher inductive type with one point constructor and one paths constructor. -} module lib.types.Generic1HIT {i j} (A : Type i) (B : Type j) (g h : B → A) where {- data T : Type where cc : A → T pp : (b : B) → cc (f' b) ≡ cc (g b) ...
-- Andreas, 2017-01-12, issue #2386 id : ∀{a}{A : Set a} → A → A id x = x data Eq (A : Set) : (x y : id A) → Set where refl : (x : A) → Eq A x x {-# BUILTIN EQUALITY Eq #-} -- Should be accepted.
{-# OPTIONS --warning=error --safe #-} open import Everything.Safe -- This file contains everything that is --safe, but uses K. open import Logic.PropositionalLogic open import Logic.PropositionalLogicExamples open import Logic.PropositionalAxiomsTautology open import Sets.FinSetWithK open import Groups.FreeGroup.L...
module Generic.Lib.Data.Product where open import Data.Product renaming (map to pmap; zip to pzip) hiding (map₁; map₂) public open import Generic.Lib.Intro open import Generic.Lib.Category infixl 4 _,ᵢ_ first : ∀ {α β γ} {A : Set α} {B : Set β} {C : A -> Set γ} -> (∀ x -> C x) -> (p : A × B) -> C (proj₁ p) × ...
{-# OPTIONS --cubical --safe #-} module Cubical.HITs.Modulo where open import Cubical.HITs.Modulo.Base public open import Cubical.HITs.Modulo.Properties public
{-# OPTIONS --without-K --safe #-} module Categories.Utils.EqReasoning where open import Level open import Relation.Binary.PropositionalEquality open import Data.Product using (Σ; _,_; _×_) open import Categories.Utils.Product subst₂-sym-subst₂ : {ℓa ℓb ℓp : Level} {A : Set ℓa} {B : Set ℓb} {a₁ a₂ : A} {b₁ b₂ : B} ...
module BuildingBlock.BinaryLeafTree where open import Function open import Data.Nat open import Data.Nat.Etc open import Data.Nat.Properties.Simple using (+-right-identity) open import Data.Product using (_×_; _,_; proj₁; proj₂) open import Data.Fin using (Fin; toℕ; fromℕ; fromℕ≤; reduce≥) renaming (zero to Fz...
{-# OPTIONS --cubical --no-import-sorts --safe #-} {- This module develops Lehmer codes, i.e. an encoding of permutations as finite integers. -} module Cubical.Data.Fin.LehmerCode where open import Cubical.Foundations.Prelude open import Cubical.Foundations.Function open import Cubical.Foundations.Equiv open import ...
{-# OPTIONS --without-K --safe #-} -- A Logical Relation for Dependent Type Theory Formalized in Agda module Logrel-MLTT where -- README import README -- Minimal library import Tools.Empty import Tools.Unit import Tools.Nat import Tools.Sum import Tools.Product import Tools.Function import Tools.Nullary import Tool...
module Prelude.Int.Core where open import Prelude.Unit open import Prelude.Empty open import Prelude.Nat open import Prelude.Number open import Prelude.Semiring open import Prelude.Ord open import Agda.Builtin.Int public neg : Nat → Int neg zero = pos zero neg (suc n) = negsuc n {-# INLINE neg #-} -- Integers a...
open import Oscar.Prelude module Oscar.Data.Maybe where data Maybe {a} (A : Ø a) : Ø a where ∅ : Maybe A ↑_ : A → Maybe A -- A dependent eliminator. maybe : ∀ {a b} {A : Set a} {B : Maybe A → Set b} → ((x : A) → B (↑ x)) → B ∅ → (x : Maybe A) → B x maybe j n (↑ x) = j x maybe j n ∅ = n -- A non-depen...
{- 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 -} module Dijkstra.EitherD where open import Agda.Builtin.Equality using ...
module Structure.Category.NaturalTransformation where open import Functional using () renaming (id to idᶠⁿ) open import Functional.Dependent using () renaming (_∘_ to _∘ᶠⁿ_) import Lvl open import Logic open import Logic.Predicate open import Structure.Category open import Structure.Category.Functor ope...
module UniDB.Morph.Pair where open import UniDB.Spec -------------------------------------------------------------------------------- infixl 5 _⊗_ data Pair (Ξ Ζ : MOR) : MOR where _⊗_ : {γ₁ γ₂ γ₃ : Dom} (ξ : Ξ γ₁ γ₂) (ζ : Ζ γ₂ γ₃) → Pair Ξ Ζ γ₁ γ₃ instance iHCompPair : {Ξ Ζ : MOR} → HComp Ξ Ζ (Pair Ξ Ζ) ...
-- Andreas, 2015-11-28 Check that postfix constructors are fine. -- There was a TODO in Agda.Syntax.Concrete.Operators which claimed -- there would be an ambiguity between `true` applied to variable `wrap` -- and (_wrap true), and arity of constructors would have to be checked. -- Parsing works fine, so I removed this...
open import Agda.Builtin.Nat data B {A : Set} : A → Set where b : (a : A) → B a data C {A : Set} : ∀ {a} → B {A} a → Set where c : {a : A} → C (b a) id : ∀ {b} → C b → B 0 id c = {!!}
{-# OPTIONS --includeC=helloworld.c #-} module Prelude.FFI where open import Prelude.IO open import Prelude.String open import Prelude.Unit postulate helloworld : IO Unit test : IO String {-# COMPILED_EPIC helloworld (u : Unit) -> Unit = foreign Unit "hello_world" () #-} {-# COMPILED_EPIC test (u : Unit) -> Unit...
-- Σ-Terms module Terms where open import Data.Vec hiding (_++_) open import Relation.Binary.PropositionalEquality open import Data.Nat open import Data.List open import Data.List.All open import Data.Fin.Base open import Size -- Ranked alphabet: Vector of natural numbers, where vec[i] denotes the arity of symbol i...
-- Andreas, 2017-08-28, issue #2723, reported by Andrea {-# OPTIONS --allow-unsolved-metas #-} -- {-# OPTIONS --warning=error #-} -- {-# OPTIONS -v tc.cover:30 #-} record Test : Set1 where field one two : Set open Test foo : Test foo .one = {!!} foo = {!!} foo .two = {!!} -- WAS: internal error in clause com...
module huffman where open import lib open import huffman-types public ---------------------------------------------------------------------------------- -- Run-rewriting rules ---------------------------------------------------------------------------------- data gratr2-nt : Set where _ws-plus-10 : gratr2-nt _ws...
{-# OPTIONS --without-K --safe #-} module Data.Binary.Tests.Subtraction where open import Data.List as List using (List; _∷_; []) open import Data.Product open import Data.Nat as ℕ using (ℕ; suc; zero) open import Data.Binary.Definitions open import Data.Binary.Operations.Semantics as Pos using (⟦_⇓⟧⁺) open import Re...
module NoSig where open import Data.Nat myFun : ℕ myFun = (\ x y -> y ) (\ x -> x) 0
------------------------------------------------------------------------ -- The Agda standard library -- -- Induction over Subset ------------------------------------------------------------------------ {-# OPTIONS --without-K --safe #-} module Data.Fin.Subset.Induction where open import Data.Nat.Base using (ℕ) open...
module Data.QuadTree.LensProofs.Valid-LensWrappedTree where open import Haskell.Prelude renaming (zero to Z; suc to S) open import Data.Lens.Lens open import Data.Logic open import Data.QuadTree.InternalAgda open import Agda.Primitive open import Data.Lens.Proofs.LensLaws open import Data.Lens.Proofs.LensPostulates op...
module LRTree {A : Set} where open import Data.List data Tag : Set where left : Tag right : Tag data LRTree : Set where empty : LRTree leaf : A → LRTree node : Tag → LRTree → LRTree → LRTree insert : A → LRTree → LRTree insert x empty = leaf x insert x (leaf y) = node left (leaf y) (leaf x) insert x (node...
module Issue206 where postulate I : Set P : I → Set i : I Q : P i → Set Foo : (p : P i) → Q p → Set₁ Foo p q with i Foo p q | i′ = Set -- Now better error message: -- Issue206.agda:11,1-19 -- w != i of type I -- when checking that the type of the generated with function -- (w : I) (p : P w) (q : Q p) → Set₁...
{-# OPTIONS --safe --warning=error --without-K #-} open import LogicalFormulae open import Groups.Definition open import Groups.Abelian.Definition open import Setoids.Setoids open import Vectors open import Numbers.Naturals.Semiring open import Sets.EquivalenceRelations module Groups.Vector {a b : _} {A : Set a} {S :...
------------------------------------------------------------------------ -- The Agda standard library -- -- Operations on and properties of decidable relations ------------------------------------------------------------------------ {-# OPTIONS --without-K --safe #-} module Relation.Nullary.Decidable where open impo...
module MLib.Prelude.Fin where open import MLib.Prelude.FromStdlib open import Data.Fin public open import Data.Fin.Properties public open FE using (cong) import Relation.Binary.Indexed as I -------------------------------------------------------------------------------- -- Types ----------------------------------...
------------------------------------------------------------------------ -- Higher lenses ------------------------------------------------------------------------ {-# OPTIONS --cubical --safe #-} import Equality.Path as P module Lens.Non-dependent.Higher {e⁺} (eq : ∀ {a p} → P.Equality-with-paths a p e⁺) where op...
open import Categories open import Functors open import RMonads module RMonads.CatofRAdj.TermRAdj {a b c d}{C : Cat {a}{b}}{D : Cat {c}{d}} {J : Fun C D}(M : RMonad J) where open import Library open import RAdjunctions open import RMonads.CatofRAdj M open import Categories.Termina...
{-# OPTIONS --without-K --safe #-} open import Algebra module Data.FingerTree {c m} (ℳ : Monoid c m) where open import Data.FingerTree.Measures ℳ open import Data.FingerTree.Structures ℳ open import Data.FingerTree.Cons ℳ open import Data.FingerTree.View ℳ open import Data.FingerTree.Split ℳ...
{-# OPTIONS --guardedness #-} module hello-world-prog where open import IO main : Main main = run (putStrLn "Hello, World!")
module CTL.Modalities.EF where open import FStream.Core open import Library -- Possibly sometime : s₀ ⊧ φ ⇔ ∃ s₀ R s₁ R ... ∃ i . sᵢ ⊧ φ data EF' {ℓ₁ ℓ₂} {C : Container ℓ₁} (props : FStream' C (Set ℓ₂)) : Set (ℓ₁ ⊔ ℓ₂) where alreadyE : head props → EF' props notYetE : E (fmap EF' (inF (tail props))) → EF' p...
open import Oscar.Prelude open import Oscar.Class open import Oscar.Class.Surjection open import Oscar.Class.Smap open import Oscar.Class.Reflexivity open import Oscar.Data.Proposequality module Oscar.Class.Surjidentity where module _ {𝔬₁ 𝔯₁ 𝔬₂ 𝔯₂ ℓ₂} {𝔒₁ : Ø 𝔬₁} {𝔒₂ : Ø 𝔬₂} where module Surjidenti...
-- Andreas, 2011-10-04, transcription of Dan Doel's post on the Agda list {-# OPTIONS --experimental-irrelevance #-} module IrrelevantMatchRefl where postulate Level : Set lzero : Level lsuc : (i : Level) → Level _⊔_ : Level -> Level -> Level {-# BUILTIN LEVEL Level #-} {-# BUILTIN LEVELZERO lzero #-}...
module Common.Prelude where {-# IMPORT Common.FFI #-} import Common.Level data ⊥ : Set where record ⊤ : Set where postulate Char : Set {-# BUILTIN CHAR Char #-} {-# COMPILED_TYPE Char Char #-} postulate String : Set {-# BUILTIN STRING String #-} {-# COMPILED_TYPE String String #-} data Nat : Set where zero...
{-# OPTIONS --safe --warning=error --without-K #-} open import Agda.Primitive using (Level; lzero; lsuc; _⊔_) open import LogicalFormulae open import Sets.EquivalenceRelations open import Setoids.Setoids module Setoids.DirectSum {m n o p : _} {A : Set m} {B : Set n} (R : Setoid {m} {o} A) (S : Setoid {n} {p} B) where...
open import Agda.Builtin.Nat open import Agda.Builtin.Equality postulate ⊤ ⊥ : Set _&_ : Set → Set → Set _≤_ : Nat → Nat → Set {-# TERMINATING #-} _∣_ : Nat → Nat → Set m ∣ zero = ⊤ zero ∣ suc n = ⊥ suc m ∣ suc n = (suc m ≤ suc n) & (suc m ∣ (n - m)) variable m n : Nat postulate divide-to-nat : n ∣ m...
{-# OPTIONS --without-K #-} module hott.equivalence.core where open import equality.core using (_≡_ ; refl ; ap) open import sum using (Σ ; proj₁ ; proj₂ ; _,_) open import level using (_⊔_) open import hott.level.core using (contr ; prop ; _⁻¹_) open import function.core using (_$_) open import function.isomorphism.c...
{-# OPTIONS --cubical --safe #-} module Data.Binary.Increment.Strict where open import Prelude open import Strict open import Data.Binary.Definition open import Data.Bits.Strict open import Data.Binary.Increment inc′ : 𝔹 → 𝔹 inc′ 0ᵇ = 1ᵇ 0ᵇ inc′ (1ᵇ xs) = 2ᵇ xs inc′ (2ᵇ xs) = 0∷! inc′ xs inc′≡inc : ∀ xs → in...
{-# OPTIONS --cubical --no-import-sorts --safe #-} open import Cubical.Core.Everything open import Cubical.Algebra.Group module Cubical.Algebra.Group.Coset {ℓ} (G : Group ℓ) where open import Cubical.Foundations.Prelude open import Cubical.Foundations.Equiv open import Cubical.Foundations.Function using (id; _∘_; fl...
open import Agda.Builtin.List open import Agda.Builtin.Nat open import Agda.Builtin.Unit open import Agda.Builtin.Reflection pattern vArg x = arg (arg-info visible (modality relevant quantity-ω)) x make2 : Term → TC ⊤ make2 hole = bindTC (normalise (def (quote _+_) (vArg (lit (nat 1)) ∷ vArg (lit (nat 1)) ∷ []))) (un...
-- a simple error monad module error where open import level open import string infixr 1 _≫=err_ _≫err_ data error-t{ℓ}(A : Set ℓ) : Set ℓ where no-error : A → error-t A yes-error : string → error-t A _≫=err_ : ∀{ℓ ℓ'}{A : Set ℓ}{B : Set ℓ'} → error-t A → (A → error-t B) → error-t B (no-error a) ≫=err f = f a (...
------------------------------------------- -- This file contains basic definitions. -- ------------------------------------------- module Basics where open import Level data ⊥-poly {l : Level} : Set l where ⊥-poly-elim : ∀ {l w} {Whatever : Set w} → ⊥-poly {l} → Whatever ⊥-poly-elim ()
module leftpad where open import Agda.Builtin.Nat renaming (Nat to ℕ) open import Data.Nat.Properties open import Data.Vec open import Data.Product open import Function open import Relation.Binary.PropositionalEquality data LeOrGt : ℕ → ℕ → Set where le : ∀ m k → LeOrGt m (k + m) gt : ∀ m k → LeOrGt (suc k + m) m...
{-# OPTIONS --rewriting #-} module Term.Core where open import Context open import Type open import Function open import Relation.Binary.PropositionalEquality hiding ([_]) open import Data.Empty open import Data.Unit.Base open import Data.Sum.Base {-# BUILTIN REWRITE _≡_ #-} {-# REWRITE foldlᶜ-▻-ε #-} {-# REWRITE ...
{-# OPTIONS --cubical-compatible #-} record Erased (A : Set) : Set where constructor [_] field @0 erased : A open Erased data W (A : Set) (B : A → Set) : Set where sup : (x : A) → (B x → W A B) → W A B lemma : {A : Set} {B : A → Set} → Erased (W A B) → W (Erased A) (λ x → Erased (B (erased x))) lemma ...
{-# OPTIONS --safe --warning=error --without-K #-} open import Numbers.Naturals.Definition open import Numbers.Integers.Definition open import Numbers.Integers.Addition open import Numbers.Integers.Multiplication open import Numbers.Integers.Order open import Groups.Definition module Numbers.Integers.Integers where ...
module AocUtil where open import Data.Maybe open import Data.String as String open import Foreign.Haskell using (Unit) open import Data.List as List open import Data.Nat open import Data.Char open import Data.Bool.Base open import AocIO void : ∀ {a} {A : Set a} → IO A → IO Unit void m = m >>= λ _ → return Unit.unit p...
------------------------------------------------------------------------ -- The extensional sublist relation over decidable setoid equality. ------------------------------------------------------------------------ {-# OPTIONS --without-K --safe #-} open import Relation.Binary module Data.List.Relation.Binary.Subset....
module Esterel.Variable.Signal where open import Data.Nat using (ℕ) renaming (_≟_ to _≟ℕ_) open import Function using (_∘_) open import Relation.Nullary using (Dec ; yes ; no ; ¬_) open import Relation.Binary using (Decidable) open import Relation.Binary.PropositionalEquality using (_≡_ ; refl ; cong ; trans...
{-# OPTIONS --without-K --safe #-} module Fragment.Examples.Semigroup.Arith.Base where open import Fragment.Prelude public open import Data.Nat using (ℕ; _*_; _+_) public open import Data.Nat.Properties using (*-isSemigroup; +-isSemigroup) open import Relation.Binary.PropositionalEquality public open ≡-Reasoning p...
module Bound.Lower.Order {A : Set}(_≤_ : A → A → Set) where open import Bound.Lower A data LeB : Bound → Bound → Set where lebx : {b : Bound} → LeB bot b lexy : {a b : A} → a ≤ b → LeB (val a) (val b)
module Issue1078.A where -- The typo in the module name is intended! open import Common.Level using (Level) open import Issue1078A test = Level
------------------------------------------------------------------------ -- A quotient inductive-inductive definition of the partiality monad ------------------------------------------------------------------------ {-# OPTIONS --erased-cubical --safe #-} module Partiality-monad.Inductive where import Equality.Path a...
module para where module Top (A B : Set) where module A (C D : Set) where postulate f : A -> B -> C -> D module B (E F : Set) = A F E renaming (f to j) postulate h : A -> B module C (G H : Set) where module D = B G H g' : A -> B g' = h g : A -> H -> G g x y = D.j x (h x) y modu...
------------------------------------------------------------------------------- -- -- SET (in Hedberg library) for agda2 -- as of 2006.9.29 morning -- Yoshiki. -- module SET where ---------------------------------------------------------------------------- -- Auxiliary. ----------------------------------------...
-- Andreas, 2014-09-23 module _ where syntax c x = ⟦ x ⟧ syntax c x y = x + y -- Should complain about multiple notations.
-- An Agda example file module test where open import Coinduction open import Data.Bool open import {- pointless comment between import and module name -} Data.Char open import Data.Nat open import Data.Nat.Properties open import Data.String open import Data.List hiding ([_]) open import Data.Vec hiding ([_]) open im...
module Monad where module Prelude where infixl 40 _∘_ id : {A : Set} -> A -> A id x = x _∘_ : {A B C : Set} -> (B -> C) -> (A -> B) -> A -> C f ∘ g = \x -> f (g x) data Nat : Set where zero : Nat suc : Nat -> Nat module Base where data Monad (M : Set -> Set) : Set1 where monad : (retu...
module Highlighting.M where postulate ℕ : Set _+_ _*_ : (x y : ℕ) → ℕ
module Definitions where data _∨_ (A B : Set) : Set where inl : A → A ∨ B inr : B → A ∨ B data _∧_ (A B : Set) : Set where _,_ : A → B → A ∧ B data ⊥ : Set where ¬_ : Set → Set ¬ A = A → ⊥
{-# OPTIONS --without-K #-} module equality.calculus where open import sum using (Σ ; _,_ ; proj₁; proj₂) open import equality.core open import equality.groupoid public open import function.core ap' : ∀ {i j} {X : Set i}{Y : X → Set j} {x x' : X}(f : (x : X) → Y x)(p : x ≡ x') → subst Y p (f x) ≡ f x' a...
open import Relation.Nullary.Decidable using (False) open import Relation.Binary.PropositionalEquality using (_≡_; refl; sym; cong; module ≡-Reasoning) open import Data.List using (List) open List open import Data.Unit using (tt) module AKS.Binary.Base where open import Polynomial.Simple.AlmostCommutativeRing using ...
{-# OPTIONS --safe --warning=error --without-K #-} open import Agda.Primitive using (Level; lzero; lsuc; _⊔_) open import LogicalFormulae open import Sets.EquivalenceRelations open import Setoids.Setoids module Setoids.Algebra.Lemmas {a b : _} {A : Set a} (S : Setoid {a} {b} A) where open Setoid S open Equivalence e...
-- {-# OPTIONS -v tc:30 #-} -- Andreas, 2016-07-19, issue #2102 -- An abstract definition in a where block should not -- stop metas of parent function to be solved! test : _ test = Set -- WAS: yellow where abstract def = Set -- should succeed test1 = Set module M where abstract def = Set -- Similar situat...
{-# OPTIONS --cubical --no-import-sorts --safe --experimental-lossy-unification #-} module Cubical.ZCohomology.Groups.Wedge where open import Cubical.ZCohomology.Base open import Cubical.ZCohomology.GroupStructure open import Cubical.ZCohomology.Properties open import Cubical.Foundations.HLevels open import Cubical.Fo...
{-# OPTIONS --cubical --safe --postfix-projections #-} -- This module defines a data type for balanced strings of parentheses, -- which is isomorphic to binary trees. module Data.Dyck.Rose where open import Prelude open import Data.Nat using (_+_) open import Data.Vec.Iterated using (Vec; _∷_; []; foldlN; head) open...
{-# OPTIONS --cubical --safe --postfix-projections #-} module Data.Sum.Properties where open import Prelude open import Data.Sum open import Data.Bool sumAsSigma : A ⊎ B ≃ Σ[ x ⦂ Bool ] (if x then A else B) sumAsSigma = isoToEquiv $ iso (either (true ,_) (false ,_)) (uncurry (bool inr inl)) (λ { (false...
{-# OPTIONS --without-K --safe #-} module Dodo.Binary.SplittableOrder where -- Stdlib imports import Relation.Binary.PropositionalEquality as Eq open Eq using (_≡_; refl) open import Level using (Level; _⊔_) open import Function using (_∘_) open import Data.Empty using (⊥-elim) open import Data.Sum using (_⊎_; inj₁; ...
{-# OPTIONS --without-K #-} {- The main definitions are the following: * exploreΣ * exploreΣ-ind * adequate-sumΣ -} open import Level.NP open import Type hiding (★) open import Type.Identities open import Function.NP open import Function.Extensionality open import Data.Two open import Data.Product.NP open impor...
{-# OPTIONS --without-K #-} module sets.vec.dependent where open import sets.nat.core open import sets.fin.core -- syntactic sugar to create finite dependent functions ⟦⟧ : ∀ {i}{P : Fin 0 → Set i} → (i : Fin 0) → P i ⟦⟧ () _∷∷_ : ∀ {i n}{P : Fin (suc n) → Set i} → (x : P zero)(xs : (i : Fin n) → P (suc i)) ...