text
stringlengths
4
690k
-- 2016-01-05, Jesper: In some cases, the new unifier is still too restrictive -- when --cubical-compatible is enabled because it doesn't do generalization of datatype -- indices. This should be fixed in the future. -- 2016-06-23, Jesper: Now fixed. {-# OPTIONS --cubical-compatible #-} data _≡_ {a} {A : Set a} (x :...
module _ where module M (A : Set) where record R : Set where postulate B : Set postulate A : Set r : M.R A module M' = M A open import Agda.Builtin.Reflection open import Agda.Builtin.List postulate any : {A : Set} → A macro m : Term → TC _ m goal = bindTC (inferType goal) λ goal-type →...
{-# OPTIONS --no-positivity-check #-} module Clowns where import Equality import Isomorphism import Derivative import ChainRule open import Sets open import Functor open import Zipper open import Dissect open Functor.Recursive open Functor.Semantics -- Natural numbers NatF : U NatF = K [1] + Id Nat : Set Nat = μ N...
module Numeric.Nat.GCD.Properties where open import Prelude open import Numeric.Nat.Properties open import Numeric.Nat.Divide open import Numeric.Nat.Divide.Properties open import Numeric.Nat.GCD open import Numeric.Nat.GCD.Extended open import Tactic.Nat open import Tactic.Cong gcd-is-gcd : ∀ d a b → gcd! a b ≡ d →...
{-# OPTIONS --safe #-} module Cubical.Algebra.CommAlgebra.QuotientAlgebra where open import Cubical.Foundations.Prelude open import Cubical.Foundations.HLevels open import Cubical.Foundations.Powerset using (_∈_) open import Cubical.HITs.SetQuotients hiding (_/_) open import Cubical.Algebra.CommRing open import Cubic...
-- Example by Ian Orton {-# OPTIONS --rewriting #-} open import Agda.Builtin.Bool open import Agda.Builtin.Equality _∧_ : Bool → Bool → Bool true ∧ y = y false ∧ y = false data ⊥ : Set where ⊥-elim : ∀ {a} {A : Set a} → ⊥ → A ⊥-elim () ¬_ : ∀ {a} → Set a → Set a ¬ A = A → ⊥ contradiction : ∀ {a b} {A : Set a} {B...
{-# OPTIONS --without-K #-} open import Base open import Homotopy.Pushout open import Homotopy.VanKampen.Guide {- This module provides the function code⇒path for the homotopy equivalence for van Kampen theorem. -} module Homotopy.VanKampen.CodeToPath {i} (d : pushout-diag i) (l : legend i (pushout-diag.C d))...
module Example.Test where open import Data.Maybe using (Is-just) open import Prelude.Init open import Prelude.DecEq open import Prelude.Decidable _ : (¬ ¬ ((true , true) ≡ (true , true))) × (8 ≡ 18 ∸ 10) _ = auto
-- Export only the experiments that are expected to compile (without -- any holes) {-# OPTIONS --cubical --no-import-sorts #-} module Cubical.Experiments.Everything where open import Cubical.Experiments.Brunerie public open import Cubical.Experiments.EscardoSIP public open import Cubical.Experiments.Generic public ope...
module Web.URI.Port where open import Web.URI.Port.Primitive public using ( Port? ; :80 ; ε )
{-# OPTIONS --experimental-irrelevance #-} -- {-# OPTIONS -v tc:10 #-} module ExplicitLambdaExperimentalIrrelevance where postulate A : Set T : ..(x : A) -> Set -- shape irrelevant type test : .(a : A) -> T a -> Set test a = λ (x : T a) -> A -- this should type check and not complain about irrelevance of a modu...
module Numeral.Integer where open import Data.Tuple open import Logic import Lvl open import Numeral.Natural open import Numeral.Natural.Oper open import Relator.Equals open import Type open import Type.Quotient -- Equivalence relation of difference equality. -- Essentially (if one would already work in the inte...
module hello-world where open import IO open import Data.String open import Data.Nat open import Data.Vec main = run (putStrLn "Hello World!") 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 new : {A : Set} -> A -...
{-# OPTIONS --safe --warning=error --without-K #-} open import Setoids.Setoids open import Rings.Definition open import Agda.Primitive using (Level; lzero; lsuc; _⊔_) module Rings.Ideals.Principal.Definition {a b : _} {A : Set a} {S : Setoid {a} {b} A} {_+_ _*_ : A → A → A} (R : Ring S _+_ _*_) where open import Ri...
{-# OPTIONS --without-K --safe #-} open import Algebra.Structures.Bundles.Field module Algebra.Linear.Morphism.Properties {k ℓᵏ} (K : Field k ℓᵏ) where open import Level open import Algebra.FunctionProperties as FP import Algebra.Linear.Morphism.Definitions as LinearMorphismDefinitions import Algebra.Morphism as...
module Issue408 where open import Common.Prelude open import Common.Equality -- 1. Agda should prefer to split on an argument that covers data Fin : Nat → Set where zero : {n : Nat} → Fin (suc n) suc : {n : Nat} → Fin n → Fin (suc n) wk : {n : Nat} → Fin n → Fin (suc n) wk zero = zero wk (suc n) = suc (wk n) ...
module Extensions.Bool where open import Data.Unit open import Data.Bool open import Relation.Nullary public using (yes; no; ¬_; Dec) data All {p} (P : Set p) : Bool → Set p where true : P → All P true false : All P false data Any {p} (P : Set p) : Bool → Set p where true : P → Any P true all-map : ∀ {p} {P...
{-# OPTIONS --erased-cubical #-} -- Modules that use --cubical can be imported when --erased-cubical is -- used. open import Erased-cubical-Import.Cubical -- However, definitions from such modules can only be used in erased -- contexts. _ : {A : Set} → A → ∥ A ∥ _ = ∣_∣
module CTL.Modalities.EN where open import FStream.Core open import Library -- Eventually (in) Next : p ⊧ φ ⇔ ∃ p[1] ⊧ φ EN' : ∀ {ℓ₁ ℓ₂} {C : Container ℓ₁} → FStream' C (Set ℓ₂) → Set (ℓ₁ ⊔ ℓ₂) EN' s = EPred head (inF (tail s)) EN : ∀ {ℓ₁ ℓ₂} {C : Container ℓ₁} → FStream C (Set ℓ₂) → Set (ℓ₁ ⊔ ℓ₂) EN s = EPred EN' (...
{-# OPTIONS --without-K --safe #-} module Dodo.Binary.Dec where -- Stdlib imports open import Level using (Level; _⊔_) open import Relation.Nullary using (Dec) open import Relation.Binary using (REL) DecRel : {a b ℓ : Level} {A : Set a} {B : Set b} → REL A B ℓ → Set (a ⊔ b ⊔ ℓ) DecRel R = ∀ x y → Dec (R x y)
{-# OPTIONS --cubical --prop #-} module Issue2487-2 where import Issue2487.Infective
module #2 where open import Relation.Binary.PropositionalEquality open import #1 {- Exercise 2.2. Show that the three equalities of proofs constructed in the previous exercise form a commutative triangle. In other words, if the three definitions of concatenation are denoted by (p ∘ q), (p ∘ q), and (p ∘ q), then th...
{-# OPTIONS --without-K #-} open import HoTT {- Useful lemmas for computing the effect of transporting a function - across an equivalence in the domain or codomain. - TODO: find a better place for this. -} module cohomology.FunctionOver where {- transporting a function along an equivalence or path in the domain -...
module Numeral.PositiveInteger.Oper.Proofs where open import Functional open import Function.Equals open import Function.Iteration open import Function.Iteration.Proofs open import Logic.Propositional open import Logic.Predicate import Numeral.Natural as ℕ import Numeral.Natural.Oper as ℕ open import Numeral...
-- Andreas, 2017-01-26, issue #2436 -- Outlaw coinductive records with eta-equality record U : Set where coinductive eta-equality field f : U -- Infinite eta-expansion would make Agda loop test : U test = _
module Isos.Isomorphism where open import Logics.And public
{- - Prelude: Play with some basic theorems... -} {-# OPTIONS --rewriting #-} module Prelude where open import Agda.Builtin.Equality public open import Agda.Builtin.Nat renaming (Nat to ℕ) public {-# BUILTIN REWRITE _≡_ #-} -- Identity function id : ∀ {ℓ} {A : Set ℓ} → A → A id x = x _ : id 42 ≡ 42 _ = refl --...
-- Andreas, 2018-10-17, re issue #2757 -- -- Matching on runtime-irrelevant arguments is fine -- as long as it produces only one branch. open import Agda.Builtin.Bool open import Agda.Builtin.Equality open import Agda.Builtin.Nat -- Matching on empty types can be erased. data ⊥ : Set where ⊥-elim : ∀{A : Set} → @0 ...
open import Relation.Nullary using (¬_) module AKS.Fin where open import AKS.Nat using (ℕ; _+_; _<_) record Fin (n : ℕ) : Set where constructor Fin✓ field i : ℕ i<n : i < n ¬Fin0 : ¬ (Fin 0) ¬Fin0 () from< : ∀ {i n} → i < n → Fin n from< {i} i<n = Fin✓ i i<n
------------------------------------------------------------------------ -- The Agda standard library -- -- Record types with manifest fields and "with", based on Randy -- Pollack's "Dependently Typed Records in Type Theory" ------------------------------------------------------------------------ -- For an example of ...
-- making sure that the fun clauses are kept in declaration order -- in an interleaved mutual block open import Agda.Builtin.Nat interleaved mutual plus : Nat → Nat → Nat minus : Nat → Nat → Nat -- 0 being neutral plus 0 n = n minus n 0 = n -- other 0 case plus n 0 = n minus 0 n = 0 -- suc suc ...
-- Reported by nils.anders.danielsson, Feb 17, 2015 -- See also Issue 292 , Issue 1406 , and Issue 1427. -- The code below is accepted by Agda 2.4.2.2, but not by the current -- maintenance or master branches. data Box (A : Set) : Set where [_] : A → Box A data _≡_ (A : Set) : Set → Set₁ where refl : A ≡ A d...
{-# OPTIONS --cubical --no-import-sorts --safe #-} module Cubical.Foundations.Pointed.Properties where open import Cubical.Foundations.Prelude open import Cubical.Foundations.Pointed.Base open import Cubical.Foundations.Function open import Cubical.Foundations.GroupoidLaws open import Cubical.Data.Sigma Π∙ : ∀ {ℓ ℓ'...
------------------------------------------------------------------------ -- A variant of set quotients with erased higher constructors ------------------------------------------------------------------------ {-# OPTIONS --erased-cubical --safe #-} -- Partly following the HoTT book, but adapted for erasure. -- -- Unli...
open import Agda.Builtin.Reflection open import Agda.Builtin.Unit -- WORKS macro idT : Term → Term → TC ⊤ idT = unify -- FAILS macro test = unify
-- Andreas, 2013-11-23 -- postulates are now alsow allowed in old-style mutual blocks open import Common.Prelude mutual even : Nat → Bool even zero = true even (suc n) = odd n postulate odd : Nat → Bool -- Error WAS: Postulates are not allowed in mutual blocks
module Preduploid.Functor where open import Preduploid open import Relation.Binary.PropositionalEquality using (_≡_; refl; sym) open import Level private variable p q r s : Polarity record Functor {o₁ ℓ₁ o₂ ℓ₂} (𝒞 : Preduploid o₁ ℓ₁) (𝒟 : Preduploid o₂ ℓ₂) : Set (levelOfTerm 𝒞 ⊔ levelOfTerm 𝒟) where priv...
open import Prelude open import Algebra open import Algebra.Monus module Codata.Segments {ℓ} (mon : CTMAPOM ℓ) where open CTMAPOM mon private variable i j : 𝑆 -- This is a type which contains some finite and some infinite lists. -- The idea is that each entry contains a parameter (w) which says -- how much c...
------------------------------------------------------------------------ -- The Agda standard library -- -- Some derivable properties ------------------------------------------------------------------------ {-# OPTIONS --without-K --safe #-} open import Algebra module Algebra.Properties.DistributiveLattice ...
-- Andreas, 2020-03-27, issue #3684 -- Warn about invalid fields instead of hard error. module TooManyFields where postulate X : Set record D : Set where field x : X d : X -> D d x = record {x = x; y = x}
module Logic{ℓ} where -- open import Logic -- open import Logic.Classical -- Everything is computably decidable -- instance postulate classical : ∀{ℓ}{P : Stmt{ℓ}} → Classical(P) Stmt : _ Stmt = Set(ℓ) -- Prop(ℓ) open import Agda.Primitive public renaming (Setω to Stmtω)
------------------------------------------------------------------------ -- The Agda standard library -- -- Properties related to Fin, and operations making use of these -- properties (or other properties not available in Data.Fin) ------------------------------------------------------------------------ module Data.Fi...
module container.m.level where open import level open import sum open import equality.core open import equality.calculus open import function.core open import function.isomorphism open import function.extensionality open import sets.unit open import sets.nat.core open import hott.level open import hott.univalence open...
import Lvl open import Data.Boolean open import Type module Data.List.Sorting.InsertionSort {ℓ} {T : Type{ℓ}} (_≤?_ : T → T → Bool) where open import Data.List import Data.List.Functions as List open import Data.List.Sorting.Functions(_≤?_) insertion-sort : List(T) → List(T) insertion-sort = List.foldᵣ ins...
module Verifier where open import ModusPonens using (modusPonens) check : ∀ {P Q : Set} → (P → Q) → P → Q check = modusPonens
{-# OPTIONS --cubical #-} module Multidimensional.Data.DirNum.Properties where open import Cubical.Foundations.Prelude open import Cubical.Data.Empty open import Cubical.Data.Prod open import Cubical.Data.Bool open import Cubical.Data.Nat open import Cubical.Relation.Nullary open import Multidimensional.Data.Dir op...
{-# OPTIONS --verbose=10 #-} module leafs where open import Data.Nat open import Data.Vec open import Agda.Builtin.Sigma open import Data.Product open import Data.Fin using (fromℕ) open import trees open import optics open import lemmas leafsTree : {A : Set} -> Tree A -> ∃[ n ] (Vec A n × (Vec ...
{-# OPTIONS --without-K --safe #-} module Categories.Yoneda where -- Yoneda Lemma. In total, provides: -- * the Yoneda Embedding (called embed here) from any Category C into Presheaves C -- Worth noticing that there is no 'locally small' condition here; however, if one looks at -- the levels involved, there is in...
module Pi.Everything where open import Pi.Syntax -- Syntax of Pi open import Pi.Opsem -- Abstract machine semantics of Pi open import Pi.AuxLemmas -- Some auxiliary lemmas about opsem for forward/backward deterministic proof open import Pi.NoRepeat -- Forward/backward deterministic lemmas and Non-repeating ...
{-# OPTIONS --cubical --no-import-sorts --safe #-} module Cubical.HITs.Ints.DiffInt where open import Cubical.HITs.Ints.DiffInt.Base public open import Cubical.HITs.Ints.DiffInt.Properties public
{- This second-order signature was created from the following second-order syntax description: syntax Sum | S type _⊕_ : 2-ary | l30 term inl : α -> α ⊕ β inr : β -> α ⊕ β case : α ⊕ β α.γ β.γ -> γ theory (lβ) a : α f : α.γ g : β.γ |> case (inl(a), x.f[x], y.g[y]) = f[a] (rβ) b : β f...
-- New feature by Jesper Cockx in commit be89d4a8b264dd2719cb8c601a2c7f45a95ba220 : -- disabling the universe check for a data or record type. -- Andreas, 2018-10-27, re issue #3327: restructured test cases. module _ where -- Pragma is naturally attached to definition. module DataDef where data U : Set T : U →...
open import Nat open import Prelude open import core open import contexts open import typed-elaboration open import lemmas-gcomplete open import lemmas-complete open import progress-checks open import finality module cast-inert where -- if a term is compelete and well typed, then the casts inside are all -- identi...
-- Andreas, 2018-11-03, issue #3364 -- -- Better error when trying to import with new qualified module name. open import Agda.Builtin.Nat as Builtin.Nat -- WAS: Error: -- Not in scope: -- as at ... -- when scope checking as -- NOW: Warning -- `as' must be followed by an unqualified name -- when scope checking the ...
{-# OPTIONS --cubical --no-import-sorts --safe #-} open import Cubical.Core.Everything open import Cubical.Relation.Binary.Raw module Cubical.Relation.Binary.Reasoning.PartialOrder {c ℓ} {A : Type c} (P : PartialOrder A ℓ) where open PartialOrder P import Cubical.Relation.Binary.Raw.Construct.NonStrictToStrict _≤_...
-- exercises -- * basic logic properties (implication, and, or, bot, not, forall, exists) -- * data types -- * records -- * non-dep, non-rec, non-indexed case splits -- * including elimination constants as hints -- * hidden arguments open import Auto.Prelude h0 : (A : Set) → A → A h0 = {!!} --h0 = λ A z → z h1 : (A...
module TLP02 where open import Data.Bool open import Data.Nat open import Data.String open import Relation.Binary.PropositionalEquality as PropEq using (_≡_; refl) -- ----- Star型の定義 ----- data Star : Set where NIL : Star TRU : Star N : ℕ → Star S : String → Star C : Star → Star → Star ...
------------------------------------------------------------------------ -- The Agda standard library -- -- Definitions of algebraic structures defined over some other -- structure, like modules and vector spaces -- -- Terminology of bundles: -- * There are both *semimodules* and *modules*. -- - For M an R-semimodule...
------------------------------------------------------------------------ -- The Agda standard library -- -- The universal binary relation ------------------------------------------------------------------------ {-# OPTIONS --without-K --safe #-} module Relation.Binary.Construct.Always where open import Relation.Bina...
module Oscar.Category.Action where open import Oscar.Category.Setoid open import Oscar.Function open import Oscar.Level record Action {𝔬} (⋆ : Set 𝔬) 𝔄𝔬 𝔄𝔮 : Set (𝔬 ⊔ lsuc (𝔄𝔬 ⊔ 𝔄𝔮)) where field 𝔄 : ⋆ → Setoid 𝔄𝔬 𝔄𝔮 ⦃ isSetoid ⦄ : ∀ {x} → IsSetoid (Setoid.⋆ (𝔄 x)) 𝔄𝔮 ↥ : ⋆ →...
{-# OPTIONS --without-K --safe #-} module Cham.Inference where
{-# OPTIONS --without-K --safe #-} module Categories.Bicategory.Instance.Cats where -- The category of categories (Cats) is a Bicategory open import Level open import Data.Product using (Σ; _×_; _,_; proj₁; proj₂) open import Categories.Bicategory using (Bicategory) open import Categories.Category using (Category) o...
------------------------------------------------------------------------ -- The Agda standard library -- -- Application of substitutions to lists, along with various lemmas ------------------------------------------------------------------------ -- This module illustrates how Data.Fin.Substitution.Lemmas.AppLemmas -- ...
module MutualBlockInLet where postulate A : Set a : A test = let abstract x = a y = x in y
open import Relation.Binary.Core module PLRTree.Push.Heap {A : Set} (_≤_ : A → A → Set) (tot≤ : Total _≤_) (trans≤ : Transitive _≤_) where open import Data.Sum open import Induction.WellFounded open import Order.Total _≤_ tot≤ open import PLRTree {A} o...
{-# OPTIONS --termination-depth=1 #-} --{-# OPTIONS -v term:40 #-} module TerminationWithInsufficientDepth where data Nat : Set where zero : Nat suc : Nat -> Nat module Depth2 where -- The fix to issue 59 makes this go through. -- f : Nat -> Nat -- f zero = zero -- f (suc zero) = zero -- f (suc (suc ...
{-# OPTIONS --without-K #-} module Data.ByteString.Primitive.Strict where open import Data.Word8.Primitive using (Word8) open import Agda.Builtin.Nat using (Nat) open import Agda.Builtin.List using (List) open import Agda.Builtin.String using (String) open import Agda.Builtin.Bool using (Bool) open import Agda.Builti...
module Logics.Not where open import Function open import Relation.Nullary ------------------------------------------------------------------------ -- internal stuffs private a=¬∘¬a : ∀ {a} {A : Set a} → A → ¬ (¬ A) a=¬∘¬a a z = z a /p→q/→¬/p→¬q/ : ∀ {p q} {P : Set p} {Q : Set q} → (P → Q) → (¬ Q → ¬ P) /p→...
------------------------------------------------------------------------ -- The Agda standard library -- -- Some derivable properties ------------------------------------------------------------------------ open import Algebra module Algebra.Properties.Group {g₁ g₂} (G : Group g₁ g₂) where open Group G import Algebr...
record R (A B : Set) : Set where constructor c₁ field x : A mutual T : Set T = R D T data D : Set where c₂ : T → D f : T → Set f (c₁ (c₂ x)) = f x
open import Auto.Core using (Rule; RuleName; _≟-RuleName_; name2rule; IsHintDB) open import Level using (zero) open import Function using (id; _∘_) open import Category.Functor using (module RawFunctor) open import Data.Bool as Bool using (if_th...
module Cats.Category.Setoids.Facts.Initial where open import Data.Empty using (⊥) open import Level open import Cats.Category open import Cats.Category.Setoids using (Setoids ; ≈-intro) module Build {l} {l≈} where open Category (Setoids l l≈) Zero : Obj Zero = record { Carrier = Lift l ⊥ ; _≈_ ...
module Generic.Lib.Data.Nat where open import Data.Nat.Base hiding (_⊔_; _^_) public open import Generic.Lib.Decidable instance ℕEq : Eq ℕ ℕEq = viaBase Nat._≟_ where import Data.Nat as Nat foldℕ : ∀ {α} {A : Set α} -> (A -> A) -> A -> ℕ -> A foldℕ f x 0 = x foldℕ f x (suc n) = f (foldℕ f x n)
{-# OPTIONS --without-K #-} module container.equality where open import level open import sum open import equality.core open import function.isomorphism open import function.extensionality open import container.core open import container.fixpoint module Equality {li la lb lx} (c : Container li la lb)...
module Issue2487.A where
module Class.Show where open import Data.String using (String) record Show {a} (A : Set a) : Set a where field show : A -> String open Show {{...}} public
postulate Nat : Set succ : Nat → Nat Le : Nat → Nat → Set Fin : Nat → Set low : ∀ {m n} → Le m n → Fin n → Fin m instance Le-refl : ∀ {n} → Le n n Le-succ : ∀ {m n} ⦃ _ : Le m n ⦄ → Le m (succ n) Chk1 : ∀ {n} → Fin n → Set Chk2 : ∀ {n} → Fin n → Fin n → Set Chk3 : ∀ {m n} ⦃ _ : Le m n ⦄ → Fin ...
{-# OPTIONS --cubical --no-import-sorts --safe #-} module Cubical.Data.FinData.Properties where open import Cubical.Foundations.Function open import Cubical.Foundations.Prelude open import Cubical.Data.FinData.Base as Fin import Cubical.Data.Nat as ℕ open import Cubical.Data.Empty as Empty open import Cubical.Relati...
module Sandbox.IndRecIndexed where -- Ornamental Algebras, Algebraic Ornaments, CONOR McBRIDE -- https://personal.cis.strath.ac.uk/conor.mcbride/pub/OAAO/Ornament.pdf -- A Finite Axiomtization of Inductive-Recursion definitions, Peter Dybjer, Anton Setzer -- http://www.cse.chalmers.se/~peterd/papers/Finite_IR.pdf open...
{-# OPTIONS --without-K #-} open import Type using (Type₀; Type₁) open import Type.Identities open import Data.Zero using (𝟘) open import Data.One using (𝟙; 0₁) open import Data.Two.Base using (𝟚; 0₂; 1₂) open import Data.Product.NP using (Σ; _×_) open import Data.Sum.NP using (_⊎_) open import Data.Nat.Base using (...
module Oscar.Property.Preservativity where open import Oscar.Level open import Oscar.Relation record Preservativity {a} {A : Set a} {b} {B : A → Set b} {c} {C : (x : A) → B x → Set c} (_▻₁_ : (x : A) → (y : B x) → C x y) {d} {D : Set d} {e} {E : D → Set e} {f} {F : (x : D) → E x → Set f} (_▻₂_ : (x : D) ...
module Relation.Equality.Extensionality where open import Relation.Equality open import Data.Inductive.Higher.Interval open import Relation.Path.Operation funext : ∀ {a b}{A : Set a}{B : A → Set b}{f g : (x : A) → B x} → (∀ x → f x ≡ g x) → f ≡ g funext {A = A}{B = B} {f = f}{g = g} p = ap {f = h} path-seg where ...
module Issue205 where data ⊥ : Set where data D : Set₁ where d : (Set → Set) → D _*_ : D → Set → Set d F * A = F A foo : (F : D) → F * ⊥ foo (d _) = ⊥
postulate A : Set P : ..(_ : A) → Set f : {x : A} → P x g : ..(x : A) → P x g x = f
{-# OPTIONS --without-K --safe #-} open import Level open import Categories.Category module Categories.Category.Construction.Path {o ℓ e : Level} (C : Category o ℓ e) where open import Function using (flip) open import Relation.Binary hiding (_⇒_) open import Relation.Binary.Construct.Closure.Transitive open Catego...
{-# OPTIONS --cubical #-} module PathWithBoundary where open import Agda.Builtin.Cubical.Path open import Agda.Builtin.Nat pred : Nat → Nat pred (suc n) = n pred 0 = 0 -- if the with abstraction correcly propagates the boundary the second -- clause will not typecheck. false : ∀ n {m} → (pred n + m) ≡ m false n {...
module Typing where open import Data.Fin hiding (_≤_) open import Data.List hiding (drop) open import Data.List.All open import Data.Maybe open import Data.Nat open import Data.Nat.Properties open import Data.Product open import Relation.Binary.PropositionalEquality -- linearity indicator data LU : Set where LL UU...
open import Level using () renaming (zero to ℓ₀) open import Relation.Binary using (DecSetoid) module CheckInsert (A : DecSetoid ℓ₀ ℓ₀) where open import Data.Nat using (ℕ) open import Data.Fin using (Fin) open import Data.Fin.Properties using (_≟_) open import Data.Maybe using (Maybe ; nothing ; just) renaming (seto...
------------------------------------------------------------------------ -- The Agda standard library -- -- Properties of First ------------------------------------------------------------------------ {-# OPTIONS --without-K --safe #-} module Data.List.Relation.Unary.First.Properties where open import Data.Empty ope...
{-# OPTIONS --safe --warning=error #-} open import Sets.EquivalenceRelations open import Functions.Definition open import Agda.Primitive using (Level; lzero; lsuc; _⊔_; Setω) open import Setoids.Setoids open import Groups.Definition open import LogicalFormulae open import Orders.WellFounded.Definition open import Numb...
open import Function using (_∘_) open import Data.List using (List; _++_) renaming (_∷_ to _,_; _∷ʳ_ to _,′_; [] to ∅) open import Data.Sum using (_⊎_; inj₁; inj₂) open import Data.Product using (∃; _,_) open import Relation.Nullary using (Dec; yes; no) open import Relation.Nullary.Decidable using (True; toWitness) ope...
{-# OPTIONS --without-K #-} module Ch1 where -- open import lib.Base open import Base -- warmup module Eq-1-11-2 {i j} {A : Type i} {B : Type j} where -- import lib.types.Coproduct -- open import lib.types.Empty -- open import lib.types.Sigma -- If not A and not B, t...
module Types.IND where open import Data.Nat open import Data.Fin hiding (_+_) open import Data.Product open import Function open import Relation.Binary.PropositionalEquality hiding (Extensionality) open import Types.Direction open import Auxiliary.Extensionality open import Auxiliary.RewriteLemmas private varia...
------------------------------------------------------------------------ -- The Agda standard library -- -- Properties related to Pointwise ------------------------------------------------------------------------ {-# OPTIONS --without-K --safe #-} module Data.Vec.Functional.Relation.Binary.Pointwise.Properties where ...
-- Syntax: Types, terms and contexts. module Syntax where open import Library infixr 6 _⇒_ infixr 4 _,_ -- Types and contexts. data Ty : Set where ★ : Ty _⇒_ : (a b : Ty) → Ty data Cxt : Set where ε : Cxt _,_ : (Γ : Cxt) (a : Ty) → Cxt -- Variables and terms. data Var : (Γ : Cxt) (a : Ty) → Set where...
open import Data.Nat using ( ℕ ) renaming ( zero to zero' ; suc to suc' ) open import Data.Nat.GeneralisedArithmetic using ( fold ) open import Data.String using ( String ) module Data.Natural.Primitive where infixl 6 _+_ postulate Natural : Set zero : Natural suc : Natural → Natural _+_ : Natural → Natura...
-- Mutual Recursion. module MutRec where open import Relation.Binary.PropositionalEquality using (_≡_; refl) data Odd : Set data Even : Set where e0 : Even eS : Odd → Even data Odd where oS : Even → Odd addEO : Even → Odd → Odd addOO : Odd → Odd → Even addOO (oS m) n = eS (addEO m n) addEO e0 n = n addEO ...
module Esterel.Lang.Binding where open import utility open import Data.List open import Data.Empty using (⊥ ; ⊥-elim) open import Data.Bool using (Bool ; true ; false ; if_then_else_) open import Esterel.Lang open import Esterel.Environment as Env using (Env ; VarList ; Dom ; Θ ; _←_) open import Esterel.Context...
{-# OPTIONS --prop --rewriting #-} module Examples.Id where open import Calf.CostMonoid open import Calf.CostMonoids using (ℕ-CostMonoid) costMonoid = ℕ-CostMonoid open CostMonoid costMonoid open import Calf costMonoid open import Calf.Types.Nat open import Calf.Types.Bounded costMonoid open import Calf.Types.BigO ...
-- Andreas, 2016-07-28 issue 2120, reported by guillaume -- {-# OPTIONS -v tc.term.exlam:50 #-} open import Common.Product data Nat : Set where zero : Nat data Eq {A : Set}(a : A) : A → Set where refl : Eq a a postulate _<∣_ : ∀ {X Y : Set} → (X → Y) → X → Y test : Nat test = ( λ { (zero , refl) → zero } ) <∣...