text
stringlengths
4
690k
{-# OPTIONS --without-K #-} module PathStructure.Empty where open import Equivalence open import Types split-path : {x y : ⊥} → x ≡ y → ⊥ split-path = J (λ _ _ _ → ⊥) id _ _ merge-path : {x y : ⊥} → ⊥ → x ≡ y merge-path = 0-elim split-merge-eq : {x y : ⊥} → (x ≡ y) ≃ ⊥ split-merge-eq = split-path , (merge-path ...
module Interpreter where open import Agda.Builtin.IO using (IO) open import Agda.Builtin.Int using (pos) open import Agda.Builtin.Unit using (⊤) open import FFI.IO using (getContents; putStrLn; _>>=_; _>>_) open import FFI.Data.Aeson using (Value; eitherDecode) open import FFI.Data.Either using (Left; Right) open imp...
------------------------------------------------------------------------ -- Propositional truncation ------------------------------------------------------------------------ {-# OPTIONS --erased-cubical --safe #-} -- Partly following the HoTT book. -- The module is parametrised by a notion of equality. The higher --...
-- Andreas, 2016-04-18 Issue 1834 regression (extracted from larger test case) -- {-# OPTIONS -v tc.cover:30 #-} data ℕ : Set where zero : ℕ suc : (n : ℕ) → ℕ record Stream (A : Set) : Set where coinductive constructor _∷_ field head : A tail : Stream A open Stream weird' : (n : ℕ) → Stream ℕ head...
{-# OPTIONS --cubical --no-import-sorts --safe #-} module Cubical.Relation.Unary.Subtype where open import Cubical.Foundations.Prelude open import Cubical.Foundations.Equiv open import Cubical.Foundations.Isomorphism open import Cubical.Foundations.HLevels open import Cubical.Relation.Unary open import Cubical.Data.N...
{-# OPTIONS --cubical --no-import-sorts --safe #-} module Cubical.Functions.FunExtEquiv where open import Cubical.Foundations.Prelude open import Cubical.Foundations.CartesianKanOps open import Cubical.Foundations.Equiv open import Cubical.Foundations.Function open import Cubical.Foundations.Isomorphism open import Cu...
module Data.Num.Bijection where open import Data.Num.Core open import Data.Num.Surjection open import Data.Num.Injection open import Data.Nat open import Data.Empty using (⊥) open import Data.Unit using (⊤; tt) open import Function.Bijection open Bijective open import Relation.Nullary open import Relation.Nullary.D...
module Utils where open import Relation.Binary.PropositionalEquality open import Data.List listHeadEq : ∀ {α} {A : Set α} {x y : A} -> {xt yt : List A} -> x ∷ xt ≡ y ∷ yt -> x ≡ y listHeadEq refl = refl listTailEq : ∀ {α} {A : Set α} {x y : A} -> {xt yt : List A} -> x ∷ xt ≡ y ∷ yt -> xt ≡ yt listTailEq refl = refl...
module trie where open import bool open import char open import list open import maybe open import product open import string open import unit cal : Set → Set cal A = 𝕃 (char × A) empty-cal : ∀{A : Set} → cal A empty-cal = [] cal-lookup : ∀ {A : Set} → cal A → char → maybe A cal-lookup [] _ = nothing cal-lookup ((...
{-# OPTIONS --without-K --rewriting #-} open import HoTT -- TODO Is it possible to have a more generic [→-group] construction? module groups.ToOmega where ⊙→Ω-group-structure : ∀ {i j} (X : Ptd i) (Y : Ptd j) → GroupStructure (X ⊙→ ⊙Ω Y) ⊙→Ω-group-structure X Y = record {M} where module M where ident : (X ⊙...
module Proc where open import Basics module ProcDef (U : Set)(T : U -> Set)(Name : U -> Set) where LT : U -> Set LT a = Lift (T a) record Tran (a b : U) : Set where field upV : T b -> LT a downV : T a -> LT b mapLT : {a b : U} -> (T a -> LT b) -> List (T a) -> List (T b) mapLT f [] = [...
open import Relation.Binary.Core module Bound.Total.Order.Properties {A : Set} (_≤_ : A → A → Set) (trans≤ : Transitive _≤_) where open import Bound.Total A open import Bound.Total.Order _≤_ lemma-LeB≤ : {x y : A} → LeB (val x) (val y) → x ≤ y lemma-LeB≤ (lexy x≤y) = x≤y transLe...
module STLC.Examples where -- This file contains a few example programs for the definitional -- interpreter for STLC in Section 2. open import Data.Maybe.Base open import Data.List.Base open import Data.List.Relation.Unary.Any open import Data.List.Relation.Unary.All open import Data.List.Membership.Propositional ope...
------------------------------------------------------------------------------ -- The predicate names are translated as constant names ------------------------------------------------------------------------------ {-# OPTIONS --exact-split #-} {-# OPTIONS --no-sized-types #-} {-# OPTIONS --no-un...
module Simple where postulate Nat : Set zero : Nat -- we want -- ?0 zero = zero -- and then -- ?0 x = x
module Data.QuadTree.Implementation.PropDepthRelation where open import Haskell.Prelude open import Data.Logic ---- Properties of depth lteTransitiveWeird : (x y d : Nat) -> IsTrue (x < y) -> (y <= d) ≡ ((x <= d) && (y <= d)) lteTransitiveWeird zero zero zero xlty = refl lteTransitiveWeird zero zero (suc d) xlty = r...
open import trie-core open import string open import maybe module trie-functions (trie-lookup : ∀{A : Set} → trie A → string → maybe A) (trie-insert : ∀{A : Set} → trie A → string → A → trie A) (trie-remove : ∀{A : Set} → trie A → string → trie A) where open import bool ope...
------------------------------------------------------------------------ -- The Agda standard library -- -- Properties satisfied by decidable total orders ------------------------------------------------------------------------ {-# OPTIONS --without-K --safe #-} open import Relation.Binary module Relation.Binary.Pro...
{-# OPTIONS --without-K #-} module hott.level.sets where open import hott.level.sets.core public open import hott.level.sets.extra public
module Basics where id : ∀ {a}{A : Set a} → A → A id x = x _∘_ : ∀ {a b c}{A : Set a}{B : Set b}{C : Set c} → (f : B → C) → (g : A → B) → (A → C) f ∘ g = λ x → f (g x)
{-# OPTIONS --cubical --allow-unsolved-metas #-} open import Agda.Builtin.Cubical.Path open import Agda.Primitive.Cubical open import Agda.Builtin.Bool postulate Index : Set i : Index data D : Index → Set where c : D i cong : {A B : Set} (x y : A) (f : A → B) → x ≡ y → f x ≡ f y cong _ _ f x≡y = λ i → f ...
open import Oscar.Prelude open import Oscar.Class module Oscar.Class.Reflexivity where module Reflexivity' {𝔬} {𝔒 : Ø 𝔬} {𝔯} (_∼_ : 𝔒 → 𝔒 → Ø 𝔯) (x : 𝔒) = ℭLASS (_∼_) (x ∼ x) module Reflexivity {𝔬} {𝔒 : Ø 𝔬} {𝔯} (_∼_ : 𝔒 → 𝔒 → Ø 𝔯) where class = ∀ {x} → Reflexivity'.class _∼_ x type...
-- Andreas, 2019-07-23, issue #3937 reported by gallais f : let ... = ? in ? f = ? -- WAS: internal error -- Expected: Could not parse the left-hand side ...
{- Definition of a basis of a distributive lattice as a generating sub-meet-semilattice -} {-# OPTIONS --safe #-} module Cubical.Algebra.DistLattice.Basis where open import Cubical.Foundations.Prelude open import Cubical.Foundations.Function open import Cubical.Foundations.Equiv open import Cubical.Foundations.Equiv....
module WellTypedTermsModel where open import Library open import WellTypedTerms open import RMonads.REM open import FunctorCat open import Categories.Sets -- interpretation of types Val : Ty → Set Val ι = ⊤ Val (σ ⇒ τ) = Val σ → Val τ -- interpretation of contexts Env : Con → Set Env Γ = ∀{σ} → Var Γ σ → V...
module Class.Traversable where open import Class.Monad open import Level record Traversable {a} (T : Set a -> Set a) : Set (suc a) where field sequence : ∀ {M : Set a -> Set a} {{_ : Monad M}} {A : Set a} -> T (M A) -> M (T A) open Traversable {{...}} public
open import Coinduction using ( ♯_ ) open import Data.Bool using ( Bool ; true ; false ; not ) open import Data.ByteString using ( null ) open import Data.ByteString.UTF8 using ( fromString ) renaming ( span to #span ) open import Data.Natural using ( Natural ) open import Data.Product using ( _×_ ; _,_ ) open import D...
module Text.Greek.SBLGNT.2Thess where open import Data.List open import Text.Greek.Bible open import Text.Greek.Script open import Text.Greek.Script.Unicode ΠΡΟΣ-ΘΕΣΣΑΛΟΝΙΚΕΙΣ-Β : List (Word) ΠΡΟΣ-ΘΕΣΣΑΛΟΝΙΚΕΙΣ-Β = word (Π ∷ α ∷ ῦ ∷ ∙λ ∷ ο ∷ ς ∷ []) "2Thess.1.1" ∷ word (κ ∷ α ∷ ὶ ∷ []) "2Thess.1.1" ∷ word (Σ ...
open import Data.Empty open import Data.Maybe open import Data.Product open import Data.Unit open import Axiom.Extensionality.Propositional open import Relation.Binary.PropositionalEquality hiding ([_]) open import Relation.Nullary open import Relation.Nullary.Negation open import EffectAnnotations open import Types ...
module BadInductionRecursion3 where data Bool : Set where false : Bool true : Bool data Two : Bool -> Set where zero : Two false suc : Two false -> Two true mutual data D : Set where d : forall u -> D′ true u -> D D′ : forall b -> Two b -> Set D′ ._ zero = D D′ ._ (suc n) = D′ _ n -> Bool ...
-- MIT License -- Copyright (c) 2021 Luca Ciccone and Luca Padovani -- Permission is hereby granted, free of charge, to any person -- obtaining a copy of this software and associated documentation -- files (the "Software"), to deal in the Software without -- restriction, including without limitation the rights to use...
-- Algorithmic equality. {-# OPTIONS --safe #-} module Definition.Conversion where open import Definition.Untyped open import Definition.Typed open import Tools.Nat import Tools.PropositionalEquality as PE infix 10 _⊢_~_↑_^_ infix 10 _⊢_[conv↑]_^_ infix 10 _⊢_[conv↓]_^_ infix 10 _⊢_[conv↑]_∷_^_ infix 10 _⊢_[conv↓...
{-# OPTIONS --cubical --safe #-} module Data.Array.Skew where open import Prelude open import Data.Binary.Skew open import Data.List open import Data.Nat using (_+_) private variable p : Level P : ℕ → Type p n : ℕ ns : 𝔹 infixl 6 _∔_ _∔_ : ℕ → ℕ → ℕ zero ∔ m = m suc n ∔ m = n ∔ suc m infixl 4 _...
-- Issue #2814 reported by tomjack on 2017-10-18 {-# OPTIONS --cubical --rewriting --confluence-check #-} -- prelude stolen from Saizan/cubical-demo open import Agda.Primitive.Cubical public open import Agda.Builtin.Cubical.Path Path = _≡_ refl : ∀ {ℓ} {A : Set ℓ} {x : A} → x ≡ x refl {x = x} = λ _ → x postulate ...
{-# OPTIONS --copatterns --sized-types #-} {- M types done properly coinductive -} module NewM where open import Size open import Coinduction open import Data.Product open import Function open import Data.M as M record M' {i : Size} (A : Set) (B : A → Set) : Set where coinductive field d : ∀ {j : Size< i} → ...
{-# OPTIONS --without-K --safe #-} module Definition.Typed.Consequences.Substitution where open import Definition.Untyped open import Definition.Untyped.Properties open import Definition.Typed open import Definition.Typed.Properties open import Definition.Typed.EqRelInstance open import Definition.Typed.Weakening ope...
{- Binary natural numbers (Anders Mörtberg, Jan. 2019) This file defines two representations of binary numbers. We prove that they are equivalent to unary numbers and univalence is then used to transport both programs and properties between the representations. This is an example of how having computational univalence...
{-# OPTIONS --cubical --no-import-sorts --safe #-} module Cubical.Categories.Limits.Pullback where open import Cubical.Foundations.Prelude open import Cubical.Categories.Limits.Base open import Cubical.Categories.Category open import Cubical.Categories.Functor open import Cubical.Data.Sigma open import Cubical.Catego...
open import Agda.Primitive open import Agda.Builtin.Sigma data Empty : Set where _≃_ : ∀ {ℓ ℓ'} (A : Set ℓ) (B : Set ℓ') → Set (ℓ ⊔ ℓ') A ≃ B = Σ (A → B) λ f → Empty record Iso {ℓ ℓ'} (A : Set ℓ) (B : Set ℓ') : Set (ℓ ⊔ ℓ') where field inv : B → A postulate isoToEquiv : ∀{ℓ ℓ'} {A : Set ℓ} {B : Set ℓ'} → Is...
---------------------------------------------------------------------- -- Copyright: 2013, Jan Stolarek, Lodz University of Technology -- -- -- -- License: See LICENSE file in root of the repo -- -- Repo address: https://github.com/...
------------------------------------------------------------------------ -- M-types ------------------------------------------------------------------------ {-# OPTIONS --without-K --sized-types #-} open import Equality module M {reflexive} (eq : ∀ {a p} → Equality-with-J a p reflexive) where open import Bijectio...
module Sane where import Data.Fin as F -- -- open import Data.Empty open import Data.Unit -- open import Data.Unit.Core open import Data.Nat using (ℕ ; zero ; suc ; _+_ ; _>_ ) open import Data.Sum using (inj₁ ; inj₂ ) -- open import Data.Product renaming (map to _×→_) open import Data.Vec open import Function using (...
module Data.Vec.Membership.Properties where open import Data.Vec open import Data.Vec.Membership open import Data.Vec.Any.Membership.Propositional
{-# OPTIONS --cubical --safe #-} module Cubical.HITs.Susp where open import Cubical.HITs.Susp.Base public -- open import Cubical.HITs.Susp.Properties public
------------------------------------------------------------------------ -- The Agda standard library -- -- Some properties about integers ------------------------------------------------------------------------ {-# OPTIONS --without-K --safe #-} module Data.Integer.Properties where open import Algebra import Algebr...
{-# OPTIONS --exact-split #-} {-# OPTIONS --no-sized-types #-} {-# OPTIONS --no-universe-polymorphism #-} {-# OPTIONS --without-K #-} module LogicalFramework.AdequacyTheorems where module Example5 where -- First-order logic with equality. open import Common.FOL.FOL-Eq public...
------------------------------------------------------------------------ -- The Agda standard library -- -- Properties of right-scaling ------------------------------------------------------------------------ {-# OPTIONS --without-K --safe #-} open import Relation.Binary -- The properties are parameterised by the tw...
module Lec1Done where -- the -- mark introduces a "comment to end of line" ------------------------------------------------------------------------------ -- some basic "logical" types ------------------------------------------------------------------------------ data Zero : Set where -- to give a value in a data,...
open import Level hiding ( suc ; zero ) open import Algebra module sym3 where open import Symmetric open import Data.Unit open import Function.Inverse as Inverse using (_↔_; Inverse; _InverseOf_) open import Function open import Data.Nat hiding (_⊔_) -- using (ℕ; suc; zero) open import Relation.Nullary open import Da...
{-# OPTIONS --allow-unsolved-metas #-} -- FIXME open import Everything module Test.Test2 where failed-test test-functor-transextensionality test-the-test : ∀ {𝔬₁} {𝔒₁ : Ø 𝔬₁} {𝔯₁} {_∼₁_ : 𝔒₁ → 𝔒₁ → Ø 𝔯₁} {ℓ₁} {_∼̇₁_ : ∀ {x y} → x ∼₁ y → x ∼₁ y → Ø ℓ₁} {ε₁ : Reflexivity.type _∼₁_} {_↦₁_ :...
---------------------------------------------------------------------- -- Copyright: 2013, Jan Stolarek, Lodz University of Technology -- -- -- -- License: See LICENSE file in root of the repo -- -- Repo address: https://github.com/...
open import Common.Reflect open import Common.Prelude open import Common.Equality data Maybe A : Set where nothing : Maybe A just : A → Maybe A _<$>_ : ∀ {A B} → (A → B) → Maybe A → Maybe B f <$> just x = just (f x) f <$> nothing = nothing _==_ = primQNameEquality -- This is awkward! awkwardUnquoteNat : Term ...
module Testing where data Nat : Set where zero : Nat suc : Nat -> Nat {-# BUILTIN NATURAL Nat #-} plus : Nat -> Nat -> Nat plus zero n = n plus (suc m) n = suc (plus m n) times : Nat -> Nat -> Nat times zero n = zero times (suc m) n = plus n (times m n) data List (A : Set) : Nat -> Set where nil : List...
-- Andreas, 2020-03-26, issue #4481, reported by gallais -- #952 unintentionally added named lambdas, but without updating the type-checker. -- {-# OPTIONS --show-implicit #-} -- {-# OPTIONS -v tc.term.expr.top:15 #-} -- {-# OPTIONS -v tc.term.lambda:30 #-} open import Agda.Primitive -- In Agda 2.6.0 and 2.6.1, thi...
-- Andreas, 2014-03-02, issue and test case by Nisse -- {-# OPTIONS --show-implicit -v tc.meta.assign:25 -v tc.meta.occurs:70 -v tc.meta.kill:30 #-} -- {-# OPTIONS -v tc:10 #-} record Σ (A : Set) (B : A → Set) : Set where constructor _,_ field proj₁ : A proj₂ : B proj₁ open Σ public postulate A : Set ...
{-# OPTIONS --cubical --safe #-} module NormalForm where open import Cubical.Core.Everything using (_≡_; Level; Type; Σ; _,_; fst; snd; _≃_; ~_) open import Cubical.Foundations.Prelude using (refl; sym; _∙_; cong; transport; subst; funExt; transp; i0; i1) open import Cubical.Foundations.Function using (_∘_) o...
open import Data.Bool using ( Bool ) open import Data.String using ( String ) open import Data.Word using ( Byte ) open import Data.Natural using ( Natural ) module Data.ByteString.Primitive where postulate ByteStringLazy : Set ByteStringLazy² : Set emptyLazy : ByteStringLazy consLazy : Byte → ByteStringLazy ...
open import Data.Empty open import Data.Maybe open import Data.Product open import Data.Sum open import Data.Unit open import AEff open import AwaitingComputations open import EffectAnnotations open import Preservation open import Renamings open import Substitutions open import Types open import Relation.Binary.Propo...
{-# OPTIONS --without-K --exact-split #-} module categories where import 21-image open 21-image public {- We introduce precategories and categories. -} Precat : (l1 l2 : Level) → UU (lsuc l1 ⊔ lsuc l2) Precat l1 l2 = Σ (UU l1) (λ Obj → Σ (Obj → Obj → hSet l2) (λ Hom → Σ ({X : Obj} → type-Set (Hom X X)) (λ i...
{-# OPTIONS --allow-unsolved-metas #-} module Formula where module _ where open import VariableName open import PredicateName open import Term data Formula : Set where atomic : PredicateName → Terms → Formula logical : Formula → Formula → Formula quantified : Variab...
-- Andreas, 2018-03-19, issue #2971, reported by Ulf -- Splitting on result should give proper error -- when record type is weak, i.e. lacks projections. {-# OPTIONS --no-irrelevant-projections #-} -- {-# OPTIONS -v tc.cover:20 #-} open import Agda.Builtin.Nat open import Agda.Builtin.Equality record Five : Set whe...
{-# OPTIONS --without-K #-} module container.m where open import container.m.coalgebra public open import container.m.from-nat public open import container.m.core public open import container.m.extensionality public open import container.m.level public
{- 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 open import Haskell.Modules.RWS.Lens open imp...
open import Agda.Builtin.Equality open import Agda.Builtin.Reflection renaming (bindTC to _>>=_) open import Agda.Builtin.String open import Agda.Builtin.List open import Agda.Builtin.Unit impNames : Term → List String impNames (pi (arg (arg-info hidden _) _) (abs x b)) = x ∷ impNames b impNames _ = [] macro impli...
module BasicIPC.Metatheory.GentzenSpinalNormalForm-HereditarySubstitution where open import BasicIPC.Syntax.GentzenSpinalNormalForm public -- Hereditary substitution and reduction. mutual [_≔_]ⁿᶠ_ : ∀ {A B Γ} → (i : A ∈ Γ) → Γ ∖ i ⊢ⁿᶠ A → Γ ⊢ⁿᶠ B → Γ ∖ i ⊢ⁿᶠ B [ i ≔ s ]ⁿᶠ neⁿᶠ (spⁿᵉ j xs) with i ≟∈ j [ i ≔ s...
{-# OPTIONS --cubical --no-positivity-check --no-termination-check #-} open import Prelude open import Algebra open import Algebra.Monus open import Relation.Binary open import Data.Maybe open import Data.List using (List; _∷_; []; foldr) module Control.Monad.HeapT {ℓ} (monoid : Monoid ℓ) (gmon : GradedMonad mo...
------------------------------------------------------------------------ -- The Agda standard library -- -- The min operator derived from an arbitrary total order ------------------------------------------------------------------------ {-# OPTIONS --without-K --safe #-} open import Relation.Binary module Algebra.Con...
{-# OPTIONS --without-K --safe #-} open import Definition.Typed.EqualityRelation module Definition.LogicalRelation.Substitution.Reflexivity {{eqrel : EqRelSet}} where open EqRelSet {{...}} open import Definition.LogicalRelation.Properties open import Definition.LogicalRelation.Substitution open import Definition.Unt...
------------------------------------------------------------------------ -- The Agda standard library -- -- A universe of proposition functors, along with some properties ------------------------------------------------------------------------ module Relation.Nullary.Universe where open import Relation.Nullary open i...
module BFF where open import Data.Nat using (ℕ) open import Data.Fin using (Fin) open import Level using () renaming (zero to ℓ₀) import Category.Monad import Category.Functor open import Data.Maybe using (Maybe ; just ; nothing ; maybe′) open Category.Monad.RawMonad {Level.zero} Data.Maybe.monad using (_>>=_) open Ca...
module MLib.Prelude.FromStdlib where -------------------------------------------------------------------------------- -- Misc -------------------------------------------------------------------------------- open import Level public using (Level) renaming ( zero to zeroˡ; suc to sucˡ; _⊔_ to _⊔ˡ_ ; Lif...
module Categories.Agda.ISetoids.Complete where open import Level open import Relation.Binary using (Setoid; module Setoid; Preorder; module Preorder; Rel; _=[_]⇒_) open import Data.Product using (Σ; _,_; proj₁; proj₂) open import Categories.Support.IProduct -- import Relation.Binary.EqReasoning as EqReasoning open im...
module Tactic.Nat.NF where open import Prelude open import Tactic.Nat.Exp open import Container.Bag Tm : Set → Set Tm Atom = List Atom NF : Set → Set NF Atom = Bag (Tm Atom) product1 : List Nat → Nat product1 [] = 1 product1 (x ∷ xs) = foldl (λ n x → n * x) x xs module _ {Atom : Set} {{_ : Ord Atom}} where infi...
{-# OPTIONS --no-positivity-check #-} module IIRDr where import LF import IIRD open LF open IIRD -- Agda2 has restricted IIRDs so we can define Ur/Tr directly mutual data Ur {I : Set}{D : I -> Set1}(γ : OPr I D)(i : I) : Set where intror : Hu γ (Ur γ) (Tr γ) i -> Ur {I}{D} γ i Tr : {I : Set}{D : I -> Set1}...
{-# OPTIONS --warning=error --safe --guardedness --without-K #-} open import Setoids.Orders.Partial.Definition open import Setoids.Setoids open import LogicalFormulae open import Rings.Definition open import Numbers.Rationals.Definition open import Functions.Definition module Numbers.Reals.Definition where open impo...
-- Andreas, 2016-07-28, issue #779 data D : Set where c : D record R : Set1 where bla : D → D bla c = c field F : Set -- Current: -- Not a valid let-definition -- Expected: -- Success, or error outlawing pattern matching definition before last field.
{-# OPTIONS --without-K --safe #-} open import Categories.Category -- this module characterizes a category of all products indexed by I. -- this notion formalizes a category with all products up to certain cardinal. module Categories.Object.Product.Indexed {o ℓ e} (C : Category o ℓ e) where open import Level open i...
{-# OPTIONS --without-K #-} open import level open import algebra.group.core open import algebra.monoid.mset open import algebra.monoid.morphism open import function.extensionality open import function.isomorphism open import equality.calculus open import equality.core open import sum open import hott.level open import...
{- Definition of finite sets There are may different formulations of finite sets in constructive mathematics, and we will use Bishop finiteness as is usually called in the literature. -} {-# OPTIONS --safe #-} module Cubical.Data.FinSet.Base where open import Cubical.Foundations.Prelude open import Cubical.Foundat...
module Luau.RuntimeError where open import Agda.Builtin.Equality using (_≡_) open import Luau.Heap using (Heap; lookup) open import FFI.Data.Maybe using (just; nothing) open import Luau.Syntax using (Block; Expr; nil; var; addr; function⟨_⟩_end; block_is_end; _$_; local_←_; function_⟨_⟩_end; return; done; _∙_) data R...
{-# OPTIONS --warning=error --safe --without-K #-} open import LogicalFormulae open import Numbers.Naturals.Semiring open import Numbers.Naturals.Addition open import Numbers.Naturals.Order open import Numbers.Naturals.Multiplication open import Semirings.Definition open import Orders.Total.Definition module Numbers....
module Prelude.Decidable where open import Prelude.Empty data Dec {a} (P : Set a) : Set a where yes : P → Dec P no : ¬ P → Dec P infix 0 ifYes_then_else_ ifNo_then_else_ ifYes_then_else_ : ∀ {a b} {A : Set a} {B : Set b} → Dec A → B → B → B ifYes yes _ then x else _ = x ifYes no _ then _ else y = y ifNo_then...
{-# OPTIONS --without-K #-} open import Type open import Function open import Function.Extensionality open import Data.Fin using (Fin) open import Level.NP open import Algebra open import Algebra.FunctionProperties.NP open import Data.Fin using (Fin; zero; suc) open import Data.Nat open import Data.Product open import ...
{-# OPTIONS --without-K -v 2 #-} module Leftovers.Equality where open import Leftovers.Utils -- open import Leftovers.Leftovers import Level as Level -- open import Reflection open import Reflection.Term open import Reflection.Pattern as P open import Reflection.TypeChecking.Monad.Instances open import Relation.Bin...
-- Adapted from Wadler: https://plfa.github.io/Lambda/ module Context (A : Set) where open import Prelude open import Data.Nat open import Relation.Binary.PropositionalEquality using (_≡_; _≢_; refl; sym) open import Data.Maybe open import Data.Product using (_×_; proj₁; proj₂; ∃-syntax) renaming (_,_ to...
open import Proc module Hear (param : Param) where open import Basics private open module P = Process param open Tran hear : {a : U}{p : Proc a} -> Guard p -> LT a -> Proc a hear {p = p} g bot = p hear og (lift v) = o hear (w !g p) (lift v) = w ! p hear (>g f) (lift v) = f v hear (_ ! _...
module NatProps where open import Data.Nat using (ℕ ; _≟_ ; _<_ ; zero ; suc ; s≤s) open import Relation.Nullary using (Dec ; yes ; no ; ¬_) open import Relation.Binary.PropositionalEquality using (_≡_ ; refl ; sym) <-¬≡ : ∀ {n m} → n < m → ¬ n ≡ m <-¬≡ {zero} {zero} () <-¬≡ {zero} {suc m} p = λ () <-¬≡ {suc n...
------------------------------------------------------------------------ -- The Agda standard library -- -- Properties of permutations using setoid equality ------------------------------------------------------------------------ {-# OPTIONS --without-K --safe #-} open import Relation.Binary hiding (Decidable) modul...
module L.Base.Nat.Properties where open import L.Base.Nat open import L.Base.Id.Core open import L.Base.Id.Properties using (ap;sym;transport) -- Properties of + +-idl : ∀{x} → zero + x ≡ x +-idl = refl +-idr : ∀{x} → x + zero ≡ x +-idr {x} = ind (λ n → n + zero ≡ n) refl (λ _ p → ap succ p) x +-assoc : {x y z : Na...
-- Andreas, 2017-01-12, issue #2386 open import Agda.Primitive data _≡_ {a b} {A : Set (a ⊔ b)} : (x y : A) → Set where refl : (x : A) → x ≡ x {-# BUILTIN EQUALITY _≡_ #-} -- Should be accepted -- The type of primErase has to match the flavor of EQUALITY primitive primEraseEquality : ∀ {a b}{A : Set (a ⊔ b)} {x...
{-# OPTIONS --safe #-} module Cubical.Algebra.AbGroup.Instances.DirectSumHIT where open import Cubical.Foundations.Prelude open import Cubical.Algebra.AbGroup open import Cubical.Algebra.DirectSum.DirectSumHIT.Base open import Cubical.Algebra.DirectSum.DirectSumHIT.Properties private variable ℓ ℓ' : Level module...
open import Agda.Primitive open import Agda.Builtin.Equality variable ℓ : Level A : Set ℓ P : A → Set ℓ x y : A f : (x : A) → P x cong : x ≡ y → f x ≡ f y cong refl = refl
------------------------------------------------------------------------ -- Descending lists ------------------------------------------------------------------------ {-# OPTIONS --cubical --no-import-sorts --safe #-} open import Cubical.Foundations.Everything module Cubical.Data.DescendingList.Base (A : Type₀) (_...
------------------------------------------------------------------------ -- The Agda standard library -- -- A categorical view of Covec ------------------------------------------------------------------------ {-# OPTIONS --without-K --safe --sized-types #-} module Codata.Covec.Categorical where open import Codata.Co...
{-# OPTIONS --without-K --exact-split --safe #-} open import Fragment.Equational.Theory.Base module Fragment.Equational.Theory.Combinators (Θ : Theory) where open import Fragment.Algebra.Signature open import Fragment.Algebra.Properties open import Fragment.Equational.Model using (Model; IsModel; Models) open impo...
{-# OPTIONS --type-in-type #-} Ty : Set Ty = (Ty : Set) (nat top bot : Ty) (arr prod sum : Ty → Ty → Ty) → Ty nat : Ty; nat = λ _ nat _ _ _ _ _ → nat top : Ty; top = λ _ _ top _ _ _ _ → top bot : Ty; bot = λ _ _ _ bot _ _ _ → bot arr : Ty → Ty → Ty; arr = λ A B Ty nat top bot arr prod sum → ...
module IdemInvo where open import Relation.Binary.PropositionalEquality module MainResult (A : Set) (f : A → A) (idem : ∀ x → f (f x) ≡ f x) (invo : ∀ x → f (f x) ≡ x) where -- an idempotent and involutive function is an identity function iden : ∀ x → f x ≡ x iden x = trans (sym (idem x)) (invo x)
postulate I : Set data Box (A : Set) : Set where [_] : A → Box A variable @0 i : I @0 b : Box I data D : @0 Box I → Set where d : D [ i ] → D [ i ] variable @0 x : D b data P : @0 D b → Set where p : P (d x) works : ∀ {i} {@0 x : D [ i ]} → P (d x) works = p fails : ∀ {@0 i} {@0 x : D [ i ]} → P (...
{-# OPTIONS --cubical --safe #-} module Cubical.Foundations.FunExtEquiv where open import Cubical.Foundations.Prelude open import Cubical.Foundations.Equiv open import Cubical.Foundations.Univalence private variable ℓ ℓ₁ ℓ₂ ℓ₃ : Level -- Function extensionality is an equivalence module _ {A : Type ℓ} {B : A → ...
{-# OPTIONS --without-K --safe #-} open import Categories.Category module Categories.Object.Coproduct {o ℓ e} (𝒞 : Category o ℓ e) where open import Level open import Function using (_$_) open Category 𝒞 open import Categories.Morphism.Reasoning 𝒞 open import Categories.Morphism 𝒞 open HomReasoning private ...