text
stringlengths
4
690k
-- 2012-02-13 Andreas: testing correct polarity of data types -- sized types are the only source of subtyping, I think... {-# OPTIONS --sized-types #-} module DataPolarity where open import Common.Size data Nat : {size : Size} -> Set where zero : {size : Size} -> Nat {↑ size} suc : {size : Size} -> Nat {size} -...
{-# OPTIONS --allow-unsolved-metas #-} module Control.Lens where open import Function using (id; _∘_; const; flip) open import Relation.Binary.PropositionalEquality open ≡-Reasoning open import Axiom.FunctionExtensionality open import Util.Equality open import Control.Functor renaming (Comp to _•_) open import Cont...
-- This module closely follows a section of Martín Escardó's HoTT lecture notes: -- https://www.cs.bham.ac.uk/~mhe/HoTT-UF-in-Agda-Lecture-Notes/HoTT-UF-Agda.html#unicharac {-# OPTIONS --without-K #-} module Util.HoTT.Univalence.ContrFormulation where open import Util.Data.Product using (map₂) open import Util.Prelude...
{-# OPTIONS --safe --no-sized-types #-} open import Agda.Builtin.Size record Stream (A : Set) (i : Size) : Set where coinductive field head : A tail : {j : Size< i} → Stream A j open Stream destroy-guardedness : ∀ {A i} → Stream A i → Stream A i destroy-guardedness xs .head = xs .head destroy-guardednes...
{-# OPTIONS --cubical --no-import-sorts --safe #-} module Cubical.Algebra.Group.Notation where open import Cubical.Foundations.Prelude open import Cubical.Foundations.HLevels open import Cubical.Algebra.Group.Base module GroupNotationG {ℓ : Level} ((_ , G) : Group {ℓ}) where 0ᴳ = GroupStr.0g G _+ᴳ_ = GroupStr._+...
{-# OPTIONS --without-K --rewriting #-} module Set where
{-# OPTIONS --without-K --safe #-} -- Enriched category over a Monoidal category V open import Categories.Category using (module Commutation) renaming (Category to Setoid-Category) open import Categories.Category.Monoidal using (Monoidal) module Categories.Enriched.Category {o ℓ e} {V : Setoid-Category o ℓ e} ...
{- This second-order term syntax was created from the following second-order syntax description: syntax Combinatory | CL type * : 0-ary term app : * * -> * | _$_ l20 i : * k : * s : * theory (IA) x |> app (i, x) = x (KA) x y |> app (app(k, x), y) = x (SA) x y z |> app (app (app (s, x)...
{-# OPTIONS --without-K --safe #-} module Definition.Conversion.Consequences.Completeness where open import Definition.Untyped open import Definition.Typed open import Definition.Conversion open import Definition.Conversion.EqRelInstance open import Definition.LogicalRelation open import Definition.LogicalRelation.S...
------------------------------------------------------------------------------ -- All the Peano arithmetic modules ------------------------------------------------------------------------------ {-# OPTIONS --exact-split #-} {-# OPTIONS --no-sized-types #-} {-# OPTIONS --no-universe-polymorphism ...
module Computability.Data.Fin.Opposite where open import Computability.Prelude open import Data.Nat using (_≤_; _<_; s≤s; z≤n) open import Data.Nat.Properties using (≤-step) open import Data.Fin using (Fin; zero; suc; inject₁; fromℕ; fromℕ<; toℕ; opposite) opposite-fromℕ : ∀ k → opposite (fromℕ k) ≡ zero opposite-fro...
module Type.Properties.Decidable.Proofs where open import Data open import Data.Proofs open import Data.Boolean using (if_then_else_) open import Data.Boolean.Stmt open import Data.Either as Either using (_‖_) open import Data.Tuple as Tuple using (_⨯_ ; _,_) open import Functional import Lvl open import Data.Boo...
{-# OPTIONS --cubical --safe #-} module Data.List.Properties where open import Data.List open import Prelude open import Data.Fin map-length : (f : A → B) (xs : List A) → length xs ≡ length (map f xs) map-length f [] _ = zero map-length f (x ∷ xs) i = suc (map-length f xs i) map-ind : (f : A → B) (xs : L...
{- 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 -} import LibraBFT.Impl.Types.CryptoProxies as CryptoProxies i...
module PreludeInt where open import AlonzoPrelude import RTP int : Nat -> Int int = RTP.primNatToInt _+_ : Int -> Int -> Int _+_ = RTP.primIntAdd _-_ : Int -> Int -> Int _-_ = RTP.primIntSub _*_ : Int -> Int -> Int _*_ = RTP.primIntMul div : Int -> Int -> Int div = RTP.primIntDiv mod : Int -> Int -> Int mod = RT...
------------------------------------------------------------------------ -- Some theory of equivalences with erased "proofs", defined in terms -- of partly erased contractible fibres, developed using Cubical Agda ------------------------------------------------------------------------ -- This module instantiates and r...
module Integer.Difference where open import Data.Product as Σ open import Data.Product.Relation.Pointwise.NonDependent open import Data.Unit open import Equality open import Natural as ℕ open import Quotient as / open import Relation.Binary open import Syntax infixl 6 _–_ pattern _–_ a b = _,_ a b ⟦ℤ⟧ = ℕ × ℕ ⟦ℤ²⟧ =...
module MissingTypeSignature where data Nat : Set where zero : Nat suc : Nat -> Nat pred zero = zero pred (suc n) = n
module ProofUtilities where -- open import Data.Nat hiding (_>_) open import StdLibStuff open import Syntax open import FSC mutual hn-left-i : {n : ℕ} {Γ-t : Ctx n} {Γ : FSC-Ctx n Γ-t} {α β : Type n} (m : ℕ) (S : Form Γ-t β → Form Γ-t α) (F : Form Γ-t β) (G : Form Γ-t α) → Γ ⊢ α ∋ S (headNorm m F) ↔ G → Γ ⊢ α ∋ S...
{-# OPTIONS --without-K #-} open import HoTT open import cohomology.Exactness open import cohomology.Choice module cohomology.Theory where record CohomologyTheory i : Type (lsucc i) where field C : ℤ → Ptd i → Group i CEl : ℤ → Ptd i → Type i CEl n X = Group.El (C n X) Cid : (n : ℤ) (X : Ptd i) → CEl n...
{-# OPTIONS --cubical --safe #-} module Relation.Nullary.Discrete.FromBoolean where open import Prelude open import Relation.Nullary.Discrete module _ {a} {A : Type a} (_≡ᴮ_ : A → A → Bool) (sound : ∀ x y → T (x ≡ᴮ y) → x ≡ y) (complete : ∀ x → T (x ≡ᴮ x)) where from-bool-...
module calculus-examples where open import Data.List using (List ; _∷_ ; [] ; _++_) open import Data.List.Any using (here ; there ; any) open import Data.List.Any.Properties open import Data.OrderedListMap open import Data.Sum using (inj₁ ; inj₂ ; _⊎_) open import Data.Maybe.Base open import Data.Empty using (⊥ ; ⊥-el...
interleaved mutual -- we don't do `data A : Set` data A where -- you don't have to actually define any constructor to trigger the error, the "where" is enough data B where b : B
module getline where -- https://github.com/alhassy/AgdaCheatSheet#interacting-with-the-real-world-compilation-haskell-and-io open import Data.Nat using (ℕ; suc) open import Data.Nat.Show using (show) open import Data.Char using (Char) open import Data.List as L...
open import Level using () renaming (_⊔_ to _⊔ˡ_) open import Relation.Binary using (_⇒_; TotalOrder; Reflexive; Symmetric; Transitive; IsEquivalence; IsPreorder; Antisymmetric) module AKS.Extended {c ℓ₁ ℓ₂} (≤-totalOrder : TotalOrder c ℓ₁ ℓ₂) where open TotalOrder ≤-totalOrder using (_≈_; _≤_; total; isEquivalence...
{-# OPTIONS --without-K --rewriting #-} open import lib.Basics open import lib.NType2 open import lib.types.Empty open import lib.types.Group open import lib.types.Int open import lib.types.List open import lib.types.Nat open import lib.types.Pi open import lib.types.Sigma module lib.types.Word {i} where module _ (A...
open import Agda.Builtin.List open import Agda.Builtin.Nat open import Agda.Builtin.Reflection open import Agda.Builtin.Unit open import Common.Product {-# TERMINATING #-} Loop : Set Loop = Loop postulate loop : Loop data Box (A : Set) : Set where box : A → Box A {-# TERMINATING #-} Boxed-loop : Set Boxed-loo...
-- V: letpair (x,y) = (V,W) in E --> E[ V,W / x,y ] module Properties.StepPair where open import Data.List open import Data.List.All open import Data.Product open import Relation.Nullary open import Relation.Binary.PropositionalEquality open import Typing open import Syntax open import Global open import Values open...
{-# OPTIONS --without-K #-} module Explore.README where -- The core types behind exploration functions open import Explore.Core -- The core properties behind exploration functions open import Explore.Properties -- Lifting the dependent axiom of choice to sums and products open import Explore.BigDistr -- Constructio...
open import Relation.Binary using (IsDecEquivalence) open import Agda.Builtin.Equality module UnifyMguCorrectG (FunctionName : Set) ⦃ isDecEquivalenceA : IsDecEquivalence (_≡_ {A = FunctionName}) ⦄ (PredicateName VariableName : Set) where open import UnifyTermF FunctionName open import UnifyMguF FunctionName open im...
module Ordinals where import Level open import Data.Product open import Relation.Binary.PropositionalEquality open import Function open import Data.Nat using (ℕ) renaming (zero to z; suc to s) open import Data.Empty postulate ext₀ : Extensionality Level.zero Level.zero ext₁ : Extensionality Level.zero (Level.suc ...