text
stringlengths
4
690k
-- Andreas, 2018-03-12 -- The fix for #2963 introduced a change in the quotation behavior -- of method definitions inside a record. open import Agda.Builtin.Float open import Agda.Builtin.Reflection open import Agda.Builtin.List open import Agda.Builtin.Unit open import Agda.Builtin.Equality open import Agda.Builtin.S...
module Issue586 where {-# NO_TERMINATION_CHECK #-} Foo : Set Foo = Foo
{-# OPTIONS --without-K --safe #-} module Categories.NaturalTransformation.Dinatural where open import Level open import Data.Product open import Relation.Binary using (Rel; IsEquivalence; Setoid) open import Categories.Category open import Categories.NaturalTransformation as NT hiding (_∘ʳ_) open import Categories.F...
open import Spire.Type module Spire.Hybrid where ---------------------------------------------------------------------- data Context : Set₁ Environment : Context → Set ScopedType : Context → Set₁ ScopedType Γ = Environment Γ → Set data Context where ∅ : Context _,_ : (Γ : Context) (A : ScopedType Γ) → Context ...
------------------------------------------------------------------------ -- An example ------------------------------------------------------------------------ module Mixfix.Cyclic.Example where open import Codata.Musical.Notation open import Data.Vec using ([]; _∷_; [_]) open import Data.List as List using (List; ...
module Prelude where infixr 90 _∘_ infixr 50 _∧_ infix 20 _⟸⇒_ infixl 3 _from_ _from_ : (A : Set) -> A -> A A from a = a _∘_ : {A B C : Set} -> (A -> B) -> (C -> A) -> C -> B (f ∘ g) x = f (g x) record _∧_ (A B : Set) : Set where field p₁ : A p₂ : B open _∧_ public renaming (p₁ to fst; p₂ to snd) _,_...
-- Andreas, 2020-02-18, issue #4450 raised by Nisse -- -- ETA pragma should be considered unsafe, since type-checking may loop. {-# OPTIONS --safe --guardedness #-} open import Agda.Builtin.Equality record R : Set where coinductive field force : R open R {-# ETA R #-} foo : R foo .force .force = foo -- test ...
open import Relation.Binary.Core module PLRTree.Order {A : Set} where open import Data.Nat open import Data.Sum open import PLRTree {A} open import Relation.Binary open DecTotalOrder decTotalOrder hiding (refl) height : PLRTree → ℕ height leaf = zero height (node t x l r) with total (height l) (height r) ... |...
{-# OPTIONS --without-K #-} module well-typed-quoted-syntax where open import common open import well-typed-syntax open import well-typed-syntax-helpers public open import well-typed-quoted-syntax-defs public open import well-typed-syntax-context-helpers public open import well-typed-syntax-eq-dec public infixr 2 _‘‘∘...
open import Relation.Binary using (Preorder) open import Relation.Binary.PropositionalEquality open import Relation.Unary module Category.Monad.Monotone.Reader {ℓ}(pre : Preorder ℓ ℓ ℓ) where open Preorder pre renaming (Carrier to I; _∼_ to _≤_; refl to ≤-refl) open import Relation.Unary.Monotone pre open import Rel...
open import Nat open import Prelude open import List open import core open import judgemental-erase open import checks open import moveerase module aasubsume-min where -- this predicate on derivations of actions bans the cases that induce -- non-determinism. mutual aasubmin-synth : ∀{Γ e t α e' t'} → (Γ ⊢ e ...
module Basic.Compiler.Test where open import Basic.AST open import Basic.Compiler.Code open import Basic.Compiler.Machine open import Basic.BigStep open import Data.Fin open import Data.Nat open import Data.Vec open import Data.Product open import Data.Bool open import Data.List open Basic.BigStep.Fac {- Just a sa...
module List.Permutation.Base.Preorder (A : Set) where open import List.Permutation.Base A open import List.Permutation.Base.Equivalence A open import Data.List open import Relation.Binary open import Relation.Binary.PropositionalEquality hiding ([_]) ∼-preorder : Preorder _ _ _ ∼-preorder = record { ...
-- div shouldn't termination check, but it also shouldn't make the termination -- checker loop. module Issue503 where data Bool : Set where true : Bool false : Bool if_then_else_ : {C : Set} -> Bool -> C -> C -> C if true then a else b = a if false then a else b = b data Nat : Set where zero : Nat succ : Nat...
module rewriting where open import lib open import cedille-types open import conversion open import ctxt open import general-util open import is-free open import lift open import rename open import subst open import syntax-util private mk-phi : var → (eq t t' : term) → term mk-phi x eq t t' = Phi posinfo-...
{-# OPTIONS --cubical --safe --postfix-projections #-} module Lens.Pair where open import Prelude open import Lens.Definition ⦅fst⦆ : Lens (A × B) A ⦅fst⦆ .fst (x , y) = lens-part x (_, y) ⦅fst⦆ .snd .get-set s v i = v ⦅fst⦆ .snd .set-get s i = s ⦅fst⦆ .snd .set-set s v₁ v₂ i = v₂ , s .snd ⦅snd⦆ : Lens (A × B) B ⦅s...
{-# OPTIONS --without-K --safe #-} module Categories.Category.Instance.Rels where open import Data.Product open import Function hiding (_⇔_) open import Level open import Relation.Binary open import Relation.Binary.Construct.Composition open import Relation.Binary.PropositionalEquality open import Categories.Category...
open import Data.Nat using (ℕ; zero; suc) open import Data.Bool using (Bool; true; false) data even : ℕ → Set data odd : ℕ → Set data even where zero : even zero suc : ∀ {n : ℕ} → odd n → even (suc n) data odd where suc : ∀ {n : ℕ} → even n → odd (suc n) mutual data even′ : ℕ → Set where zero : even′ zer...
{-# OPTIONS --without-K --exact-split #-} module 03-natural-numbers where import 02-pi open 02-pi public -- Section 3.1 The formal specification of the type of natural numbers data ℕ : UU lzero where zero-ℕ : ℕ succ-ℕ : ℕ → ℕ {- We define the numbers one-ℕ to ten-ℕ -} one-ℕ : ℕ one-ℕ = succ-ℕ zero-ℕ two-ℕ : ...
module Basic.Axiomatic.Total where open import Data.Bool hiding (not; if_then_else_; _∧_) open import Data.Vec hiding ([_]; _++_; split) open import Function open import Relation.Binary.PropositionalEquality open import Data.Product renaming (map to prodMap) open import Data.Nat open import Relation.Nullary open imp...
{-# OPTIONS --without-K --safe #-} module Categories.Functor.Construction.Limit where open import Function using (_$_) open import Categories.Adjoint open import Categories.Adjoint.Equivalence open import Categories.Adjoint.Properties open import Categories.Category open import Categories.Category.Equivalence open i...
------------------------------------------------------------------------ -- Strong bisimilarity for partially defined values, along with a -- proof showing that this relation is pointwise isomorphic to path -- equality ------------------------------------------------------------------------ {-# OPTIONS --cubical --siz...
{-# OPTIONS --without-K --rewriting #-} open import HoTT open import homotopy.FunctionOver open import groups.ProductRepr open import cohomology.Theory open import cohomology.WedgeCofiber {- For the cohomology group of a suspension ΣX, the group inverse has the - explicit form Cⁿ(flip-susp) : Cⁿ(ΣX) → Cⁿ(ΣX). -} m...
{-# OPTIONS --safe --warning=error #-} open import Setoids.Setoids open import Groups.SymmetricGroups.Definition open import Groups.FreeGroup.Definition open import Decidable.Sets open import Numbers.Naturals.Semiring open import Numbers.Naturals.Order open import LogicalFormulae open import Boolean.Definition module...
{-# OPTIONS --allow-unsolved-metas #-} {- Diamond operator. -} module TemporalOps.Diamond where open import CategoryTheory.Categories open import CategoryTheory.Instances.Reactive open import CategoryTheory.Functor open import CategoryTheory.NatTrans open import CategoryTheory.Monad open import TemporalOps.Common open...
module Ex1Sol where ---------------------------------------------------------------------------- -- EXERCISE 1 -- NUMBERS, LISTS, VECTORS (a driving lesson) -- -- VALUE: 15% -- DEADLINE: 5pm, Friday 2 October (week 2) -- -- DON'T SUBMIT, COMMIT! Create your own private version of the CS410 repo, -- hosted somewhe...
{-# OPTIONS --without-K --exact-split --safe #-} module Homotopy_Equivalence where open import Basic_Types open import Identity -- ------------------------------------ -- In homotopy type theory, a homotopy is just a point-wise equality (path) -- between to (dependent) functions f and g infix 2 _~_ _~_ : ∀ {A : Se...
open import Numeral.Natural open import Relator.Equals open import Type.Properties.Decidable open import Type module Formalization.ClassicalPredicateLogic.Semantics {ℓₘ ℓₚ ℓᵥ ℓₒ} (Prop : ℕ → Type{ℓₚ}) (Var : Type{ℓᵥ}) ⦃ var-eq-dec : Decidable(2)(_≡_ {T = Var}) ⦄ (Obj : ℕ → Type{ℓₒ}) where import Lvl op...
------------------------------------------------------------------------ -- The Agda standard library -- -- Some examples of how to use non-trivial induction over the natural -- numbers. ------------------------------------------------------------------------ module README.Data.Nat.Induction where open import Data.Na...
{-# OPTIONS --without-K #-} module LeftCancellation where open import Data.Empty open import Data.Unit open import Data.Sum open import Data.Product using (_,_; _,′_; proj₁; proj₂) open import Function renaming (_∘_ to _○_) -- explicit 'using', to show how little of HoTT is needed open import SimpleHoTT using (refl; ...
{- Basic theory about transport: - transport is invertible - transport is an equivalence ([pathToEquiv]) -} {-# OPTIONS --safe #-} module Cubical.Foundations.Transport where open import Cubical.Foundations.Prelude open import Cubical.Foundations.Equiv open import Cubical.Foundations.Isomorphism open import Cubical.F...
{-# OPTIONS --without-K --safe #-} module Cats.Category.Constructions.Terminal where open import Data.Product using (proj₁ ; proj₂) open import Level open import Cats.Category.Base import Cats.Category.Constructions.Iso as Iso import Cats.Category.Constructions.Unique as Unique module Build {lo la l≈} (Cat : Categ...
-- 2012-10-20 Andreas module Issue721c where data Bool : Set where false true : Bool record Foo (b : Bool) : Set where field _*_ : Bool → Bool → Bool data _≡_ {A : Set} (x : A) : A → Set where refl : x ≡ x record ∃ {A : Set} (B : A → Set) : Set where constructor pack field fst : A snd : B fst ...
{-# OPTIONS --no-termination-check #-} module Lambda where module Prelude where data Bool : Set where true : Bool false : Bool if_then_else_ : {A : Set} -> Bool -> A -> A -> A if true then x else y = x if false then x else y = y _∧_ : Bool -> Bool -> Bool true ∧ y = y false ∧ y = false ...
{-# OPTIONS --without-K --safe #-} module Categories.Functor.Construction.LiftSetoids where open import Level open import Relation.Binary open import Function.Equality open import Function using (_$_) renaming (id to idf) open import Categories.Category open import Categories.Category.Instance.Setoids open import Ca...
{-# OPTIONS --cubical #-} module Type.Cubical.SubtypeSet where open import Function.Axioms open import Functional open import Logic.Predicate as PTLogic using () renaming ([∃]-intro to intro) import Lvl open import Structure.Function.Domain using (intro ; Inverseₗ ; Inverseᵣ) open import Structure.Relator.Proper...
module _ where open import Haskell.Prelude open import Agda.Builtin.Equality -- ** Foreign HS code -- language extensions {-# FOREIGN AGDA2HS {-# LANGUAGE LambdaCase #-} {-# LANGUAGE FlexibleInstances #-} #-} -- imports {-# FOREIGN AGDA2HS import Data.Monoid #-} -- ** Datatypes & functions data Exp (v : Set) : Se...
{- Conatural number properties (Tesla Ice Zhang et al., Feb. 2019) This file defines operations and properties on conatural numbers: - Infinity (∞). - Proof that ∞ + 1 is equivalent to ∞. - Proof that conatural is an hSet. - Bisimulation on conatural - Proof that bisimulation is equivalent to equivalence (Coinduc...
module Generic.Test.DeriveEq where open import Generic.Main open import Data.Vec using (Vec) renaming ([] to []ᵥ; _∷_ to _∷ᵥ_) module DeriveEqStar where open import Relation.Binary open import Relation.Binary.Construct.Closure.ReflexiveTransitive instance StarEq : ∀ {i t} {I : Set i} {T : Rel I t} {i j} ...
------------------------------------------------------------------------ -- The Agda standard library -- -- Convenient syntax for "equational reasoning" in multiple Setoids. ------------------------------------------------------------------------ -- Example use: -- -- open import Data.Maybe.Properties -- open impo...
{- Byzantine Fault Tolerant Consensus Verification in Agda, version 0.9. Copyright (c) 2020 Oracle and/or its affiliates. Licensed under the Universal Permissive License v 1.0 as shown at https://opensource.oracle.com/licenses/upl -} open import Function open import Data.Unit open import Data.List as List open i...
{- This second-order signature was created from the following second-order syntax description: syntax CommRing | CR type * : 0-ary term zero : * | 𝟘 add : * * -> * | _⊕_ l20 one : * | 𝟙 mult : * * -> * | _⊗_ l30 neg : * -> * | ⊖_ r50 theory (𝟘U⊕ᴸ) a |> add (zero, a) = a (𝟘U⊕ᴿ) a |> ...
module examplesPaperJFP.Console where open import examplesPaperJFP.NativeIOSafe open import examplesPaperJFP.BasicIO hiding (main) open import examplesPaperJFP.ConsoleInterface public IOConsole : Set → Set IOConsole = IO ConsoleInterface --IOConsole+ : Set → Set --IOConsole+ = IO+ ConsoleInterface translateIOCon...
open import Signature import Program -- | Herbrand model that takes the distinction between inductive -- and coinductive clauses into account. module Herbrand (Σ : Sig) (V : Set) (P : Program.Program Σ V) where open import Function open import Data.Empty open import Data.Product as Prod renaming (Σ to ⨿) open import ...
{-# OPTIONS --cubical --safe #-} module Cubical.Data.Bool.Base where open import Cubical.Core.Everything open import Cubical.Foundations.Prelude open import Cubical.Data.Empty open import Cubical.Relation.Nullary open import Cubical.Relation.Nullary.DecidableEq -- Obtain the booleans open import Agda.Builtin.Bool ...
{-# OPTIONS --safe #-} module Cubical.Algebra.CommRing.QuotientRing where open import Cubical.Foundations.Prelude open import Cubical.HITs.SetQuotients hiding (_/_) open import Cubical.Algebra.CommRing open import Cubical.Algebra.CommRing.Ideal open import Cubical.Algebra.Ring open import Cubical.Algebra.Ring.Quotie...
{-# OPTIONS --rewriting #-} module RingSolving where open import Data.Nat hiding (_≟_) open import Data.Nat.Properties hiding (_≟_) import Relation.Binary.PropositionalEquality open Relation.Binary.PropositionalEquality open import Agda.Builtin.Equality.Rewrite open import Function import Relation.Binary.Propositiona...
import Lvl open import Data.Boolean open import Type module Data.List.Sorting.Functions {ℓ} {T : Type{ℓ}} (_≤?_ : T → T → Bool) where open import Data.List import Data.List.Functions as List -- Inserts an element to a sorted list so that the resulting list is still sorted. insert : T → List(T) → List(T) in...
{-# OPTIONS --without-K #-} module Types where -- Universe levels postulate -- Universe levels Level : Set zero : Level suc : Level → Level max : Level → Level → Level {-# BUILTIN LEVEL Level #-} {-# BUILTIN LEVELZERO zero #-} {-# BUILTIN LEVELSUC suc #-} {-# BUILTIN LEVELMAX max #-} -- Empty type data ⊥...
------------------------------------------------------------------------------ -- Auxiliary properties of the McCarthy 91 function ------------------------------------------------------------------------------ {-# OPTIONS --exact-split #-} {-# OPTIONS --no-sized-types #-} {-# OPTIONS --no-univer...
{-# OPTIONS --allow-unsolved-metas #-} module ExtractFunction where open import Agda.Builtin.Nat open import Agda.Builtin.Bool plus : Nat -> Nat -> Nat plus = {! !} function1 : (x : Nat) -> (y : Nat) -> Nat function1 x y = plus x y pickTheFirst : Nat -> Bool -> Nat pickTheFirst x y = x function2 : Nat -> Bool ...
{-# OPTIONS --without-K #-} open import Base open import Algebra.Groups open import Integers open import Homotopy.Truncation open import Homotopy.Pointed open import Homotopy.PathTruncation open import Homotopy.Connected -- Definitions and properties of homotopy groups module Homotopy.HomotopyGroups {i} where -- Loo...
{-# OPTIONS -W ignore #-} module Issue2596b where -- This warning will be ignored {-# REWRITE #-} -- but this error will still be raised f : Set f = f
{-# OPTIONS --without-K #-} module hott.level.sets.core where open import sum open import equality.core open import sets.unit open import sets.empty open import hott.level.core ⊤-contr : ∀ {i} → contr (⊤ {i}) ⊤-contr = tt , λ { tt → refl } ⊥-prop : ∀ {i} → h 1 (⊥ {i}) ⊥-prop x _ = ⊥-elim x
{-# OPTIONS --without-K #-} module equality.core where open import sum open import level using () open import function.core infix 4 _≡_ data _≡_ {a} {A : Set a} (x : A) : A → Set a where refl : x ≡ x sym : ∀ {i} {A : Set i} {x y : A} → x ≡ y → y ≡ x sym refl = refl _·_ : ∀ {i}{X : Set i}{x y z : X} → x ≡...
-- The ATP pragma with the role <hint> can be used with functions. module ATPHint where postulate D : Set data _≡_ (x : D) : D → Set where refl : x ≡ x sym : ∀ {m n} → m ≡ n → n ≡ m sym refl = refl {-# ATP hint sym #-}
{-# OPTIONS --cubical-compatible #-} open import Agda.Builtin.Bool data D : Bool → Set where true : D true false : D false F : @0 D false → Set₁ F false = Set
------------------------------------------------------------------------ -- Abstract well-formed typing contexts ------------------------------------------------------------------------ {-# OPTIONS --safe --without-K #-} module Data.Context.WellFormed where open import Level using (suc; _⊔_; Lift; lift) open import ...
{-# OPTIONS --without-K --safe #-} module Definition.Typed.Properties where open import Definition.Untyped open import Definition.Typed open import Tools.Empty using (⊥; ⊥-elim) open import Tools.Product import Tools.PropositionalEquality as PE -- Escape context extraction wfTerm : ∀ {Γ A t} → Γ ⊢ t ∷ A → ⊢ Γ wfT...
{-# OPTIONS --without-K --exact-split --safe #-} open import Fragment.Algebra.Signature open import Relation.Binary using (Setoid) module Fragment.Algebra.Free.Syntax {a ℓ} (Σ : Signature) (A : Setoid a ℓ) where open import Fragment.Algebra.Algebra Σ open import Fragment.Algebra.Free.Base Σ open import Data.F...
-- Transport properties {-# OPTIONS --without-K --safe --exact-split #-} module Constructive.Axiom.Properties.Transport where -- agda-stdlib open import Level renaming (suc to lsuc; zero to lzero) open import Data.Sum as Sum open import Data.Product as Prod open import Relation.Binary.PropositionalEquality open impo...
open import Preliminaries module Idea where {- de Bruijn indices are representd as proofs that an element is in a list -} data _∈_ {A : Set} : (x : A) (l : List A) → Set where -- type \in i0 : {x : A} {xs : List A} → x ∈ x :: xs iS : {x y : A} {xs : List A} → x ∈ xs → x ∈ y :: xs {- types of the ...
{-# OPTIONS --safe #-} open import Definition.Typed.EqualityRelation module Definition.LogicalRelation.Substitution.Reducibility {{eqrel : EqRelSet}} where open EqRelSet {{...}} open import Definition.Untyped open import Definition.Untyped.Properties open import Definition.Typed open import Definition.LogicalRelatio...
{- 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 LibraBFT.Impl.OBM.Logging.Logging open import LibraBFT.ImplShared...
module Sessions.Syntax.Expr where open import Prelude open import Sessions.Syntax.Types open import Relation.Ternary.Separation.Construct.List Type data Exp : Type → LCtx → Set where var : ∀[ Just a ⇒ Exp a ] -- value constructors unit : ε[ Exp unit ] letunit : ∀[ Exp unit ✴ Exp a ⇒ Exp a ] ...
{-# 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 open import Setoids.Subset module Setoids.Intersection.Lemmas {a b : _} {A : Set a} (S : Setoid {a} {b} A) {c d : ...
{-# OPTIONS --without-K --rewriting #-} open import lib.Basics open import lib.types.Sigma open import lib.types.Paths module lib.types.CommutingSquare where {- maps between two functions -} infix 0 _□$_ _□$_ = CommSquare.commutes CommSquare-∘v : ∀ {i₀ i₁ i₂ j₀ j₁ j₂} {A₀ : Type i₀} {A₁ : Type i₁} {A₂ : Type i₂}...
-- This is an example emphasizing the important of a linearity check -- in the positivity check. -- -- Currently it does not type check since there is no universe subtyping. module PositivityCheckNeedsLinearityCheck where data Eq (S : Set2) : Set2 -> Set where refl : Eq S S subst' : {S S' : Set2} -> Eq S S' -> S -...
{-# OPTIONS --erased-cubical --safe --no-sized-types --no-guardedness --no-subtyping #-} module Agda.Builtin.Cubical.HCompU where open import Agda.Primitive open import Agda.Builtin.Sigma open import Agda.Primitive.Cubical renaming (primINeg to ~_; primIMax to _∨_; primIMin to _∧_; ...
{-# OPTIONS --safe #-} module Invert where open import Relation.Binary.PropositionalEquality open import Data.Nat open import Data.Nat.Properties _∘_ : ∀ {A B C : Set} → (B → C) → (A → B) → (A → C) (g ∘ f) x = g (f x) pred₂ : ℕ → ℕ pred₂ = pred ∘ pred lemma : (a b : ℕ) → pred₂ (suc a + suc a) ≡ pred₂ (suc b + suc...
module _ where postulate D : Set module A where infixr 5 _∷_ postulate _∷_ : Set₁ → D → D module B where infix 5 _∷_ postulate _∷_ : Set₁ → Set₁ → D open A open B foo : D foo = Set ∷ Set -- Expected error: -- -- <preciseErrorLocation> -- Ambiguous name _∷_. It could refer to any one of -- A....
------------------------------------------------------------------------ -- The Agda standard library -- -- Tables, basic types and operations ------------------------------------------------------------------------ {-# OPTIONS --without-K --safe #-} module Data.Table.Base where open import Data.Nat open import Data...
{-# OPTIONS --without-K --safe #-} open import Categories.Category using () renaming (Category to Setoid-Category) open import Categories.Category.Monoidal module Categories.Enriched.NaturalTransformation {o ℓ e} {V : Setoid-Category o ℓ e} (M : Monoidal V) where open import Level open import Categories.Category....
-- This file tests that implicit record fields are not printed out (by -- default). -- Andreas, 2016-07-20 Repaired this long disfunctional test case. module ImplicitRecordFields where record R : Set₁ where field {A} : Set f : A → A {B C} D {E} : Set g : B → C → E postu...
module with-equalities where open import Agda.Builtin.List open import Common.Bool open import Common.Equality module _ {A : Set} where filter : (A → Bool) → List A → List A filter p [] = [] filter p (x ∷ xs) = if p x then x ∷ filter p xs else filter p xs filter-filter : ∀ p xs → filter p (filter...
module Algebra.LabelledGraph.Theorems where open import Algebra.LabelledGraph open import Algebra.LabelledGraph.Reasoning open import Algebra.Dioid open import Algebra.Graph using (Graph) import Algebra.Graph as Graph import Algebra.Graph.Reasoning as Graph import Algebra.Graph.Theorems as Graph import Algebra.Dioid.B...
------------------------------------------------------------------------------ -- Examples of translation of logical schemata ------------------------------------------------------------------------------ {-# OPTIONS --exact-split #-} {-# OPTIONS --no-sized-types #-} {-# OPTIONS --no-universe-po...
-------------------------------------------------------------------------------- -- This is part of Agda Inference Systems {-# OPTIONS --guardedness #-} open import Agda.Builtin.Equality open import Data.Product open import Level open import Relation.Unary using (_⊆_) module is-lib.InfSys.Coinduction {𝓁} where ...
{-# OPTIONS --without-K #-} import Level as L open L using (Lift; lift) open import Type hiding (★) open import Function.NP open import Algebra open import Algebra.FunctionProperties.NP open import Data.Nat.NP hiding (_^_) open import Data.Nat.Properties open import Data.One hiding (_≤_) open import Data.Sum open impor...
open import Coinduction hiding (unfold) renaming (♯_ to Thunk; ♭ to Force) module Brainfuck where ---------- A very basic Prelude ---------- record Pair (a b : Set) : Set where constructor _,_ field fst : a snd : b data Maybe (a : Set) : Set where Nothing : Maybe a Just : (x : a) -> Maybe a return...
------------------------------------------------------------------------ -- Various equality checkers (some complete, all sound) ------------------------------------------------------------------------ import Axiom.Extensionality.Propositional as E import Level open import Data.Universe -- The code makes use of the a...
{-# OPTIONS --cubical --no-import-sorts #-} module SetQuotientTest where open import Cubical.Foundations.Everything renaming (_⁻¹ to _⁻¹ᵖ; assoc to ∙-assoc) open import Cubical.Foundations.Logic renaming (inl to inlᵖ; inr to inrᵖ) open import Cubical.Data.Empty renaming (elim to ⊥-elim; ⊥ to ⊥⊥) open import Cubical.R...
open import Agda.Builtin.List open import Agda.Builtin.Reflection open import Agda.Builtin.Unit open import Agda.Builtin.Nat -- setup infixl 5 _>>=_ _>>=_ = bindTC defToTerm : Name → Definition → List (Arg Term) → Term defToTerm _ (function cs) as = pat-lam cs as defToTerm _ (data-cons d) as = con d as defToTerm _ ...
-------------------------------------------------------------------------------- -- This file contains the definition of a context-free grammar, as well as a -- parser for those grammars that are actually of LL1 type. There is currently -- no check if the grammar is actually a LL1 grammar, so the parser might loop -- i...
{-# OPTIONS --safe #-} module Cubical.Categories.Limits where open import Cubical.Categories.Limits.Base public open import Cubical.Categories.Limits.Initial public open import Cubical.Categories.Limits.Terminal public open import Cubical.Categories.Limits.Pullback public
------------------------------------------------------------------------ -- A terminating parser data type and the accompanying interpreter ------------------------------------------------------------------------ module RecursiveDescent.InductiveWithFix.Internal where open import Data.Bool open import Data.Product.Re...
{- 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 -} -- This module proves the two "VotesOnce" proof obligations for our fake...
module Prelude.Exit where open import Prelude.Char open import Prelude.IO open import Prelude.Unit postulate exit : Char → IO Unit {-# COMPILED_EPIC exit (n : Int, u : Unit) -> Unit = foreign Unit "exit" (n : Int) #-} exitSuccess : Char exitSuccess = '\NUL' exitFailure : Char exitFailure =...
-- Agda program using the Iowa Agda library open import bool module PROOF-evendoublecoin (Choice : Set) (choose : Choice → 𝔹) (lchoice : Choice → Choice) (rchoice : Choice → Choice) where open import eq open import nat open import list open import maybe ---------------------------------------------------...
-- Andreas, 2018-06-03, issue #3057 reported by nad. -- We should not allow the public import of an ambiguous identifier -- {-# OPTIONS -v scope:20 #-} module Issue3057 where module M where postulate A : Set a : A open M public renaming (a to A) -- Should fail
{- This file contains: - Definition of set truncations -} {-# OPTIONS --cubical --no-import-sorts --safe #-} module Cubical.HITs.SetTruncation.Base where open import Cubical.Core.Primitives -- set truncation as a higher inductive type: data ∥_∥₂ {ℓ} (A : Type ℓ) : Type ℓ where ∣_∣₂ : A → ∥ A ∥₂ squash₂ : ∀ (x...
------------------------------------------------------------------------ -- "Equational" reasoning combinator setup ------------------------------------------------------------------------ {-# OPTIONS --sized-types #-} open import Prelude open import Labelled-transition-system module Bisimilarity.Classical.Equation...
{-# OPTIONS -v 2 #-} module Leftovers.Examples where open import Leftovers.Utils open import Leftovers.Leftovers open import Leftovers.Equality open import Data.Bool open import Relation.Binary.PropositionalEquality open import Data.Nat open import Data.Product open import Data.Unit -- notNot : ∀ b → not (not...
-- This example comes from the discussion on Issue423. module SolveNeutralApplication where postulate A : Set a b : A T : A → Set mkT : ∀ a → T a phantom : A → A → A data Bool : Set where true false : Bool f : Bool → A → A f true x = phantom x a f false x = phantom x b -- Andreas, 2012-09-07: the origi...
open import Coinduction using ( ∞ ; ♯_ ; ♭ ) open import Data.Bool using ( Bool ; true ; false ; if_then_else_ ) open import Data.Empty using ( ⊥ ) open import Data.Maybe using ( Maybe ; just ; nothing ) open import Data.Sum using ( _⊎_ ; inj₁ ; inj₂ ) open import Data.Unit using ( ⊤ ; tt ) open import Data.Natural usi...
module Structure.Relator.Names where import Lvl open import Data.Tuple as Tuple using (_⨯_ ; _,_) open import Functional open import Lang.Instance open import Logic open import Logic.Propositional open import Logic.Propositional.Xor open import Numeral.Natural open import Type private variable ℓ ℓ₁ ℓ₂ ℓ₃ ℓ₄ : Lv...
open import Agda.Builtin.Unit open import Agda.Builtin.Bool open import Agda.Builtin.Nat open import Agda.Builtin.Equality open import Agda.Builtin.IO open import Agda.Builtin.String postulate putStr : String → IO ⊤ {-# FOREIGN GHC import qualified Data.Text.IO #-} {-# COMPILE GHC putStr = Data.Text.IO.putStr #-} ...
------------------------------------------------------------------------------ -- Elimination properties for the inequalities ------------------------------------------------------------------------------ {-# OPTIONS --exact-split #-} {-# OPTIONS --no-sized-types #-} {-# OPTIONS --no-universe-po...
data Bool : Set where true : Bool false : Bool not : Bool → Bool not true = false not false = true data ℕ : Set where O : ℕ S : ℕ → ℕ _+_ : ℕ → ℕ → ℕ O + a = a S a + b = S (a + b) _*_ : ℕ → ℕ → ℕ O * a = O S a * b = a + (a * b) _or_ : Bool → Bool → Bool true or _ = true false or b = b if_then_el...
{- formatted printing like printf, except type-safe (as proposed in "Cayenne -- a language with dependent types" by Augustsson). The types of the rest of the arguments are computed from the format string. -} module string-format where open import char open import eq open import list open import nat open im...