text stringlengths 4 690k |
|---|
module examplesPaperJFP.CounterCell where
open import Data.Product
open import Data.Nat.Base
open import Data.Nat.Show
open import Data.String.Base using (String; _++_)
open import Size
-- open import NativeIO
-- open import SizedIO.Base
-- open import SizedIO.Object
-- open import SizedIO.IOObject
-- open import S... |
module bools where
open import lib
----------------------------------------------------------------------
-- these problems are about the nand operator, also known as the Scheffer stroke
----------------------------------------------------------------------
nand-not : ∀ (b : 𝔹) → ~ b ≡ b nand b
nand-not tt =... |
{-# OPTIONS --without-K --rewriting #-}
open import HoTT
open import cohomology.ChainComplex
open import cohomology.Theory
open import groups.KernelImage
open import cw.CW
module cw.cohomology.ReconstructedCochainComplex {i : ULevel} (OT : OrdinaryTheory i) where
open OrdinaryTheory OT
import cw.cohomology.TipAn... |
module Cats.Util.Logic.Constructive where
open import Data.Empty public
using (⊥ ; ⊥-elim)
open import Data.Product public
using (_,_ ; ∃-syntax ; Σ-syntax)
renaming (_×_ to _∧_ ; proj₁ to ∧-eliml ; proj₂ to ∧-elimr)
open import Data.Sum public
using ()
renaming (_⊎_ to _∨_ ; inj₁ to ∨-introl ; inj₂ to ∨-int... |
{-# OPTIONS --safe #-}
module Cubical.Algebra.Group.Instances.DiffInt where
open import Cubical.Foundations.Prelude
open import Cubical.Data.Int.MoreInts.DiffInt renaming ( _+_ to _+ℤ_ ; _-_ to _-ℤ_)
open import Cubical.Algebra.Group.Base
open import Cubical.HITs.SetQuotients
open GroupStr
ℤGroup : Group₀
fst ℤGr... |
{-# OPTIONS --safe --warning=error --without-K #-}
open import LogicalFormulae
open import Groups.Groups
open import Groups.Homomorphisms.Definition
open import Groups.Definition
open import Numbers.Naturals.Naturals
open import Setoids.Setoids
open import Functions.Definition
open import Sets.EquivalenceRelations
ope... |
-- {-# OPTIONS --sized-types #-}
module Issue166NotSized where
postulate
Size : Set
↑_ : Size → Size
∞ : Size
-- {-# BUILTIN SIZE Size #-}
-- {-# BUILTIN SIZESUC ↑_ #-}
-- {-# BUILTIN SIZEINF ∞ #-}
data ⊥ : Set where
module M (A : Set) where
data SizedNat : {i : Size} → Set where
zero : {... |
------------------------------------------------------------------------
-- Total parser combinators (very short version)
-- Nils Anders Danielsson
------------------------------------------------------------------------
module Short where
open import Category.Monad
open import Coinduction
open import Data.Bool
impor... |
------------------------------------------------------------------------
-- The Agda standard library
--
-- A solver that uses reflection to automatically obtain and solve
-- equations over rings.
------------------------------------------------------------------------
{-# OPTIONS --without-K --safe #-}
module Tactic... |
{-# OPTIONS --without-K #-}
open import homotopy.3x3.Common
open import homotopy.3x3.PushoutPushout
open import homotopy.3x3.Transpose
module homotopy.JoinAssoc3x3 {i} (A B C : Type i) where
open M using (Pushout^2)
join-assoc-span^2 : Span^2 {i}
join-assoc-span^2 =
span^2 A (A × C) (A × C) (A × B) ((A × B) × C) ... |
{-# OPTIONS --safe --without-K #-}
module Categories.Examples.Monad.Duration where
-- Monad induced by pairing a Monoid and a Setoid
open import Level
open import Function.Base using (_-⟪_⟫-_; _on_; _∘_) renaming (id to id→)
open import Function.Equality using (Π; _⟨$⟩_; cong)
open import Relation.Binary
open import... |
module LongList where
infixr 6 _∷_
data List (A : Set) : Set where
[] : List A
_∷_ : A -> List A -> List A
postulate
Bool : Set
t : Bool
long : List Bool
long =
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷
t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ t ∷ ... |
{-# OPTIONS --rewriting --prop --exact-split #-}
open import common
{-
An arity is something of the form (((n_1, k_1), …, (n_l, k_l)) , k), where the n_i are natural
numbers and the k_i and k are sorts. We will use two different types of sorts, so we parametrize
arities by the type of sorts.
The type [ArityArgs Sort]... |
{-# OPTIONS --cubical --safe --postfix-projections #-}
module Relation.Nullary.Decidable.Logic where
open import Prelude
open import Data.Sum
open import Relation.Nullary.Decidable
disj : (A → C) → (B → C) → (¬ A → ¬ B → ¬ C) → Dec A → Dec B → Dec C
disj l r n x y .does = x .does or y .does
disj l r n (yes x) y .why... |
{-# OPTIONS --without-K #-}
module Pif2 where
{-- 2 paths --}
open import Level using (Level; _⊔_) renaming (zero to lzero; suc to lsuc)
open import Relation.Binary.PropositionalEquality
using (_≡_; refl; sym; trans; subst; subst₂; cong; cong₂; setoid;
inspect; [_]; proof-irrelevance; module ≡-Reasoning... |
{-# OPTIONS --without-K --rewriting #-}
open import lib.Basics
open import lib.NType2
open import lib.types.Group
open import lib.types.Word
open import lib.groups.GeneratedAbelianGroup
open import lib.groups.GeneratedGroup
open import lib.groups.GroupProduct
open import lib.groups.Homomorphism
open import lib.groups.... |
{-# OPTIONS --without-K --safe #-}
module Categories.Enriched.Over.One where
open import Level
open import Categories.Category.Monoidal.Instance.One
open import Categories.Enriched.Category
TruthValue : (o ℓ e t : Level) → Set (o ⊔ ℓ ⊔ e ⊔ suc t)
TruthValue o ℓ e t = Category (One-Monoidal {o} {ℓ} {e}) t
|
{-# OPTIONS --without-K --safe #-}
module Util.HoTT.Equiv.Core where
open import Util.Prelude
open import Util.HoTT.HLevel.Core
infix 4 _≅_ _≃_
private
variable
α β γ : Level
A B C : Set α
Injective : (f : A → B) → Set _
Injective f = ∀ {x y} → f x ≡ f y → x ≡ y
record IsIso {A : Set α} {B : Set β} (... |
module Nat where
data Nat : Set
data Nat where
zero : Nat
suc : Nat -> Nat
plus : Nat -> Nat -> Nat
plus zero n = n
plus (suc m) n = suc (plus m n)
elim : (P : (n : Nat) -> Set) ->
(z : P (plus zero zero)) ->
(s : (n : Nat) -> P (plus zero n) -> P (plus (suc zero) n)) ->
(n : Nat) -> P ... |
module Oscar.Category where
open import Oscar.Level
open import Oscar.Function
record Setoid {𝔬} (𝔒 : Ø 𝔬) 𝔮 : Ø 𝔬 ∙̂ ↑̂ 𝔮 where
infix 4 _≋_
field
_≋_ : 𝔒 → 𝔒 → Ø 𝔮
≋-reflexivity : ∀ {x} → x ≋ x
≋-symmetry : ∀ {x y} → x ≋ y → y ≋ x
≋-transitivity : ∀ {x y} → x ≋ y → ∀ {z} → y ≋ z → x ≋ z... |
module consoleExamples.simpleLoop where
open import ConsoleLib
open import Data.Bool renaming (not to ¬)
open import Data.String hiding (_==_)
open import SizedIO.Base
open import Size
-- the following program asks the user for an input, which is a string.
-- It converts this string into a Boolean value (by mapping "... |
module DoBlock3 where
data Id
(A : Set)
: Set
where
id
: A
→ Id A
_>>=_
: {A B : Set}
→ Id A
→ (A → Id B)
→ Id B
id x >>= f
= f x
_>>_
: {A B : Set}
→ Id A
→ Id B
→ Id B
_ >> y
= y
f
: {A : Set}
→ A
→ Id A
f x
= do
id x
id x
|
module Numeral.Natural.UnclosedOper where
import Lvl
open import Data
open import Data.Boolean.Stmt
open import Data.Option as Option using (Option)
open import Data.Option.Functions as Option
open import Logic.Propositional
open import Numeral.Finite as 𝕟
using (𝕟)
import Numeral.Finite.Bound as 𝕟bound
open... |
open import Type
module Structure.Operator.SetAlgebra {ℓ} (S : Type{ℓ}) where
import Lvl
open import Functional
open import Logic
open import Logic.Propositional
open import Relator.Equals
open import Relator.Equals.Proofs
open import Structure.Operator.Properties
open import Structure.Operator.Proofs
open impor... |
module ImportTests.ExtractDependent where
open import Data.Bool
open import Data.Nat
open import ExtractDependent
f : ℕ -> Bool
f 0 = false
f _ = true
testApply : Bool
testApply = apply _ _ f 5
testApplyImp : Bool
testApplyImp = applyImp f 6
testApplyImpSameName : Bool
testApplyImpSameName = applyImpSameName {ℕ} ... |
------------------------------------------------------------------------
-- The Agda standard library
--
-- Values for AVL trees
-- Values must respect the underlying equivalence on keys
-----------------------------------------------------------------------
{-# OPTIONS --without-K --safe #-}
open import Relation.Bin... |
module Thesis.Subst where
--------------------------------------------------------------------------------
-- Prove substitution lemma. Unfortunately, this is done using a quite different
-- machinery from what we use elsewhere. The machinery for defining substitution
-- is taken from a formalization of hereditary sub... |
------------------------------------------------------------------------------
-- Abelian group base
------------------------------------------------------------------------------
{-# OPTIONS --exact-split #-}
{-# OPTIONS --no-sized-types #-}
{-# OPTIONS --no-universe-polymorphism #-}
{-# OPTION... |
-- Agda Sample File
-- https://github.com/agda/agda/blob/master/examples/syntax/highlighting/Test.agda
-- This test file currently lacks module-related stuff.
{- Nested
{- comment. -} -}
module Test where
infix 12 _!
infixl 7 _+_ _-_
infixr 2 -_
postulate x : Set
f : (Set -> Set -> Set) -> Set
f _*_ = x * x... |
{-
This second-order term syntax 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 Data.Either.Multi where
open import Data
open import Data.Either
import Data.Tuple.Raiseᵣ.Functions as Raise
open import Data.Tuple.RaiseTypeᵣ
open import Data.Tuple.RaiseTypeᵣ.Functions
open import Data.Tuple using (_⨯_ ; _,_)
open import Function.Multi
open import Function.Multi.Functions
import Lvl... |
{-# OPTIONS --allow-unsolved-metas #-}
module FindTermNode where
open import TermNode
open import OscarPrelude
record FindTermNode (A : Set) : Set
where
field
findTermNode : A → TermNode → Maybe TermNode
open FindTermNode ⦃ … ⦄ public
open import TermCode
open import Term
open import Element
instance
Find... |
module Relator.Congruence.Proofs where
import Lvl
open import Functional
open import Logic.Propositional
open import Logic.Predicate
-- TODO: open import Structure.Function.Domain
open import Structure.Relator.Equivalence
open import Structure.Relator.Properties
open import Relator.Congruence
open import Relator.... |
{-# OPTIONS --without-K --safe #-}
open import Categories.Category
-- Exponential Object
-- TODO: Where is the notation from? It is neither from Wikipedia nor the nLab.
module Categories.Object.Exponential {o ℓ e} (𝒞 : Category o ℓ e) where
open Category 𝒞
open import Level
open import Function using (_$_)
open ... |
{-# OPTIONS --without-K --safe #-}
open import Relation.Binary.Core
module Morphism.Structures where
open import Algebra
import Algebra.Morphism.Definitions as MorphismDefinitions
open import Level using (Level; _⊔_)
import Function.Definitions as FunctionDefinitions
open import Relation.Binary.Morphism.Structures
o... |
-- Andreas, 2015-05-02, issue reported by Gabe Dijkstra
open import Common.Prelude
open import Common.Equality
data T : Set where
c0 : ⊥ → T
c1 : ⊥ → T
-- The following should not pass, as c0 and c1 are not fully applied.
c0≠c1 : c0 ≡ c1 → ⊥
c0≠c1 ()
-- The latter conflicts with function extensionality.
postulat... |
{-# OPTIONS --without-K --safe #-}
module Categories.Morphism.Cartesian where
open import Level
open import Categories.Category
open import Categories.Functor
private
variable
o ℓ e : Level
C D : Category o ℓ e
record Cartesian (F : Functor C D) {X Y} (f : C [ X , Y ]) : Set (levelOfTerm F) where
priva... |
module Issue1232.Nat where
|
------------------------------------------------------------------------
-- The Agda standard library
--
-- An inductive definition for the permutation relation
------------------------------------------------------------------------
{-# OPTIONS --without-K --safe #-}
module Data.List.Relation.Binary.Permutation.Prop... |
-- Andreas, 2017-11-19, issue #2854
-- Agda should not complain about "possibly empty type of sizes"
-- if the SIZELT builtin is not bound.
data Tree : Set₁ where
node : {A : Set} (f : A → Tree) → Tree
const : Tree → Tree
const t = node λ x → t
-- WAS:
-- Failed to solve the following constraints:
-- Is not emp... |
module DSession where
open import Data.Bool
open import Data.Fin
open import Data.Empty
open import Data.List
open import Data.List.All
open import Data.Maybe hiding (All)
open import Data.Nat
open import Data.Product
open import Data.Sum
open import Data.Unit
open import Function using (_$_)
open import Relation.Null... |
module Hwequivalence where
open import Relation.Binary.PropositionalEquality
open import Data.Bool
-- A 1-bit adder
bit-adder-spec : Bool → Bool → Bool → Bool
bit-adder-spec A B C = X ∧ Y
where
X : Bool
X = (A ∧ not B ∧ not C)
∨
(not A ∧ B ∧ not C)
∨
(not A ∧ not B ∧ C)
∨
(A ... |
{-# 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... |
open import Data.Product using ( _×_ ; _,_ )
open import Relation.Unary using ( _∈_ )
open import Web.Semantic.DL.FOL using ( Formula ; _∈₂_ ; _∈₂_⇒_ )
open import Web.Semantic.DL.FOL.Model using ( _⊨f_ )
open import Web.Semantic.DL.Role using ( Role ; ⟨_⟩ ; ⟨_⟩⁻¹ )
open import Web.Semantic.DL.Role.Model using ( _⟦_⟧₂... |
-- Inductively constructed substitution maps
module SOAS.ContextMaps.Inductive {T : Set} where
open import SOAS.Common
open import SOAS.Context
open import SOAS.Sorting
open import SOAS.Families.Core {T}
open import SOAS.Variable
private
variable
α : T
Γ Δ : Ctx
𝒳 𝒴 : Familyₛ
-- A list of terms in c... |
------------------------------------------------------------------------------
-- The division program is correct
------------------------------------------------------------------------------
{-# OPTIONS --exact-split #-}
{-# OPTIONS --no-sized-types #-}
{-# OPTIONS --no-universe-polymorphism #... |
{-# OPTIONS --universe-polymorphism #-}
module UniversePolymorphicFunctor where
postulate
Level : Set
zero : Level
suc : (i : Level) → Level
_⊔_ : Level → Level → Level
{-# BUILTIN LEVEL Level #-}
{-# BUILTIN LEVELZERO zero #-}
{-# BUILTIN LEVELSUC suc #-}
{-# BUILTIN LEVELMAX _⊔_ #-}
infixl 6 _... |
-- Andreas, 2011-04-15
-- {-# OPTIONS -v tc.meta:20 #-}
module SameMeta where
infix 10 _≡_
data _≡_ {A : Set}(a : A) : A -> Set where
refl : a ≡ a
infixr 5 _×_ _,_
data _×_ (A B : Set) : Set where
_,_ : A -> B -> A × B
postulate A : Set
same : let X : A -> A -> A -> A × A
X = _
in {x y z : A... |
{-# OPTIONS --cubical --safe #-}
module Function.Isomorphism where
open import Cubical.Foundations.Equiv using (isoToEquiv) public
open import Cubical.Foundations.Isomorphism using (Iso; section; retract; isoToPath; iso) public
open import Level
open import Path
open import Function
open import Data.Sigma
open import... |
-- Andreas, 2015-05-06, issue reported by Nisse
postulate
_ : Set
postulate
_ : Set
-- Error message WAS: "Multiple definitions of _."
-- BUT: If the first occurrence of _ is accepted, then the second one
-- should also be accepted.
-- Error NOW: "Invalid name: _"
|
{-# OPTIONS --without-K #-}
module hott.equivalence where
open import hott.equivalence.alternative public
open import hott.equivalence.core public
open import hott.equivalence.properties public
open import hott.equivalence.inverse public
-- open import hott.equivalence.coind public
|
-- Andreas, 2016-08-04, issue #964
-- Allow open metas and interaction points in imported files
{-# OPTIONS --allow-unsolved-metas #-}
-- {-# OPTIONS -v import:100 #-}
-- {-# OPTIONS -v meta.postulate:20 #-}
-- {-# OPTIONS -v tc.meta:25 #-}
-- Andreas, 2016-10-09, while working on issue #2223:
--
-- This module is a... |
{-# OPTIONS --without-K --exact-split --safe #-}
open import Fragment.Algebra.Signature
module Fragment.Algebra.Homomorphism.Properties (Σ : Signature) where
open import Fragment.Algebra.Algebra Σ
open import Fragment.Algebra.Homomorphism.Base Σ
open import Fragment.Algebra.Homomorphism.Setoid Σ
open import Level u... |
------------------------------------------------------------------------
-- The Agda standard library
--
-- Environments (heterogeneous collections)
------------------------------------------------------------------------
{-# OPTIONS --with-K --safe #-}
module Data.Star.Environment {ℓ} (Ty : Set ℓ) where
open import... |
-- | Stuff regarding isomorphisms and isomorphic data structures.
module Isomorphisms where
open import Function
open import Relation.Binary.PropositionalEquality as P
using (_≡_; refl; sym; trans; cong; module ≡-Reasoning)
open ≡-Reasoning
record IsIso {A B : Set} (f : A → B) : Set where
field
inv : B → A
... |
------------------------------------------------------------------------
-- The Agda standard library
--
-- A binary representation of natural numbers
------------------------------------------------------------------------
module Data.Bin where
open import Data.Nat as Nat
using (ℕ; zero; z≤n; s≤s) renaming (suc to... |
{-# OPTIONS --without-K --rewriting #-}
open import HoTT
open import homotopy.EM1HSpace
open import homotopy.EilenbergMacLane
open import homotopy.EilenbergMacLane1
open import homotopy.EM1HSpace
open import homotopy.EM1HSpaceAssoc
module homotopy.EilenbergMacLaneFunctor where
open EMExplicit
module _ {i j} {G : Gr... |
{-# OPTIONS --guardedness #-}
module Issue728 where
open import Common.MAlonzo using () renaming (main to mainDefault)
main = mainDefault
|
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... |
module Data.List.Exts where
open import Class.Equality
open import Class.Monad
open import Class.Functor
open import Data.Bool hiding (_≟_)
open import Data.List
open import Data.Maybe using (Maybe; just; nothing)
open import Data.Maybe.Instance
open import Data.Nat using (ℕ; zero; suc; _⊔_)
open import Data.Product
o... |
{-# OPTIONS --rewriting --prop #-}
open import common
open import syntx
open import derivability
open import structuralrules
open import typingrules
open import typetheories
module _ where
{- Π-Types + a dependent type -}
module _ where
TypingRuleΠ : TypingRule (TTDer ◇) ([] , (0 , Ty) , (1 , Ty)) Ty
TypingRul... |
-- agad-modeの使い方
-- https://agda.readthedocs.io/en/latest/tools/emacs-mode.html
{-# OPTIONS --without-K --safe #-}
module Learn.Interactive where
-- ロード
-- タイプチェックする
-- C-c C-l
-- Ctrlを押しながら、cを押して次にlを押す
-- このとき、ソース内に"?"が存在すればそれをゴールにする
-- ゴールには番号が振られる
-- 型推論する
-- C-c C-d
-- 評価する
-- C-c C-n
-- 終了させる
-- C-c C-x C-q
--... |
module Ual.Both where
infix 10 _∧_
record _∧_ (A B : Set) : Set where
field
andL : A
andR : B
|
{-# OPTIONS --without-K #-}
open import Function
open import Data.Zero
open import Relation.Binary.PropositionalEquality.NP
open import Explore.Zero
import Explore.Universe.Type
import Explore.Universe
open import Function.Extensionality
open import Type.Identities
open import HoTT
open Equivalences
module Explore.Uni... |
-- Andreas, 2019-02-23, re #3578, less reduction in the unifier.
-- Non-interactive version of interaction/Issue635c.agda.
-- {-# OPTIONS -v tc.lhs.unify:50 #-}
open import Common.Bool
open import Common.Equality
open import Common.Product
test : (p : Bool × Bool) → proj₁ p ≡ true → Set
test _ refl = Bool
-- Tests ... |
{-# OPTIONS --without-K --safe #-}
module Fragment.Examples.Semigroup.Arith.Functions where
open import Fragment.Examples.Semigroup.Arith.Base
-- Fully dynamic associativity
+-dyn-assoc₁ : ∀ {f : ℕ → ℕ} {m n o} → (f m + n) + o ≡ f m + (n + o)
+-dyn-assoc₁ = fragment SemigroupFrex +-semigroup
+-dyn-assoc₂ : ∀ {f g ... |
-- Abstract definitions can't be projection-like
module Issue447 where
postulate
I : Set
R : I → Set
module M (i : I) (r : R i) where
abstract
P : Set₂
P = Set₁
p : P
p = Set
|
module Rationals where
open import Nats renaming (_+_ to _:+:_; _*_ to _:*:_)
open import Equality
open import Data.Product
open import Agda.Builtin.TrustMe
infixl 7 _÷_
infixr 5 _→ℕ
infixr 7 _÷_↓_
infixr 7 _÷_↑_
infixl 6 _+_
data ℚ : Set where
_÷_ : (a b : ℕ) → ℚ
_→ℕ : {a : ℕ} → ℚ → ∃ (λ m → m ≡ a)
_→ℕ {a} _ = a... |
module Implicits.Resolution.Infinite.Expressiveness where
open import Prelude hiding (Bool)
open import Data.Fin.Substitution
open import Data.List
open import Data.List.Any
open Membership-≡
open import Extensions.ListFirst
open import SystemF.Everything as F using ()
open import Implicits.Resolution.Ambiguous.Res... |
module Issue493 where
module M where
postulate A B C : Set
open M using (A) hiding (B)
|
{-# OPTIONS --safe --warning=error --without-K #-}
open import LogicalFormulae
open import Rings.Definition
open import Rings.IntegralDomains.Definition
open import Fields.Fields
open import Setoids.Setoids
open import Sets.EquivalenceRelations
module Fields.FieldOfFractions.Field {a b : _} {A : Set a} {S : Setoid {... |
module Data.List.Combinatorics.Proofs where
import Lvl
open import Data
open import Data.List
open import Data.List.Combinatorics
open import Data.List.Functions hiding (skip) renaming (module LongOper to List)
open Data.List.Functions.LongOper
open import Data.List.Relation.Permutation
open import Data.Li... |
{-# OPTIONS --type-in-type #-}
open import Function
open import Data.Nat.Base
open import Data.Bool.Base
open import Data.Product
{-# NO_POSITIVITY_CHECK #-}
record IFix {I : Set} (F : (I -> Set) -> I -> Set) (i : I) : Set where
constructor wrap
field unwrap : F (IFix F) i
open IFix
data Expr : Set -> Set where
... |
------------------------------------------------------------------------
-- Lists
------------------------------------------------------------------------
{-# OPTIONS --without-K --safe #-}
open import Equality
module List
{reflexive} (eq : ∀ {a p} → Equality-with-J a p reflexive) where
open import Prelude
open ... |
module Optics.Prism where
open import Agda.Primitive using (Level; _⊔_; lsuc)
open import Data.Product using (_×_; _,_; ∃-syntax; Σ-syntax)
open import Data.Sum using (_⊎_; inj₁; inj₂; fromInj₂)
open import Data.Empty using (⊥-elim)
open import Function.Inverse using (_↔_; inverse)
open import Relation.Binary.Propositi... |
module product-thms where
open import eq
open import level
open import product
open import unit
open import functions
-- this is called the inspect idiom, in the Agda stdlib
keep : ∀{ℓ}{A : Set ℓ} → (x : A) → Σ A (λ y → x ≡ y)
keep x = ( x , refl )
,inj : ∀{ℓ ℓ'}{A : Set ℓ}{B : Set ℓ'}{a a' : A}{b b' : B} →
... |
{-# OPTIONS --cubical --safe --prop #-}
open import Algebra
open import Prelude
open import Relation.Binary.Equivalence.PropTruncated
module Algebra.Construct.Cayley.Propositional {a} (mon : Monoid a) where
open Monoid mon
record 𝒞 : Type a where
constructor cayley
infixr 7 _⇓_
field
_⇓_ : 𝑆 → 𝑆
sm... |
------------------------------------------------------------------------
-- The Agda standard library
--
-- Boolean algebra expressions
------------------------------------------------------------------------
{-# OPTIONS --without-K --safe #-}
open import Algebra
module Algebra.Properties.BooleanAlgebra.Expression
... |
module Syntax where
open import Agda.Builtin.FromNat public
open import Agda.Builtin.FromNeg public
record plus-syntax (A : Set) (B : A → Set) (C : ∀ x → B x → Set) : Set where
infixl 6 _+_
field _+_ : ∀ x (y : B x) → C x y
plus-syntax-simple = λ A B C → plus-syntax A (λ _ → B) (λ _ _ → C)
open plus-syntax {{…}... |
{-# OPTIONS --without-K --safe #-}
module Categories.Category.Lift where
open import Level
open import Categories.Category
open import Categories.Functor using (Functor)
liftC : ∀ {o ℓ e} o′ ℓ′ e′ → Category o ℓ e → Category (o ⊔ o′) (ℓ ⊔ ℓ′) (e ⊔ e′)
liftC o′ ℓ′ e′ C = record
{ Obj = Lift o′ Obj
; _⇒_ ... |
module L.Base.Id.Properties where
open import L.Base.Id.Core
sym : ∀{a} {A : Set a} {x y : A} → x ≡ y → y ≡ x
sym {x = x}{y = y} = λ p → J (λ a b _ → b ≡ a) (λ _ → refl) x y p
tran : ∀{a} {A : Set a} {x y z : A} → x ≡ y → y ≡ z → x ≡ z
tran {x = x}{y = y}{z = z} =
λ p → J (λ a b p → b ≡ z → a ≡ z) (λ a q → q) x... |
module BadInductionRecursion1 where
data Unit : Set where
unit : Unit
mutual
data D : Set where
d : forall u -> (D′ u -> D′ u) -> D
D′ : Unit -> Set
D′ unit = D
_·_ : D -> D -> D
d unit f · x = f x
ω : D
ω = d unit (\x -> x · x)
Ω : D
Ω = ω · ω
|
------------------------------------------------------------------------------
-- The FOTC co-inductive natural numbers type
------------------------------------------------------------------------------
{-# OPTIONS --exact-split #-}
{-# OPTIONS --no-sized-types #-}
{-# OPTIONS --no-universe-pol... |
module Connectives where
-- Imports
import Relation.Binary.PropositionalEquality as Eq
open Eq using (_≡_; refl; cong)
open Eq.≡-Reasoning
open import Data.Nat using (ℕ)
open import Function using (_∘_)
-- open import plfa.part1.Isomorphism using (_≃_; _≲_; extensionality)
-- open plfa.part1.Isomorphism.≃-Reasoning
... |
module Numeral.Natural.Oper.Proofs.Order where
open import Functional
open import Logic
open import Logic.Propositional
open import Logic.Propositional.Theorems
open import Numeral.Natural
open import Numeral.Natural.Oper
open import Numeral.Natural.Oper.Proofs
open import Numeral.Natural.Relation.Order
open import Nu... |
{-# OPTIONS --without-K #-}
module Pi1 where
open import Data.List
open import Data.Nat
open import Data.Empty
open import Data.Unit
open import Data.Sum
open import Data.Product
open import Relation.Binary.PropositionalEquality
open ≡-Reasoning
open import Groupoid
infix 2 _□
infixr 2 _⟷⟨_⟩_
infix 2 ... |
open import Agda.Primitive
open import Agda.Builtin.Nat
open import Agda.Builtin.Equality
variable
ℓ : Level
A : Set ℓ
n : Nat
infixr 4 _∷_
data Vec (A : Set) : Nat → Set where
[] : Vec A 0
_∷_ : A → Vec A n → Vec A (suc n)
variable
xs : Vec A n
data T (n : Nat) (f : Nat → Nat) : Set where
it : T... |
{-# OPTIONS --allow-unsolved-metas #-}
postulate
Foo : Set
record BaseT : Set₁ where
field f : Foo
record ParamT (p : Foo) : Set₁ where
field f : Foo
instance
postulate asBaseT : ∀ {p} → ParamT p → BaseT
-- BaseT.f (asBaseT p) = ParamT.f p
data Bar : Set where
o : Bar
data Baz {{_ : BaseT}} : Bar → Set ... |
{-# OPTIONS --cubical --no-import-sorts --no-exact-split --safe #-}
module Cubical.Experiments.NatMinusTwo.ToNatMinusOne where
open import Cubical.Foundations.Prelude
open import Cubical.Foundations.Isomorphism
open import Cubical.Data.NatMinusOne as ℕ₋₁ using (ℕ₋₁)
open import Cubical.Experiments.NatMinusTwo.Base as... |
-- Andreas, 2016-06-26, issue #2059 reported by IanOrton
-- An irrelevant parameter in a rewrite rule should still
-- be bound by the lhs.
{-# OPTIONS --rewriting #-}
-- {-# OPTIONS -v tc.pos:10 #-}
-- {-# OPTIONS -v tc.polarity:10 #-}
open import Common.Equality
open import Common.Bool
data ⊥ : Set where
⊥-elim ... |
module Data.Num.Surjection where
open import Data.Num.Core
open import Data.Num.Continuous
open import Data.Nat
open import Data.Nat.Properties
open import Data.Nat.Properties.Simple
open import Data.Nat.Properties.Extra
open import Data.Fin as Fin
using (Fin; fromℕ≤; inject≤)
renaming (zero to z; suc to s)
... |
{-# OPTIONS --cubical --no-import-sorts --safe #-}
module Cubical.HITs.Localization where
open import Cubical.HITs.Localization.Base public
open import Cubical.HITs.Localization.Properties public
|
data ⊥ : Set where
postulate
∞ : ∀ {a} → Set a → Set a
♯_ : ∀ {a} {A : Set a} → (A → ⊥) → ∞ A
♭ : ∀ {a} {A : Set a} → ∞ A → A → ⊥
{-# BUILTIN INFINITY ∞ #-}
{-# BUILTIN SHARP ♯_ #-}
{-# BUILTIN FLAT ♭ #-}
-- Issue #5610: with these bad types for sharp and flat, we can prove
-- false. The reason is ... |
-- Andreas, 2021-08-19, issue #5283, reported by guilhermehas
-- 'tactic' should only appear in attributes and 'C.Tactic' is converted to
-- 'TacticAttribute' there.
-- Other occurrences of 'C.Tactic' should be a scope error.
-- At the time of writing, the scope checker passes it as A.Tactic to the type
-- checker, an... |
{-# OPTIONS --allow-unsolved-metas #-}
open import Agda.Builtin.Equality
postulate @0 A : Set
@0 f : (X : Set) → A ≡ X → Set
f X refl = {!!}
|
{-# OPTIONS --no-positivity-check
--no-termination-check
#-}
-- A universe setoids
module Setoid where
import Chain
record True : Set where
data False : Set where
Rel : Set -> Set1
Rel A = A -> A -> Set
Pred : Set -> Set1
Pred A = A -> Set
Resp : {A : Set} -> Rel A -> {B : Set} -> Rel B -> Pred (A -... |
module Tactic.Reflection.DeBruijn where
open import Prelude hiding (abs)
open import Builtin.Reflection
open import Container.Traversable
record DeBruijn {a} (A : Set a) : Set a where
field
strengthenFrom : (from n : Nat) → A → Maybe A
weakenFrom : (from n : Nat) → A → A
strengthen : Nat → A → Maybe... |
{-
A Cubical proof of Blakers-Massey Theorem (KANG Rongji, Oct. 2021)
Based on the previous type-theoretic proof described in
Kuen-Bang Hou (Favonia), Eric Finster, Dan Licata, Peter LeFanu Lumsdaine,
"A Mechanization of the Blakers–Massey Connectivity Theorem in Homotopy Type Theory"
(https://arxiv.org/abs/160... |
-- Andreas, 2012-10-09
-- Testcase to ensure we do not fire catch all clause on neutrals in literal matching
module DoNotFireLiteralCatchAllForNeutrals where
{-# BUILTIN STRING String #-}
data ⊥ : Set where
record ⊤ : Set where
constructor trivial
NotNull : String → Set
NotNull "" = ⊥
NotNull s = ⊤ -- never reduc... |
-- Hurkens' paradox [1].
-- [1] A. Hurkens, A simplification of Girard's paradox.
{-# OPTIONS --type-in-type
#-}
module Hurkens where
⊥ : Set
⊥ = (A : Set) -> A
¬_ : Set -> Set
¬ A = A -> ⊥
P : Set -> Set
P A = A -> Set
U : Set
U = (X : Set) -> (P (P X) -> X) -> P (P X)
τ : P (P U) -> U
τ t = \X f p -> t \x -... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.