text
stringlengths
4
690k
------------------------------------------------------------------------ -- The Agda standard library -- -- Vectors ------------------------------------------------------------------------ {-# OPTIONS --without-K --safe #-} module Data.Vec where open import Data.Nat open import Data.Fin using (Fin; zero; suc) open i...
open import Prelude hiding (abs) open import Container.List open import Container.Traversable open import Tactic.Reflection hiding (substArgs) renaming (unify to unifyTC) open import Tactic.Reflection.Equality open import Tactic.Deriving module Tactic.Deriving.Eq where _∋_ : ∀ {a} (A : Set a) → A → A A ∋ x = x priv...
{- Byzantine Fault Tolerant Consensus Verification in Agda, version 0.9. Copyright (c) 2020, 2021, Oracle and/or its affiliates. Licensed under the Universal Permissive License v 1.0 as shown at https://opensource.oracle.com/licenses/upl -} open import LibraBFT.Base.Types open import LibraBFT.Impl.OBM.Rust.Rust...
------------------------------------------------------------------------ -- An implementation of "A Unifying Approach to Recursive and -- Co-recursive Definitions" by Pietro Di Gianantonio and Marino -- Miculan ------------------------------------------------------------------------ -- See the paper for more explanati...
-- Problem 2: Multiplication for matrices (from the matrix algebra DSL). module P2 where -- 2a: Type the variables in the text. -- (This answer uses Agda syntax, but that is not required.) postulate Nat : Set postulate V : Nat -> Set -> Set postulate Fin : Nat -> Set Op : Set -> Set Op a = a -> a -> a postulate su...
{-# OPTIONS --without-K --safe #-} module C where open import Data.Empty open import Data.Unit open import Data.Sum open import Data.Product open import Relation.Binary.PropositionalEquality open import Singleton infixr 70 _×ᵤ_ infixr 60 _+ᵤₗ_ infixr 60 _+ᵤᵣ_ infixr 50 _⊚_ -----------------------------------------...
{-# OPTIONS --universe-polymorphism #-} module Categories.Product where open import Level open import Function using () renaming (_∘_ to _∙_) open import Data.Product using (_×_; Σ; _,_; proj₁; proj₂; zip; map; <_,_>; swap) open import Categories.Category private map⁎ : ∀ {a b p q} {A : Set a} {B : A → Set b} {P :...
open import Nat open import Prelude open import List open import core open import judgemental-erase open import sensibility open import moveerase module checks where -- these three judmgements lift the action semantics judgements to relate -- an expression and a list of pair-wise composable actions to the -- exp...
{-# OPTIONS --no-import-sorts #-} open import Agda.Primitive renaming (Set to _X_X_) test : _X_X₁_ test = _X_X_
{-# OPTIONS --without-K #-} open import Agda.Primitive using (Level; lsuc) open import Relation.Binary.PropositionalEquality.Core using (_≡_; cong) open import Data.Empty using (⊥; ⊥-elim) open import Data.Product using (proj₁; proj₂; Σ-syntax; _,_) open import Function.Base using (_∘_) variable ℓ ℓ′ : Level A C ...
{-# OPTIONS --cubical --safe #-} module Cubical.Homotopy.Loopspace where open import Cubical.Core.Everything open import Cubical.Data.Nat open import Cubical.Foundations.Prelude open import Cubical.Foundations.Pointed open import Cubical.Foundations.GroupoidLaws {- loop space of a pointed type -} Ω : {ℓ : Level} →...
module Sets.ImageSet.Oper where open import Data open import Functional open import Logic open import Logic.Propositional open import Logic.Predicate import Lvl open import Sets.ImageSet open import Structure.Function open import Structure.Setoid renaming (_≡_ to _≡ₛ_) open import Type open import Type.Dependent ...
open import Agda.Builtin.IO using (IO) open import Agda.Builtin.String using (String) open import Agda.Builtin.Unit using (⊤) data D : Set where c₁ c₂ : D f : D → Set → String f c₁ = λ _ → "OK" f c₂ = λ _ → "OK" -- The following pragma should refer to the generated Haskell name -- for f. {-# FOREIGN GHC {-# NOINL...
{-# OPTIONS --no-unreachable-check #-} module Issue424 where data _≡_ {A : Set₁} (x : A) : A → Set where refl : x ≡ x f : Set → Set f A = A f A = A fails : (A : Set) → f A ≡ A fails A = refl -- The case tree compiler used to treat f as a definition with an -- absurd pattern.
{-# OPTIONS --cubical --no-import-sorts #-} open import Cubical.Foundations.Everything renaming (_⁻¹ to _⁻¹ᵖ; assoc to ∙-assoc) open import Function.Base using (_∋_; _$_) open import MorePropAlgebra.Bundles import Cubical.Structures.CommRing as Std module MorePropAlgebra.Properties.CommRing {ℓ} (assumptions : CommR...
------------------------------------------------------------------------ -- The Agda standard library -- -- Trie, basic type and operations ------------------------------------------------------------------------ -- See README.Data.Trie.NonDependent for an example of using a trie to -- build a lexer. {-# OPTIONS --wi...
------------------------------------------------------------------------ -- INCREMENTAL λ-CALCULUS -- -- Logical relation for erasure (Def. 3.8 and Lemma 3.9) ------------------------------------------------------------------------ import Parametric.Syntax.Type as Type import Parametric.Syntax.Term as Term import Para...
open import Agda.Builtin.Nat open import Agda.Builtin.Sigma open import Agda.Builtin.Equality data I : Set where it : I data D : I → Set where d : D it data Box : Set where [_] : Nat → Box mutual data Code : Set where d : I → Code box : Code sg : (a : Code) → (El a → Code) → Code El : Cod...
{-# OPTIONS --rewriting #-} open import Agda.Builtin.Equality {-# BUILTIN REWRITE _≡_ #-} module _ (Form : Set) where -- FAILS -- postulate Form : Set -- WORKS data Cxt : Set where ε : Cxt _∙_ : (Γ : Cxt) (A : Form) → Cxt data _≤_ : (Γ Δ : Cxt) → Set where id≤ : ∀{Γ} → Γ ≤ Γ weak : ∀{A Γ Δ} (τ : Γ ≤ Δ) → (...
open import Agda.Builtin.Nat record R : Set where field x : Nat open R {{...}} f₁ : R -- This is fine. x ⦃ f₁ ⦄ = 0 -- WAS: THIS WORKS BUT MAKES NO SENSE!!! _ : Nat _ = f₁ {{ .x }} -- Should raise an error. -- Illegal hiding in postfix projection ⦃ .x ⦄ -- when scope checking f₁ ⦃ .x ⦄
{-# OPTIONS --without-K #-} module homotopy.3x3.Common where open import HoTT public hiding (↓-='-in; ↓-='-out; ↓-=-in; ↓-=-out; ↓-∘=idf-in) !-∘-ap-inv : ∀ {i j k} {A : Type i} {B : Type j} {C : Type k} (f : B → C) (g : A → B) {a b : A} (p : a == b) → ap-∘ f g p == ! (∘-ap f g p) !-∘-ap-inv f g idp = idp !-ap-∘...
------------------------------------------------------------------------ -- Monotone functions ------------------------------------------------------------------------ {-# OPTIONS --erased-cubical --safe #-} module Partiality-algebra.Monotone where open import Equality.Propositional.Cubical open import Prelude hidin...
-- Exercises for session 3 -- -- If unsure which exercises to do start with those marked with * -- {-# OPTIONS --cubical --allow-unsolved-metas #-} module ExerciseSession3 where open import Part1 open import Part2 open import Part3 open import Part4 open import ExerciseSession1 hiding (B) open import Cubical.Foundati...
------------------------------------------------------------------------------ -- In the Agda standard library zero divides zero ------------------------------------------------------------------------------ {-# OPTIONS --exact-split #-} {-# OPTIONS --no-sized-types #-} {-# OPTIONS --no-universe...
module Inductive.Examples.BinTree where open import Inductive open import Tuple open import Data.Fin open import Data.Product hiding (map) open import Data.List hiding (map) open import Data.Vec hiding (map) BinTree : Set → Set BinTree A = Inductive (([] , []) ∷ (((A ∷ []) , ([] ∷ ([] ∷ []))) ∷ [])) leaf : {A : Set...
{- This second-order equational theory was created from the following second-order syntax description: syntax Group | G type * : 0-ary term unit : * | ε add : * * -> * | _⊕_ l20 neg : * -> * | ⊖_ r40 theory (εU⊕ᴸ) a |> add (unit, a) = a (εU⊕ᴿ) a |> add (a, unit) = a (⊕A) a b c |> add (add(a, b)...
module Issue561.Core where postulate Char : Set {-# BUILTIN CHAR Char #-} open import Agda.Builtin.IO public postulate return : ∀ {a} {A : Set a} → A → IO A {-# COMPILE GHC return = \_ _ -> return #-} {-# COMPILE UHC return = \_ _ x -> UHC.Agda.Builtins.primReturn x #-} {-# COMPILE JS return = function(u0...
module Logic.Base where infix 60 ¬_ infix 30 _/\_ infix 20 _\/_ data True : Set where tt : True data False : Set where elim-False : {A : Set} -> False -> A elim-False () data _/\_ (P Q : Set) : Set where /\-I : P -> Q -> P /\ Q data _\/_ (P Q : Set) : Set where \/-IL : P -> P \/ Q \/-IR : Q -> P \/ Q el...
{-# OPTIONS --cubical --no-import-sorts --safe #-} module Cubical.Classes where open import Cubical.Core.Everything ------------------------------------------------------------------------ -- Conversion typeclasses -- | A typeclass to coerce values of A to some other type. The coercion used is -- | only dependent ...
{-# OPTIONS --without-K --safe #-} module Categories.Category.Instance.LawvereTheories where -- Category of Lawvere Theories open import Level open import Categories.Category open import Categories.Functor.Cartesian.Properties open import Categories.NaturalTransformation.NaturalIsomorphism open import Categories.The...
{-# OPTIONS --cubical --safe #-} module Data.Bits.Order where open import Data.Bits open import Data.Bool open import Level infix 4 _≤ᴮ_ _<ᴮ_ _≤ᴮ_ _<ᴮ_ : Bits → Bits → Bool [] ≤ᴮ ys = true 0∷ xs ≤ᴮ [] = false 0∷ xs ≤ᴮ 0∷ ys = xs ≤ᴮ ys 0∷ xs ≤ᴮ 1∷ ys = true 1∷ xs ≤ᴮ [] = false 1∷ xs ≤ᴮ 0∷ ys = false 1∷ xs...
{-# OPTIONS --cubical --no-import-sorts --safe #-} module Cubical.Data.Empty.Properties where open import Cubical.Core.Everything open import Cubical.Foundations.Prelude open import Cubical.Foundations.Isomorphism open import Cubical.Data.Empty.Base isProp⊥ : isProp ⊥ isProp⊥ () isContr⊥→A : ∀ {ℓ} {A : Type ℓ} → i...
{-# OPTIONS --without-K #-} open import Base open import Homotopy.PullbackDef {- In this file we prove that if two diagrams are equivalent (there are equivalences between the types and the squares are commutative), then the natural map between the pullbacks is also an equivalence -} module Homotopy.PullbackInv...
module Formalization.FunctionML where import Lvl open import Numeral.Finite open import Numeral.Natural open import Type{Lvl.𝟎} data Value : ℕ → Type data Expression : ℕ → Type data Value where const : ∀{n} → ℕ → Value n var : ∀{n} → 𝕟(n) → Value n y-combinator : ∀{n} → Value n func : ∀{n} → Value(𝐒 ...
------------------------------------------------------------------------ -- The Agda standard library -- -- Containers core ------------------------------------------------------------------------ {-# OPTIONS --without-K --safe #-} module Data.Container.Core where open import Level open import Data.Product as Prod u...
------------------------------------------------------------------------ -- The Agda standard library -- -- A categorical view of N-ary products ------------------------------------------------------------------------ {-# OPTIONS --without-K --safe #-} module Data.Product.N-ary.Categorical where open import Agda.Bui...
{-# OPTIONS --without-K #-} open import Base open import Homotopy.Connected module Homotopy.Extensions.ProductPushoutToProductToConnected {i j} {A A′ B B′ : Set i} (f : A → A′) (g : B → B′) (P : A′ → B′ → Set j) {n₁ n₂} ⦃ P-is-trunc : ∀ a′ b′ → is-truncated (n₁ +2+ n₂) (P a′ b′) ⦄ (f-is-conn : has-connected-fib...
-- Basic intuitionistic modal logic S4, without ∨, ⊥, or ◇. -- Tarski-style semantics with contexts as concrete worlds, and glueing for □ only. -- Gentzen-style syntax. module BasicIS4.Semantics.TarskiGluedGentzen where open import BasicIS4.Syntax.Common public open import Common.Semantics public -- Intuitionistic ...
module Category where open import Prelude -------------------------------------------------------------------------------- record Category {ℓ ℓ′} (𝒪 : Set ℓ) (_▹_ : 𝒪 → 𝒪 → Set ℓ′) : Set (ℓ ⊔ ℓ′) where field idₓ : ∀ {x} → x ▹ x _⋄_ : ∀ {x y z} → y ▹ x → z ▹ y → z ▹...
------------------------------------------------------------------------ -- Utility methods ------------------------------------------------------------------------ -- Should be pushed to the standard library {-# OPTIONS --allow-exec #-} open import Algebra.Core using (Op₂) open import Level using (Level) open import...
{-# OPTIONS --without-K --safe --no-sized-types --no-guardedness --no-subtyping #-} module Agda.Builtin.Word.Properties where open import Agda.Builtin.Word open import Agda.Builtin.Equality primitive primWord64ToNatInjective : ∀ a b → primWord64ToNat a ≡ primWord64ToNat b → a ≡ b
{- This file contains: - Definition of set quotients -} {-# OPTIONS --cubical --no-import-sorts --safe #-} module Cubical.HITs.SetQuotients.Base where open import Cubical.Core.Primitives -- Set quotients as a higher inductive type: data _/_ {ℓ ℓ'} (A : Type ℓ) (R : A → A → Type ℓ') : Type (ℓ-max ℓ ℓ') where [_] ...
{-# OPTIONS --without-K --safe #-} open import Definition.Typed.EqualityRelation module Definition.LogicalRelation.Substitution {{eqrel : EqRelSet}} where open import Definition.Untyped hiding (_∷_) open import Definition.Typed open import Definition.LogicalRelation open import Tools.Nat open import Tools.Product o...
module Extra where open import Prelude fromTo : Nat -> List Nat fromTo n = f n where f : Nat -> List Nat f 0 = [] f (suc i) = n - i ∷ f i downFrom : Nat -> List Nat downFrom 0 = [] downFrom (suc n) = (suc n) ∷ downFrom n fromTo' : Nat -> List Nat fromTo' = f [] where f : List Nat -> Nat -> List...
open import Data.Product using ( ∃ ; _×_ ) open import FRP.LTL.RSet.Core using ( RSet ) open import FRP.LTL.Time using ( _≤_ ) module FRP.LTL.RSet.Future where ◇ : RSet → RSet ◇ A t = ∃ λ u → (t ≤ u) × A u
{-# OPTIONS --sized-types #-} module SList.Order.Properties {A : Set}(_≤_ : A → A → Set) where open import List.Sorted _≤_ open import Size open import SList open import SList.Order _≤_ lemma-slist-sorted : {ι : Size}{x : A}{xs : SList A {ι}} → x *≤ xs → Sorted (unsize A xs) → Sorted (unsize A (x ∙ xs)) lemma-slist-...
-- Andreas, 2016-06-17, issue #2018 reported by Nisse -- Shadowing a module parameter with a record parameter -- caused the record parameter to be renamed -- {-# OPTIONS -v tc.rec:20 #-} module _ {A : Set} where data D {A : Set} : Set where c : D record R {A : Set} : Set where constructor rc postulate B : S...
module Cats.Category.Constructions.CCC where open import Level open import Cats.Category.Base open import Cats.Category.Constructions.Exponential using (HasExponentials) open import Cats.Category.Constructions.Product using (HasFiniteProducts) record IsCCC {lo la l≈} (Cat : Category lo la l≈) : Set (lo ⊔ la ⊔...
module PLRTree.Heap.Correctness {A : Set}(_≤_ : A → A → Set) where open import BTree.Heap _≤_ open import PLRTree {A} open import PLRTree.Heap _≤_ renaming (Heap to Heap') lemma-heap'-heap : {t : PLRTree} → Heap' t → Heap (forget t) lemma-heap'-heap leaf = leaf lemma-heap'-heap (node {t} {x} (lf≤* .x) (lf≤* .x) _ _) ...
-- Andreas, 2018-10-16, runtime erasure -- -- Should not be able to extract erased constructor field. open import Agda.Builtin.Nat data Vec (A : Set) : Nat → Set where [] : Vec A zero _∷_ : {@0 n : Nat} (x : A) (xs : Vec A n) → Vec A (suc n) length : ∀{A} {@0 n} (x : Vec A n) → Nat length [] = zero length (_∷_ {...
{-# OPTIONS --without-K #-} open import HoTT open import cohomology.FunctionOver {- The cofiber space of [winl : X → X ∨ Y] is equivalent to [Y], - and the cofiber space of [winr : Y → X ∨ Y] is equivalent to [X]. -} module cohomology.WedgeCofiber where module WedgeCofiber {i} (X Y : Ptd i) where module CofWinl...
open import Relation.Binary.Core module PLRTree.Insert.Complete {A : Set} (_≤_ : A → A → Set) (tot≤ : Total _≤_) where open import Data.Empty open import Data.Sum renaming (_⊎_ to _∨_) open import PLRTree {A} open import PLRTree.Compound {A} open import PLRTree.Insert _≤_...
data Bool : Set where true false : Bool postulate and : Bool → Bool → Bool -- WAS: splitting on y removes the x@ as-pattern test : Bool → Bool → Bool test x@true y = {!y!} test x@false y = and x {!y!} -- x will go out of scope if we split on y -- Multiple as-patterns on the same pattern should be preserved in ...
{-# OPTIONS --without-K --exact-split --allow-unsolved-metas #-} module 12-univalence where import 11-function-extensionality open 11-function-extensionality public -- Section 10.1 Type extensionality equiv-eq : {i : Level} {A : UU i} {B : UU i} → Id A B → A ≃ B equiv-eq {A = A} refl = equiv-id A UNIVALENCE : {i :...
{-# OPTIONS --no-qualified-instances #-} module NoQualifiedInstances-Import where open import NoQualifiedInstances.Import.A as A postulate f : {{A.I}} → A.I test : A.I test = f
{- This file contains: - Elementary properties of homomorphisms - H-level results for the properties of morphisms - Special homomorphisms and operations (id, composition, inversion) - Conversion functions between different notions of group morphisms -} {-# OPTIONS --safe #-} module Cubical.Algebra.Group.MorphismPrope...
----------------------------------------------------------------------- -- The Agda standard library -- -- Properties of the setoid sublist relation ------------------------------------------------------------------------ {-# OPTIONS --without-K --safe #-} open import Relation.Binary using (Setoid; _⇒_; _Preserves_⟶_...
module Fail.TupleTerm where open import Haskell.Prelude pair2trip : a → b × c → a × b × c pair2trip x xs = x ∷ xs {-# COMPILE AGDA2HS pair2trip #-}
open import Level using () renaming (_⊔_ to _⊔ˡ_) open import Relation.Binary.Morphism.Structures using (IsRelHomomorphism) open import Algebra.Bundles using (RawMonoid; RawGroup; RawRing) open import Algebra.Morphism.Structures using (IsMonoidHomomorphism; IsMonoidMonomorphism) module AKS.Algebra.Morphism.Structure...
-- Andreas, 2016-07-19 issue #382, duplicate of #278 -- report and test case by Nisse, 2011-01-30 module Issue382 {A : Set} where data _≡_ (x : A) : A → Set where refl : x ≡ x abstract id : A → A id x = y where y = x lemma : ∀ x → id x ≡ x lemma x = refl -- should succeed
-- Andreas, 2015-09-12, issue reported by F Mazzoli -- {-# OPTIONS -v tc.meta.assign.proj:85 #-} open import Common.Product open import Common.Equality module _ (A : Set) where mutual X : A × A → A X = _ test : (x y : A × A) → X (proj₁ x , proj₁ y) ≡ proj₁ x test x y = refl -- In order to solve X, record v...
import Lvl open import Type module FormalLanguage.RegularExpression {ℓ} (Σ : Type{ℓ}) where open import Data.Boolean open import Data.Boolean.Stmt.Proofs open import Data.List as List using (List) open import FormalLanguage open import FormalLanguage.Proofs open import Functional open import Logic open import Lo...
-- Currently primitive functions are not allowed in mutual blocks. -- This might change. module PrimitiveInMutual where postulate String : Set {-# BUILTIN STRING String #-} mutual primitive primStringAppend : String -> String -> String _++_ : String -> String -> String x ++ y = primStringAppend x y
------------------------------------------------------------------------ -- The Agda standard library -- -- Basic definitions for morphisms between algebraic structures ------------------------------------------------------------------------ {-# OPTIONS --without-K --safe #-} open import Relation.Binary.Core module ...
module 842Isomorphism where -- Library import Relation.Binary.PropositionalEquality as Eq open Eq using (_≡_; refl; cong; cong-app; sym) -- added last open Eq.≡-Reasoning open import Data.Nat using (ℕ; zero; suc; _+_) open import Data.Nat.Properties using (+-comm; +-suc; +-identityʳ) -- added last -- Function compos...
module Pi.AuxLemmas where open import Data.Empty open import Data.Unit open import Data.Sum open import Data.Product open import Relation.Binary.PropositionalEquality open import Pi.Syntax open import Pi.Opsem Lemma₁ : ∀ {A B C D v v' κ κ'} {c : A ↔ B} {c' : C ↔ D} → ⟨ c ∣ v ∣ κ ⟩ ↦ [ c' ∣ v' ∣ κ' ] ...
{-# OPTIONS --sized-types #-} module SBList {A : Set}(_≤_ : A → A → Set) where open import Bound.Total A open import Bound.Total.Order _≤_ open import Data.List open import Data.Product open import Size data SBList : {ι : Size} → Bound → Bound → Set where nil : {ι : Size}{b t : Bound} → LeB b t...
module EqProof { A : Set } ( _==_ : A -> A -> Set ) (refl : {x : A} -> x == x) (trans : {x y z : A} -> x == y -> y == z -> x == z) where infix 2 eqProof>_ infixl 2 _===_ infix 3 _by_ eqProof>_ : (x : A) -> x == x eqProof> x = refl _===_ : {x y z : A} -> x == y -> y == z -> x == z xy === yz ...
{-# OPTIONS --without-K --rewriting #-} open import HoTT open import cohomology.Theory open import homotopy.DisjointlyPointedSet module cohomology.DisjointlyPointedSet {i} (OT : OrdinaryTheory i) where open OrdinaryTheory OT module _ (n : ℤ) (X : Ptd i) (X-is-set : is-set (de⊙ X)) (dec : is-separable X) ...
-- Data: init commit --{-# OPTIONS --show-implicit #-} --{-# OPTIONS --rewriting #-} module Oscar.Data0 where data ⟦⟧ : Set where ∅ : ⟦⟧ ! : ⟦⟧ → ⟦⟧ data ⟦_⟧ {a} (A : Set a) : Set a where ∅ : ⟦ A ⟧ _∷_ : A → ⟦ A ⟧ → ⟦ A ⟧ data ⟦⟧[_] : ⟦⟧ → Set where ∅ : ∀ {n} → ⟦⟧[ ! n ] ! : ∀ {n} → ⟦⟧[ n ] → ⟦⟧[ ! n ] ...
{-# OPTIONS --universe-polymorphism #-} module Issue464 where open import Common.Level data _×_ {a b}(A : Set a)(B : Set b) : Set (a ⊔ b) where _,_ : A → B → A × B data ⊥ : Set where record ⊤ : Set where ----------------------------------- data nonSP : Set1 where ι : nonSP δ : (A : Set) -> nonSP -> nonSP ⟦...
module PropositionalFormula where open import HasNegation open import IsPropositionalFormula open import Formula open import HasNeitherNor record PropositionalFormula : Set where constructor ⟨_⟩ field {formula} : Formula isPropositionalFormula : IsPropositionalFormula formula open PropositionalFormula ...
------------------------------------------------------------------------ -- List equality ------------------------------------------------------------------------ module Data.List.Equality where open import Data.List open import Relation.Nullary open import Relation.Binary module Equality (S : Setoid) where open ...
open import Everything module Test.ProblemWithDerivation where postulate A : Set B : Set _~A~_ : A → A → Set _~B~_ : B → B → Set s1 : A → B f1 : ∀ {x y} → x ~A~ y → s1 x ~B~ s1 y module _ {𝔭} (𝔓 : Ø 𝔭) where open Substitunction 𝔓 test-before : ∀ {m n ℓ} {f : Substitunction m n} (P : LeftExtens...
module Examples where open import Data.List hiding (reverse) open import Data.List.All open import Data.Nat open import Typing open import Syntax ex1 : Expr [] TUnit ex1 = letbind [] (new [] (delay send!)) (letpair (left []) (here []) (letbind (rght (left [])) (fork (wait (here []))) (close (there...
------------------------------------------------------------------------ -- The Agda standard library -- -- Pointwise products of binary relations ------------------------------------------------------------------------ {-# OPTIONS --without-K --safe #-} module Data.Product.Relation.Binary.Pointwise.NonDependent wher...
-- Andreas, 2013-10-25 issue reported by Jesper Cockx -- simplified test case by Nisse -- {-# OPTIONS -v tc.meta:30 #-} module Issue920 where import Common.Level postulate Eq : (A : Set) (x : A) → A → Set cast : (A B : Set) → A → B magic : (P : Set → Set) (A : Set) → P A bad : (A : Set) (x : A) → Eq A (c...
-- Andreas, 2015-12-29 record ⊤ : Set where data P : ⊤ → Set where c : P record{} d : P record{} test : (x : ⊤) (p : P x) → Set test _ c with Set test _ d | z = ⊤ -- Expected error: with-clause pattern mismatch. -- The error should be printed nicely, like: -- -- With clause pattern d is not an instance of its p...
{-# OPTIONS --without-K --safe #-} -- A Category enriched over Setoids is... a Category! module Categories.Enriched.Over.Setoids where open import Level open import Data.Product using (uncurry; proj₁; proj₂; Σ; _,_) open import Data.Unit using (tt) open import Function.Equality using (_⟨$⟩_; cong) open import Relatio...
{-# OPTIONS --rewriting --confluence-check #-} open import Agda.Builtin.Bool open import Agda.Builtin.Nat open import Agda.Builtin.Equality {-# BUILTIN REWRITE _≡_ #-} data D : Set₁ where c : Set → D unD : D → Set unD (c X) = X id : unD (c (Nat → Nat)) id x = x postulate rew : c (Nat → Nat) ≡ c (Nat → Bool) {-#...
module _ where module LocalSetoidCalc (Node : Set) where module _ (A : Node) where module _IsRelatedTo_ where module SGFunctorSetup (Obj₁ Obj₂ : Set) where open LocalSetoidCalc Obj₁ public renaming (module _IsRelatedTo_ to _IsRelatedTo₁_) open LocalSetoidCalc Obj₂ public renaming (module _IsRelatedTo_ to _...
------------------------------------------------------------------------------ -- Exclusive disjunction base ------------------------------------------------------------------------------ {-# OPTIONS --exact-split #-} {-# OPTIONS --no-sized-types #-} {-# OPTIONS --no-universe-polymorphism #-} {-...
-- Partly based on code due to Andrea Vezzosi. {-# OPTIONS --without-K --safe #-} open import Agda.Builtin.Bool data D : Set where run-time : Bool → D @0 compile-time : Bool → D l : @0 D → D l (run-time true) = run-time true l (run-time false) = run-time false l (compile-time x) = compile-time x
-- Product of two categories {-# OPTIONS --safe #-} module Cubical.Categories.Constructions.BinProduct where open import Cubical.Categories.Category.Base open import Cubical.Categories.Functor.Base open import Cubical.Data.Sigma renaming (_×_ to _×'_) open import Cubical.Foundations.HLevels open import Cubical.Founda...
-- Basic intuitionistic modal logic S4, without ∨, ⊥, or ◇. -- Gentzen-style formalisation of syntax with context pairs, after Pfenning-Davies. module BasicIS4.Syntax.DyadicGentzen where open import BasicIS4.Syntax.Common public -- Derivations. infix 3 _⊢_ data _⊢_ : Cx² Ty Ty → Ty → Set where var : ∀ {A Γ Δ} ...
-- 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...
-- This module introduces parameterised modules. module Introduction.Modules.Parameterised where -- First some familiar datatypes. data Bool : Set where false : Bool true : Bool data List (A : Set) : Set where nil : List A _::_ : A -> List A -> List A infixr 15 _::_ -- see 'Introduction.Operators' fo...
module MessageClosure where open import Data.Fin using (Fin; zero; suc; toℕ) open import Data.Nat open import Function open import Types.IND1 as IND import Types.Tail1 as Tail private variable m n : ℕ -- message closure guarantees that the type of each message in a session type is closed upS : SType m → STyp...
module main where import string-format -- for parser for Cedille open import cedille-types -- for parser for options files import options-types import cedille-options -- for parser for Cedille comments & whitespace import cws-types import io open import constants open import general-util open import json record c...
------------------------------------------------------------------------------ -- The inductive PA universe ------------------------------------------------------------------------------ {-# OPTIONS --exact-split #-} {-# OPTIONS --no-sized-types #-} {-# OPTIONS --no-universe-polymorphism #-} {-#...
------------------------------------------------------------------------ -- The Agda standard library -- -- Commutative semirings with some additional structure ("almost" -- commutative rings), used by the ring solver ------------------------------------------------------------------------ {-# OPTIONS --without-K --sa...
data Nat : Set where zero : Nat suc : Nat → Nat {-# BUILTIN NATURAL Nat #-} data _≡_ {A : Set} (x : A) : A → Set where refl : x ≡ x {-# NON_TERMINATING #-} loop : Nat → Nat loop n = loop n thm : ∀ n → loop n ≡ 42 thm n = refl
module ParseTreeOperations where open import ParseTree open import Data.List.NonEmpty open import Data.Bool open import Data.List hiding ([_]) open import Data.Nat open import Relation.Nullary open import Data.String -- go from ((f a) b) representation to f [a, b] expressionToList : Expr -> List⁺ Expr expressionToList...
{-# OPTIONS --without-K #-} open import HoTT open import cw.CW open import homotopy.PinSn module cw.Degree {i} {n : ℕ} (skel : Skeleton {i} (S (S n))) (skel-has-dec-cells : has-dec-cells skel) (skel-is-aligned : is-aligned skel) -- the cells at the upper and lower dimensions (upper : cells-last skel) (low...
{-# OPTIONS --without-K --allow-unsolved-metas --exact-split #-} module 22-descent where import 21-cubical-diagrams open 21-cubical-diagrams public -- Section 18.1 Five equivalent characterizations of pushouts dep-cocone : { l1 l2 l3 l4 l5 : Level} {S : UU l1} {A : UU l2} {B : UU l3} {X : UU l4} ( f : S → A) (g...
open import Agda.Builtin.Nat open import Agda.Builtin.Sigma record Monad (M : Set → Set) : Set₁ where field return : {A : Set} → A → M A _>>=_ : {A B : Set} → M A → (A → M B) → M B open Monad ⦃ … ⦄ postulate F G : Set → Set instance postulate G-monad : Monad G F-monad : Monad F f : Σ Nat (...
{-# OPTIONS --without-K #-} module Model.Nat where open import Model.Size as MS using ( Size ; Sizes ; _≤_ ; _<_ ; ≤-IsProp ; nat ) open import Model.Type.Core open import Util.HoTT.HLevel open import Util.Prelude open import Util.Relation.Binary.PropositionalEquality using (Σ-≡⁺) import Data.Nat.Properties as ℕ o...
open import Data.Nat using (ℕ; zero; suc; _+_) open import Relation.Binary.PropositionalEquality open ≡-Reasoning open import Data.Nat.Properties using (+-assoc; +-comm) module Exercises.One where _*_ : ℕ → ℕ → ℕ zero * y = zero suc x * y = y + (x * y) -- Prove that multiplication is commutative *-idʳ : ∀ x → x * 0...
{-# OPTIONS --cubical --safe #-} open import Prelude open import Categories module Categories.Pullback {ℓ₁ ℓ₂} (C : Category ℓ₁ ℓ₂) where open Category C record Pullback (f : X ⟶ Z) (g : Y ⟶ Z) : Type (ℓ₁ ℓ⊔ ℓ₂) where field {P} : Ob p₁ : P ⟶ X p₂ : P ⟶ Y commute : f · p₁ ≡ g · p₂ ump : ∀ {A : ...
{-# OPTIONS --safe #-} module Cubical.Algebra.CommRing.Instances.Pointwise where open import Cubical.Foundations.Prelude open import Cubical.Foundations.HLevels open import Cubical.Algebra.CommRing.Base private variable ℓ : Level pointwiseRing : (X : Type ℓ) (R : CommRing ℓ) → CommRing ℓ pointwiseRing X R = (...