text
stringlengths
4
690k
------------------------------------------------------------------------ -- The lenses fst and snd ------------------------------------------------------------------------ -- This module uses univalence without tracking such uses in the types -- of functions, and it is not parametrised by a notion of equality, -- it u...
module Bughunting where data Nat : Set where zero : Nat suc : Nat -> Nat plus : Nat -> Nat -> Nat {-# BUILTIN NATURAL Nat #-} plus m n = {! !} data List2 (A : Set) : Nat -> Set where empty2 : List2 A 0 cons2 : {n : Nat} -> A -> List2 A n -> List2 A (plus 1 n)
{-# OPTIONS --without-K #-} open import Library open import Basic -------------------------------------------------------------------------------- -- Universes for a Functor -------------------------------------------------------------------------------- record FntrLevel : Set where field C : CatLevel D : C...
{-# OPTIONS --safe --cubical-compatible #-} module Erased-cubical.Without-K where data D : Set where c : D
{-# OPTIONS --without-K #-} open import lib.Basics open import lib.NConnected open import lib.types.Nat open import lib.types.TLevel open import lib.types.Empty open import lib.types.Group open import lib.types.Pi open import lib.types.Pointed open import lib.types.Paths open import lib.types.Sigma open import lib.typ...
{-# OPTIONS --safe #-} module Cubical.Data.Fin.Base where open import Cubical.Foundations.Prelude open import Cubical.Foundations.Function open import Cubical.Foundations.HLevels import Cubical.Data.Empty as ⊥ open import Cubical.Data.Nat using (ℕ ; zero ; suc ; _+_ ; znots) open import Cubical.Data.Nat.Order open i...
{-# OPTIONS --safe #-} module Cubical.Algebra.Monoid.Instances.Nat where open import Cubical.Foundations.Prelude open import Cubical.Data.Nat open import Cubical.Algebra.Monoid NatMonoid : Monoid ℓ-zero fst NatMonoid = ℕ MonoidStr.ε (snd NatMonoid) = 0 MonoidStr._·_ (snd NatMonoid) = _+_ MonoidStr.isMonoid (snd Na...
-- Andreas, 2016-12-03, issue 2307 -- preserve record (vs. constructor) in internal syntax open import Common.Equality postulate A : Set a : A record R : Set where constructor c field f : A open R postulate r : R g h : R → R fail1 : g (c a) ≡ h (record{ f = a }) fail1 = refl -- ERROR: g (c a) != h...
{-# OPTIONS --safe --warning=error --without-K #-} open import Agda.Primitive using (Level; lzero; lsuc; _⊔_) open import Functions.Definition open import Numbers.Naturals.Definition open import Sets.FinSet.Definition open import Setoids.Setoids module Setoids.Cardinality.Finite.Definition where record FiniteSetoid ...
{-# OPTIONS --without-K --safe #-} module Categories.Functor.Representable where -- A Presheaf (into Setoids) is representation if it is naturally isomorphic to a Hom functor -- over a particular object A of the base category. open import Level open import Categories.Category using (Category) open import Categories....
module _ where open import Agda.Primitive.Cubical hiding (PathP) postulate PathP : ∀ {ℓ} (A : I → Set ℓ) → A i0 → A i1 → Set ℓ {-# BUILTIN PATHP PathP #-}
module Numeral.Integer.Relation.Divisibility.Proofs where open import Functional open import Logic.Propositional import Numeral.Natural.Relation.Divisibility as ℕ import Numeral.Natural.Relation.Divisibility.Proofs as ℕ open import Numeral.Natural using (ℕ) import Numeral.Natural.Oper as ℕ open import N...
{-# OPTIONS --without-K --rewriting #-} open import lib.Basics open import lib.NType2 open import lib.types.Nat open import lib.types.Subtype module lib.types.Fin where Fin : ℕ → Type₀ Fin n = Σ ℕ (_< n) instance Fin-reader : ∀ {n} → FromNat (Fin n) FromNat.in-range (Fin-reader {n}) m = m < n FromNat.read (Fi...
module Logic.Names where open import Functional import Lvl open import Logic open import Logic.Predicate open import Logic.Propositional module _ {ℓ} where ExcludedMiddleOn : Stmt{ℓ} → Stmt ExcludedMiddleOn(X) = (X ∨ (¬ X)) ExcludedMiddle = ∀ₗ(ExcludedMiddleOn) WeakExcludedMiddleOn = ExcludedMiddleOn ∘ ...
module Web.URI.Everything where import Web.URI import Web.URI.Examples.HelloWorld import Web.URI.Primitive import Web.URI.Port import Web.URI.Port.Primitive import Web.URI.Scheme import Web.URI.Scheme.Primitive
------------------------------------------------------------------------------ -- Example of a partial function ------------------------------------------------------------------------------ {-# OPTIONS --exact-split #-} {-# OPTIONS --no-sized-types #-} {-# OPTIONS --no-universe-polymorphism #-}...
module Integer10 where open import Relation.Binary.PropositionalEquality as PropEq using (_≡_; refl) -- 整数の素朴な定義 --(succ (succ (pred zero))などが有効、という弱点がある) data ℤ : Set where zero : ℤ succ : ℤ → ℤ pred : ℤ → ℤ -- 加法 _+_ : ℤ → ℤ → ℤ zero + y = y succ x + zero = succ x succ x + succ y = succ (su...
------------------------------------------------------------------------ -- The Agda standard library -- -- Some examples showing how the Function.Reasoning module -- can be used to perform "functional reasoning" similar to what is being -- described in: https://stackoverflow.com/q/22676703/3168666 --------------------...
------------------------------------------------------------------------ -- Safe modules that use --without-K ------------------------------------------------------------------------ {-# OPTIONS --safe --without-K #-} module README.Safe.Without-K where -- Definitions of some basic types and some related functions. ...
-- An implementation of terminating parsers due to Conor McBride and -- James McKinna, as presented in the talk Seeing and Doing at the -- Workshop on Termination and Type Theory, Hindås, Sweden, 2002. {-# OPTIONS --type-in-type #-} module SeeingAndDoing where open import Data.Unit open import Data.Bool open import ...
module IrrelevantLambda where postulate A : Set P : A -> Set f : _ -> Set f = λ .x -> P x -- fails because irrelevant lambda may not introduce relevant function type
module NonLinearConstraint where import Common.Level open import Common.Equality test : let X : Set -> Set -> Set X = _ in (A : Set) -> X A A ≡ A test A = refl -- should not be solved, solution not uniquely determined
{-# OPTIONS --universe-polymorphism #-} open import Categories.Category module Categories.Object.BinaryProducts {o ℓ e} (C : Category o ℓ e) where open Category C open Equiv open import Level import Categories.Object.Product as Product import Categories.Object.Product.Morphisms as ProductMorphisms open import Cate...
open import Relation.Binary.Core module InsertSort.Impl1.Correctness.Permutation.Base {A : Set} (_≤_ : A → A → Set) (tot≤ : Total _≤_) where open import Data.List open import Data.Sum open import InsertSort.Impl1 _≤_ tot≤ open import List.Permutation.Base A lemma-insert∼/ : (x : A...
-- Lifting of substitutions, and instance of strength for δ module SOAS.Coalgebraic.Lift {T : Set} where open import SOAS.Common open import SOAS.Context {T} open import SOAS.Variable open import SOAS.Families.Core {T} import SOAS.Families.Delta {T} as δ; open δ.Sorted open import SOAS.Abstract.Hom {T} import SOAS.Ab...
------------------------------------------------------------------------ -- The Agda standard library -- -- This module is DEPRECATED. ------------------------------------------------------------------------ {-# OPTIONS --without-K --safe #-} open import Relation.Binary using (Rel; Setoid; Substitutive; Symmetric; To...
module Issue453 where postulate A : Set fails : {x : _} → A
{-# OPTIONS --cubical --no-import-sorts --safe #-} module Cubical.ZCohomology.Groups.Unit where open import Cubical.ZCohomology.Base open import Cubical.ZCohomology.Properties open import Cubical.HITs.Sn open import Cubical.Foundations.HLevels open import Cubical.Foundations.Prelude open import Cubical.Foundations.Iso...
{-# OPTIONS --cubical --no-import-sorts --allow-unsolved-metas #-} module Number.Operations.Details where open import Cubical.Foundations.Everything renaming (_⁻¹ to _⁻¹ᵖ; assoc to ∙-assoc) open import Cubical.Relation.Nullary.Base -- ¬_ open import Cubical.Data.Unit.Base -- Unit open import Cubical.Data.Sigma.Base r...
{-# OPTIONS --rewriting #-} {-# OPTIONS --show-implicit #-} module NaturalDeduction-PatternLambdaBug where record ⊤ : Set where data ⊥ : Set where foo : ⦃ _ : ⊤ ⦄ → ⊥ → Set foo = λ {x → {!x!}} {- C-c C-c above generates invalid syntax: foo = λ { } Found an implicit lambda where an explicit lambda was ex...
------------------------------------------------------------------------ -- Split surjections ------------------------------------------------------------------------ {-# OPTIONS --without-K --safe #-} open import Equality module Surjection {reflexive} (eq : ∀ {a p} → Equality-with-J a p reflexive) where open Der...
{-# OPTIONS --safe --experimental-lossy-unification #-} module Cubical.Homotopy.Whitehead where open import Cubical.Foundations.Prelude open import Cubical.Foundations.Function open import Cubical.Foundations.Isomorphism open import Cubical.Foundations.Equiv open import Cubical.Foundations.Pointed open import Cubical....
------------------------------------------------------------------------------ -- Data and postulates ------------------------------------------------------------------------------ {-# OPTIONS --exact-split #-} {-# OPTIONS --no-sized-types #-} {-# OPTIONS --no-universe-polymorphism #-} {-# OPTIO...
import Common.Reflect data _≡_ {A : Set} (x : A) : A → Set where refl : x ≡ x data Bool : Set where true false : Bool data True : Set where true : True -- Should print names as "quote Bool.true" (making sure to disambiguate) -- and "quote false" rather than "Issue619.Bool.true/false" in error message. not-tr...
-- It seems as if our fix for singleton records was not good enough; -- the following code was accepted by Agda 2.2.6. -- Fixed now. module Issue245 where record ⊤ : Set where postulate A : Set x : A record R₁ (P : A → Set) : Set where field f : P x record R₂ : Set₁ where field F : A → Set f : R...
open import Agda.Builtin.IO open import Agda.Builtin.Reflection open import Agda.Builtin.Strict open import Agda.Builtin.String open import Agda.Builtin.Unit postulate putStr : String → IO ⊤ {-# FOREIGN GHC import qualified Data.Text.IO #-} {-# COMPILE GHC putStr = Data.Text.IO.putStr #-} {-# COMPILE JS putStr = ...
{-# OPTIONS --sized-types #-} module SizedTypesFunctionFromSuccSize where open import Common.Size data Nat : {size : Size} → Set where zero : {size : Size} → Nat {↑ size} suc : {size : Size} → Nat {size} → Nat {↑ size} bad : {i : Size} → Nat {↑ i} → Set bad zero = bad zero bad (suc x) = Nat
------------------------------------------------------------------------ -- The Agda standard library -- -- Properties of operations on strings ------------------------------------------------------------------------ {-# OPTIONS --without-K --safe #-} module Data.String.Properties where open import Data.Bool.Base us...
-- {-# OPTIONS --show-implicit #-} -- {-# OPTIONS -v tc.with.top:25 #-} -- {-# OPTIONS -v tc.with:40 -v tc.interaction:20 -v interaction.give:20 -v tc:10 #-} open import Common.Equality data Unit : Set where unit : Unit id : (A : Set) → A → A id A a = a module Works where dx : (x : Unit) → Unit → Unit dx x u...
{-# OPTIONS --cubical --no-import-sorts #-} open import Agda.Primitive renaming (_⊔_ to ℓ-max; lsuc to ℓ-suc; lzero to ℓ-zero) module Number.Bundles where private variable ℓ ℓ' : Level open import Cubical.Foundations.Everything renaming (_⁻¹ to _⁻¹ᵖ; assoc to ∙-assoc) open import Cubical.Relation.Binary.Base ...
module Lvl where open import Type open import Agda.Primitive public using (Level; _⊔_) renaming (lzero to 𝟎; lsuc to 𝐒) -- Wraps a lower level set in a higher level wrapper set. record Up {ℓ₁ ℓ₂} (T : Type{ℓ₂}) : Type{ℓ₁ ⊔ ℓ₂} where constructor up field obj : T of : ∀{ℓ} → Type{ℓ} → Level of {ℓ} _ = ℓ {-#...
{-# OPTIONS --safe --experimental-lossy-unification #-} module Cubical.Algebra.Polynomials.UnivariateFun.Polyn-nPoly where open import Cubical.Foundations.Prelude open import Cubical.Foundations.Equiv open import Cubical.Data.Nat renaming (_+_ to _+n_; _·_ to _·n_) open import Cubical.Data.Sigma open import Cubical....
-- Make the type checker loop. How can we ensure that the record is not -- recursive? module RecursiveRecord where data Nat : Set where zero : Nat suc : Nat -> Nat F : Set -> Set F _ = R where record R : Set where field x : F Nat r : F Nat r = _
module examplesPaperJFP.WxGraphicsLib where open import SizedIO.Base open import StateSizedIO.GUI.BaseStateDependent open import Size open import Data.Bool.Base open import Data.List.Base open import Function open import NativeIO open import StateSizedIO.GUI.WxBindingsFFI open import StateSizedIO.GUI.VariableList...
{-# OPTIONS --safe --cubical #-} open import Container module Container.Membership {s p} (𝒞 : Container s p) where open import Prelude open import HLevels infixr 5 _∈_ _∈!_ _∈_ : A → ⟦ 𝒞 ⟧ A → Type _ x ∈ xs = fiber (snd xs) x _∈!_ : A → ⟦ 𝒞 ⟧ A → Type _ x ∈! xs = isContr (x ∈ xs)
{-# OPTIONS --copatterns #-} -- {-# OPTIONS -v tc.lhs.split:50 -v tc.cover:20 -v tc.cc:15 -v tc.lhs.top:10 #-} -- {-# OPTIONS -v term:20 #-} -- {-# OPTIONS --no-positivity-check #-} -- {-# OPTIONS -v tc.def.fun:50 #-} -- {-# OPTIONS -v 100 #-} module CoPatStream where import Common.Level open import Common.Prelude h...
{- Definition of and facts about Smith normal form -} {-# OPTIONS --safe #-} module Cubical.Algebra.IntegerMatrix.Smith.NormalForm where open import Cubical.Foundations.Prelude open import Cubical.Foundations.HLevels open import Cubical.Data.Nat hiding (_·_) renaming (_+_ to _+ℕ_ ; +-assoc to +Assocℕ) open im...
------------------------------------------------------------------------ -- The Agda standard library -- -- Solver for equations in commutative monoids -- -- Adapted from Algebra.Solver.Monoid ------------------------------------------------------------------------ {-# OPTIONS --without-K --safe #-} open import Algeb...
open import Data.List hiding ([_]) renaming (_∷_ to _∷ₗ_) open import Data.Maybe open import Data.Product open import AEff open import EffectAnnotations open import Renamings open import Substitutions renaming (⟨_,_⟩ to ⟨_,,_⟩) open import Types open import Relation.Binary.PropositionalEquality hiding ([_]) open impo...
{-# OPTIONS --sized-types #-} module FormalLanguage.Proofs {ℓ} where import Lvl open import Data open import Data.Boolean open import Data.Boolean.Proofs open import Data.Boolean.Operators open Data.Boolean.Operators.Programming open import Data.Boolean.Stmt open import Data.Boolean.Stmt.Proofs import ...
module comb where infixr 50 _⟶_ data Ty : Set where ι : Ty _⟶_ : Ty -> Ty -> Ty data Tm : Ty -> Set where K : {σ τ : Ty} -> Tm (σ ⟶ τ ⟶ σ) S : {σ τ ρ : Ty} -> Tm ((σ ⟶ τ ⟶ ρ) ⟶ (σ ⟶ τ) ⟶ σ ⟶ ρ) _$_ : {σ τ : Ty} -> Tm (σ ⟶ τ) -> Tm σ -> Tm τ data Nf : Ty -> Set where Kⁿ : {σ τ : Ty} -> Nf (σ ⟶ τ ⟶ σ) K...
{- Constant structure: _ ↦ A -} {-# OPTIONS --cubical --no-import-sorts --safe #-} module Cubical.Structures.Relational.Constant where open import Cubical.Foundations.Prelude open import Cubical.Foundations.Equiv open import Cubical.Foundations.HLevels open import Cubical.Foundations.Structure open import Cubical.Fo...
module SystemF.BigStep.Extrinsic.Terms where open import Prelude open import SystemF.BigStep.Types open import Data.List open import Data.Fin.Substitution -- erased (type-free) System F syntax data Term : Set where unit : Term ƛ : Term → Term Λ : Term → Term _·_ : Term → Term → Term _[-] : Term → Term var...
-- There was a bug with module applications in let. module Issue34 where module A (X : Set) where postulate A : Set T : (X : Set) -> let open A X in A -> Set T X _ = X record B (X : Set) : Set where open A X field f : A postulate foo : (X : Set)(b : B X) -> let open A X open B b in ...
-- Andreas, 2019-11-11, issue #4189, reported by nad. -- Record constructors living in the record module are problematic -- as the record module is parameterized over the record value, -- but the constructor not. -- Thus, a record constructor does not live in the record module -- any more. -- {-# OPTIONS -v tc.mod.a...
{-# OPTIONS --instance-search-depth=10 #-} open import Agda.Primitive it : ∀ {a} {A : Set a} {{x : A}} -> A it {{x}} = x infixr 5 _,_ postulate Pair : ∀ {a} (A : Set a) {b} (B : Set b) -> Set (a ⊔ b) _,_ : ∀ {a} {A : Set a} {b} {B : Set b} -> A -> B -> Pair A B data Constraint {a} {A : Set a} (x : A) : Set wh...
{-# OPTIONS --safe --experimental-lossy-unification #-} module Cubical.Algebra.CommRing.RadicalIdeal where open import Cubical.Foundations.Prelude open import Cubical.Foundations.Equiv open import Cubical.Foundations.Function open import Cubical.Foundations.Powerset using (⊆-isProp) open import Cubical.Foundations.HLe...
module sum-thms where open import eq open import sum open import list open import product open import negation inj₁-inj : ∀{ℓ ℓ'}{A : Set ℓ}{B : Set ℓ'}{x : A}{x'} → inj₁{ℓ}{ℓ'}{A}{B} x ≡ inj₁ x' → x ≡ x' inj₁-inj refl = refl ¬∨ : ∀ {A B : Set} → ¬ A ∧ ¬ B → ¬ (A ∨ B) ¬∨ (u , u') (inj₁ x) = u x ¬∨ (u , u') (inj₂ y) ...
{-# OPTIONS --safe --without-K #-} -- Proof relevant separation algebras module Relation.Ternary.Separation where open import Function open import Level open import Data.Unit using (tt; ⊤) open import Data.Product hiding (map) open import Data.List.Relation.Ternary.Interleaving.Propositional hiding (map) open import...
{-# OPTIONS --without-K #-} open import HoTT open import cohomology.Theory {- Useful lemmas concerning the functorial action of C -} module cohomology.Functor {i} (CT : CohomologyTheory i) where open CohomologyTheory CT CF-inverse : (n : ℤ) {X Y : Ptd i} (f : fst (X ⊙→ Y)) (g : fst (Y ⊙→ X)) → g ⊙∘ f == ⊙idf _ →...
{-# OPTIONS --copatterns #-} module LecStr where open import CS410-Prelude open import CS410-Nat open import CS410-Functor record Stream (X : Set) : Set where coinductive field head : X tail : Stream X open Stream count : Nat -> Stream Nat head (count n) = n tail (count n) = count (suc n) nats : Stream...
--{-# OPTIONS -v tc.data:100 #-} module Issue830 where _⟶_ : Set₁ → Set → Set₁ A ⟶ B = A → B data ⟨Set⟩ : Set where [_] : Set ⟶ ⟨Set⟩ -- should fail
module x where {- ------------------------------------------------------------------------------ Abstract Relational program derivation technique : - stepwise refining a relational spec to a program by algebraic rules. - program obtained is correct by construction Dependent type theory rich enough to express correct...
{-# OPTIONS --without-K --rewriting #-} open import HoTT open import homotopy.PtdAdjoint open import homotopy.SuspAdjointLoop open import cohomology.WithCoefficients module cohomology.SuspAdjointLoopIso where module SuspAdjointLoopIso {i} where private hadj : HomAdjoint {i} {i} Σ⊣Ω.SuspFunctor Σ⊣Ω.LoopFunctor...
{-# OPTIONS --cubical --safe #-} module Cubical.Induction.Everything where open import Cubical.Induction.WellFounded public
module Examples.PingPong where open import ActorMonad public open import Prelude -- An example including three actors: spawner, pinger, ponger -- -- Spawner is the actor that starts it all. -- Spawner spawns both pinger and ponger. -- Then spawner send the reference of ponger to pinger, -- and the reference of pinger...
module Issue1252 where data Bool : Set where true false : Bool {-# COMPILE GHC Bool = data Bool (True | False) #-} foo : Bool → Bool foo true = false foo false = true {-# COMPILE GHC foo as foohs #-}
{-# OPTIONS --without-K --safe #-} -- https://www.cs.bham.ac.uk/~mhe/papers/omniscient-journal-revised.pdf module Constructive.OmniscienceAlt where open import Level renaming (zero to lzero; suc to lsuc) import Data.Bool as 𝔹 using (_≤_) open import Data.Bool as 𝔹 using (Bool; true; false; T; f≤t; b≤b; _∧_; not; _...
module UnSizedIO.Object where open import Data.Product record Interface : Set₁ where field Method : Set Result : (m : Method) → Set open Interface public -- A simple object just returns for a method the response -- and the object itself record Object (i : Interface) : Set where coinductive field ...
module Equality where data Nat : Set where zero : Nat suc : Nat -> Nat _+_ : Nat -> Nat -> Nat zero + m = m suc n + m = suc (n + m) data Vec (A : Set) : Nat -> Set where [] : Vec A zero _::_ : {n : Nat} -> A -> Vec A n -> Vec A (suc n) -- so that we know to parse infixr 40 _::_ -- some hacks 'cuz we do...
{-# OPTIONS --show-implicit #-} {-# OPTIONS -v tc.interaction:20 #-} ------------------------------------------------------------------------ -- Library id : ∀ {X : Set} → X → X id x = x infixr 9 _∘_ _∘_ : ∀ {a b c} {A : Set a} {B : A → Set b} {C : {x : A} → B x → Set c} → (∀ {x} (y : B x) → C y) → ...
{-# OPTIONS -v impossible:10 #-} -- Andreas, 2021-05-12, issue #5379 module ImpossibleVerboseReduceM where -- Note: keep ReduceM as first word after IMPOSSIBLE! {-# IMPOSSIBLE ReduceM should also print this debug message. #-} -- Should print the text after IMPOSSIBLE and then raise an internal error.
-- Andreas, 2014-03-27 fixed issue {-# OPTIONS --copatterns --sized-types #-} open import Common.Size mutual data D (i : Size) : Set where inn : R i → D i record R (i : Size) : Set where -- Note: not coinductive field force : (j : Size< i) → D j open R inh : (i : Size) → R i force (inh i) j =...
module Issue276 where boo : {S T : Set}(f : S -> T)(x y : S) -> ((P : S -> Set) -> P x -> P y) -> (P : T -> Set) -> P (f x) -> P (f y) boo = \ f x y q P -> q (\ s -> P (f s)) record Pack (S : Set) : Set where constructor pack field unpack : S open Pack unpack' : {S : Set} -> Pack S -> S unpack'...
module Reduction where open import Prelude open import Lambda open import Subst open import Trans infix 10 _⟶β_ data _⟶β_ : forall {Γ τ} -> (t u : Term Γ τ) -> Set where β : forall {Γ σ τ}{t : Term (Γ , σ) τ} Δ {u : Term (Γ ++ Δ) σ} -> (ƛ t) ↑ Δ • u ⟶β t ↑ Δ / [ Δ ⟵ u ] wk⟶ : forall {Γ σ τ}{t₁ t₂ : Te...
------------------------------------------------------------------------------ -- Distributive laws on a binary operation: Task B ------------------------------------------------------------------------------ {-# OPTIONS --exact-split #-} {-# OPTIONS --no-sized-types #-} {-# OPTIONS --no-univers...
-- Two out-of-scope variables are given the same name #3678 open import Agda.Builtin.Sigma open import Agda.Builtin.Equality postulate A : Set B : A → Set a : A Pi : (A → Set) → Set Pi B = {x : A} → B x foo : Pi \ y → Σ (B y) \ _ → Pi \ z → Σ (y ≡ a → B z) \ _ → B y → B z → A foo = {!!} , (\ { refl → {!!} })...
-- Long version, the final version is Nat.agda module NatTry where data ℕ : Set where zero : ℕ suc : ℕ → ℕ one two three four : ℕ one = suc zero two = suc one three = suc two four = suc three _+_ : ℕ → ℕ → ℕ zero + b = b suc a + b = suc (a + b) data Bool : Set where true : Bool false : Bool _≟_ : ℕ...
------------------------------------------------------------------------ -- η-expansion of simply-kinded types in Fω with interval kinds ------------------------------------------------------------------------ {-# OPTIONS --safe --without-K #-} module FOmegaInt.Kinding.Simple.EtaExpansion where open import Data.Fin ...
------------------------------------------------------------------------ -- Some examples related to Nat.Wrapper, defined in Cubical Agda ------------------------------------------------------------------------ {-# OPTIONS --cubical --safe #-} open import Equality.Path as P open import Prelude hiding (zero; suc; _+_)...
------------------------------------------------------------------------ -- The Agda standard library -- -- A bunch of properties about natural number operations ------------------------------------------------------------------------ module Data.Nat.Properties.Simple where open import Data.Nat as Nat open import Fun...
{-# OPTIONS --safe #-} module Definition.Conversion.Lift where open import Definition.Untyped open import Definition.Untyped.Properties open import Definition.Typed open import Definition.Typed.Weakening open import Definition.Typed.Properties open import Definition.Typed.EqRelInstance open import Definition.Conversi...
module Data.Fin.Extra where open import Data.Nat renaming (suc to S; zero to Z; _+_ to _ℕ+_; _*_ to _ℕ*_) open import Data.Fin open import Function open import Relation.Nullary.Negation open import Relation.Binary.PropositionalEquality inject-1 : ∀ {n} → (i : Fin (S n)) → toℕ i ≢ n → Fin n inject-1 {Z} zero ...
module Extensions.List where open import Prelude open import Data.List open import Data.Fin using (fromℕ≤; zero; suc) open import Data.List.All hiding (lookup; map) open import Data.Maybe hiding (All; map) open import Relation.Nullary open import Relation.Nullary.Decidable using (map′) open import Relation.Binary.Cor...
-- Andreas 2016-01-06 -- {-# OPTIONS -v error.checkclause:60 #-} data D : Set where c : D test : (x y z : D) → Set test _ c _ with D test x y z | _ = D -- Expected output: clause should be printed as is in error message, -- including underscore patterns.
module n2o.Network.Socket where open import proto.IO open import proto.Base data SocketType : Set where NoSocketType : SocketType Stream : SocketType Datagram : SocketType Raw : SocketType RDM : SocketType SeqPacket : SocketType {-# COMPILE GHC SocketType = da...
------------------------------------------------------------------------------ -- Testing the η-expansion ------------------------------------------------------------------------------ {-# OPTIONS --exact-split #-} {-# OPTIONS --no-sized-types #-} {-# OPTIONS --no-universe-polymorphism #-} {-# O...
------------------------------------------------------------------------ -- Instantiation of Contractive for streams ------------------------------------------------------------------------ -- Taken from the paper. -- The definition of Eq has been changed slightly, as compared to the -- paper. The paper uses -- Eq ...
{-# OPTIONS --cubical --no-import-sorts --allow-unsolved-metas #-} module MorePropAlgebra.Consequences where open import Agda.Primitive renaming (_⊔_ to ℓ-max; lsuc to ℓ-suc; lzero to ℓ-zero) private variable ℓ ℓ' ℓ'' : Level open import Cubical.Foundations.Everything renaming (_⁻¹ to _⁻¹ᵖ; assoc to ∙-assoc) ...
{-# OPTIONS --safe #-} open import Definition.Typed.EqualityRelation module Definition.LogicalRelation.Properties.Reflexivity {{eqrel : EqRelSet}} where open import Definition.Untyped open import Definition.Typed open import Definition.LogicalRelation open import Tools.Product open import Tools.Empty import Tools.P...
{-# OPTIONS --without-K --safe #-} module Categories.Diagram.Limit.Ran where open import Level open import Data.Product using (Σ) open import Categories.Category open import Categories.Category.Complete import Categories.Category.Construction.Cones as ConesCat open import Categories.Category.Construction.Comma open ...
------------------------------------------------------------------------------ -- Test case due to Agda new unifier ------------------------------------------------------------------------------ {-# OPTIONS --exact-split #-} {-# OPTIONS --no-sized-types #-} {-# OPTIONS --no-universe-polymorphism...
{-# OPTIONS --without-K --safe #-} module Categories.Monad.Relative where open import Level open import Categories.Category using (Category) open import Categories.Functor using (Functor; Endofunctor; _∘F_) renaming (id to idF) import Categories.Morphism.Reasoning as MR open import Categories.NaturalTransformation re...
{-# OPTIONS --safe #-} open import Definition.Typed.EqualityRelation module Definition.LogicalRelation.Substitution.Introductions.Sigma {{eqrel : EqRelSet}} where open EqRelSet {{...}} open import Definition.Untyped as U hiding (wk) open import Definition.Untyped.Properties open import Definition.Typed open import D...
module ElaborateGive where open import Agda.Builtin.List open import Agda.Builtin.Nat open import Agda.Builtin.Reflection open import Agda.Builtin.String open import Agda.Builtin.Unit five : Nat five = {!!} five' : Nat five' = {!!} five'' : Nat five'' = {!!} macro addUnknown : Term → TC ⊤ addUnknown goal = uni...
module main where {- unsized Versions omitted in talk -} import interactiveProgramsAgdaUnsized import objectsInAgdaUnsized {- end unsized Versions omitted in talk -} import interactiveProgramsAgda import objectsInAgda {- Probably omit because of time -} import interfaceExtensionAndDelegation {- End Probably omit b...
{- The subset "goodness" of can w.r.t. other ρθ-reductions. For each of the 7 non-merge ρθ-reductions, there are two corresponding Can subset lemmas. The lemmas for shared variables and sequential variables are merged together, using term-raise and term-nothing to capture the relevant esterel Terms (see Base for their...
open import Oscar.Prelude open import Oscar.Class open import Oscar.Class.HasEquivalence open import Oscar.Class.Quadricity open import Oscar.Class.Injectivity open import Oscar.Class.Congruity open import Oscar.Class.Leftstar open import Oscar.Class.Properthing open import Oscar.Class.Smap open import Oscar.Class.Sym...
-- Andreas, 2014-06-27 -- {-# OPTIONS -v tc.lhs:40 #-} {-# OPTIONS --copatterns #-} record Coind : Set where coinductive field ind : Coind open Coind loop : Set -> Coind ind A (loop B) = ind (loop A) -- WAS: Internal error. -- NOW: Proper error. -- Cannot eliminate type Coind with pattern ind A (did you supply...
open import Agda.Builtin.String open import Agda.Builtin.Equality test : String → String → String test "x" b = "left" test a "x" = "right" test a b = "nowhere" _ : test "a" "x" ≡ "right" _ = refl