text stringlengths 4 690k |
|---|
module Sets.PredicateSet.Listable where
import Lvl
open import Data.List as List using (List)
open import Data.List.Functions renaming (_++_ to _∪ₗ_) using (singleton)
open import Data.List.Relation.Membership renaming (_∈_ to _∈ₗ_ ; _∈!_ to _∈!ₗ_) using (use ; skip)
open import Data.List.Relation.Permutation
ope... |
module SAcc where
data Size : Set where
s : Size -> Size
data Acc ( A : Set ) ( Lt : A -> A -> Set) : Size -> A -> Set where
acc : (i : Size) -> ( b : A )
-> ( ( a : A ) -> Lt a b -> Acc A Lt i a )
-> ( Acc A Lt (s i) b )
data Nat : Set where
zero : Nat
succ : Nat -> Nat
data Lt : Na... |
module _ where
open import Agda.Primitive
postulate
Equiv : ∀ {a b} → (A : Set a) (B : Set b) → Set (a ⊔ b)
{-# BUILTIN EQUIV Equiv #-}
|
module Oscar.Relation where
open import Oscar.Level
_⟨_⟩→_ : ∀ {a} {A : Set a} {b} → A → (A → Set b) → A → Set b
m ⟨ B ⟩→ n = B m → B n
Transitive : ∀ {a} {A : Set a} {b} (B : A → A → Set b) → Set (a ⊔ b)
Transitive B = ∀ {y z} → B y z → ∀ {x} → B x y → B x z
module _ {𝔬} {⋆ : Set 𝔬} {𝔪} {_↦_ : ⋆ → ⋆ → Set 𝔪} ... |
{-# OPTIONS --cubical --safe #-}
module Data.Bits.Equatable where
open import Data.Bits
open import Prelude
_≡ᴮ_ : Bits → Bits → Bool
[] ≡ᴮ [] = true
(0∷ xs) ≡ᴮ (0∷ ys) = xs ≡ᴮ ys
(1∷ xs) ≡ᴮ (1∷ ys) = xs ≡ᴮ ys
_ ≡ᴮ _ = false
open import Relation.Nullary.Discrete.FromBoolean
sound-== : ∀ n m →... |
{-# OPTIONS --without-K #-}
open import lib.Basics
open import lib.types.Bool
open import lib.types.Empty
open import lib.types.Lift
open import lib.types.Pointed
module lib.types.Coproduct where
module _ {i j} {A : Type i} {B : Type j} where
⊔-code : Coprod A B → Coprod A B → Type (lmax i j)
⊔-code (inl a₁) (i... |
{-# OPTIONS --without-K --rewriting #-}
module Agda.Builtin.Equality.Rewrite where
open import Agda.Builtin.Equality
{-# BUILTIN REWRITE _≡_ #-}
|
------------------------------------------------------------------------
-- The Agda standard library
--
-- The lifting of a non-strict order to incorporate a new supremum
------------------------------------------------------------------------
{-# OPTIONS --without-K --safe #-}
-- This module is designed to be used ... |
-- (Γ ⇒ Δ ∪ · A) → (Γ ⇒ Δ ∪ · (A ∨ B))
-- The conclusion (A ∨ B) is the principal/major formula of the rule.
-- The premiss A is the active/minor formula of the rule
-- Γ, Δ is the side formulas of the rule.
-- Γ ⇒ Δ
-- LHS Γ is the antecedent of the sequent.
-- RHS Γ is the consequent of the sequent.
|
{-# OPTIONS --sized-types --show-implicit #-}
module SizedNatAnnotated where
open import Size
data Nat : {i : Size} -> Set where
zero : {i : Size} -> Nat {↑ i}
suc : {i : Size} -> Nat {i} -> Nat {↑ i}
-- subtraction is non size increasing
sub : {i : Size} -> Nat {i} -> Nat {∞} -> Nat {i}
sub .{↑ i} (zero {i})... |
{-# OPTIONS --no-positivity-check #-}
module univ where
open import Base
open import Nat
import Logic.ChainReasoning
module Chain
{A : Set}( _==_ : A -> A -> Set)
(refl : {x : A} -> x == x)
(trans : {x y z : A} -> x == y -> y == z -> x == z) =
Logic.ChainReasoning.Mono.Homogenous _==_ (\x -> refl) (\x y z ->... |
{-# OPTIONS --rewriting #-}
module Examples where
import Examples.Syntax
import Examples.OpSem
import Examples.Run
import Examples.Type
|
------------------------------------------------------------------------
-- Untyped hereditary substitution in Fω with interval kinds
------------------------------------------------------------------------
{-# OPTIONS --safe --exact-split --without-K #-}
module FOmegaInt.Syntax.HereditarySubstitution where
open imp... |
postulate A : Set
postulate B : A → Set
variable a : A
foo : B a → Set
foo x = {!a!} -- WAS: C-c C-c here reports "Not a variable: a"
-- SHOULD instead introduce the hidden argument {a}
{- C-c C-e reports
a : A (not in scope)
x : B a
-}
|
{-# OPTIONS --safe --warning=error --without-K #-}
open import LogicalFormulae
open import Numbers.Naturals.Definition
module Numbers.Integers.Definition where
data ℤ : Set where
nonneg : ℕ → ℤ
negSucc : ℕ → ℤ
{-# BUILTIN INTEGER ℤ #-}
{-# BUILTIN INTEGERPOS nonneg #-}
{-# BUILTIN INTEGERNEGSUC n... |
-- This error never occurs.
module ShouldBeASort where
err = ShouldBeASort-Never-Occurs
|
------------------------------------------------------------------------
-- Some theory of Erased, developed using the K rule and propositional
-- equality
------------------------------------------------------------------------
-- This module instantiates and reexports code from Erased.
{-# OPTIONS --with-K --safe #... |
-- Andreas, 2015-02-07
-- {-# OPTIONS -v tc.with:40 #-}
open import Common.Prelude hiding (not)
not : Bool → Bool
not true = false
not false = true
T : Bool → Set → Set
T true A = A → A
T false A = Bool
test : (b : Bool) → (A : Set) → T (not b) A
test b with not b
test b | true = λ A a → a
test b | false = λ A... |
import Lvl
open import Type
module Data.List.Relation.Sublist {ℓ} {T : Type{ℓ}} where
open import Data.List using (List ; ∅ ; _⊰_)
open import Logic
-- Whether a list's elements are contained in another list in order.
-- Examples:
-- [1,2,3] ⊑ [1,2,3]
-- [1,2,3] ⊑ [1,2,3,4]
-- [1,2,3] ⊑ [0,1,2,3]
-- [1,... |
-- Andreas, 2018-06-30, issue #3147 reported by bafain
-- Pattern linearity ignored for as-patterns
-- {-# OPTIONS -v tc.lhs.top:30 #-}
-- {-# OPTIONS -v tc.lhs.linear:100 #-}
open import Agda.Builtin.Equality
open import Agda.Builtin.Nat
f : Nat → Nat
f zero = zero
f x@(suc x) = x -- rhs context:
... |
------------------------------------------------------------------------
-- The Agda standard library
--
-- Literals used in the reflection machinery
------------------------------------------------------------------------
{-# OPTIONS --without-K --safe #-}
module Reflection.Literal where
import Data.Char as Char
im... |
{-# OPTIONS --without-K --safe #-}
module Cats.Category.Cat.Facts.Initial where
open import Cats.Category
open import Cats.Category.Cat using (Cat)
open import Cats.Category.Zero using (Zero)
open import Cats.Functor
Absurd : ∀ {lo la l≈ lo′ la′ l≈′} (C : Category lo′ la′ l≈′)
→ Functor (Zero lo la l≈) C
Absurd C ... |
{-# OPTIONS --without-K #-}
open import lib.Basics
open import lib.types.Bool
open import lib.types.Coproduct
open import lib.types.Truncation
open import lib.types.Sigma
open import lib.types.Pi
open import lib.types.Fin
open import lib.types.Nat
open import lib.types.Empty
open import lib.NConnected
open import lib.... |
module left-kan-extensions where
open import functor
-- The left-kan extension of G along J.
record left-kan (G : Set → Set) (J : Set → Set) (pG : Functor G) (pJ : Functor J) : Set₁ where
field
lan : Set → Set
pLan : Functor lan
|
{-# OPTIONS --safe #-}
module Cubical.Algebra.CommRing.Properties where
open import Cubical.Foundations.Prelude
open import Cubical.Foundations.Equiv
open import Cubical.Foundations.Equiv.HalfAdjoint
open import Cubical.Foundations.HLevels
open import Cubical.Foundations.Isomorphism
open import Cubical.Foundations.Uni... |
------------------------------------------------------------------------
-- The Agda standard library
--
-- An implementation of the ring solver that requires you to manually
-- pass the equation you wish to solve.
------------------------------------------------------------------------
-- You'll probably want to use ... |
{-# OPTIONS --allow-unsolved-metas #-}
module LiteralProblem where
open import OscarPrelude
open import Problem
open import IsLiteralProblem
record LiteralProblem : Set
where
constructor ⟨_⟩
field
{problem} : Problem
isLiteralProblem : IsLiteralProblem problem
open LiteralProblem public
instance EqLite... |
module LC.Subst.Var where
open import Data.Nat
open import Data.Nat.Properties
open import Relation.Nullary
--------------------------------------------------------------------------------
-- variable binding
data Binding : ℕ → ℕ → Set where
Free : ∀ {n x} → (n≤x : n ≤ x) → Binding n x
Bound : ∀ {n x} → (n>x... |
{-# OPTIONS --without-K #-}
module WithoutK4 where
data _≡_ {A : Set} (x : A) : A → Set where
refl : x ≡ x
foo : (f : {A : Set} → A → A) {A : Set} (x y : A) →
x ≡ f y → f y ≡ x
foo f .(f y) y refl = refl
|
-- {-# OPTIONS --safe #-}
module Time where
open import Map
open import Relation.Binary.PropositionalEquality
open import Data.String using (String)
open import Data.Nat
open import Data.Nat.Base using (_≤_)
open import Data.Bool using (true ; false)
open import Data.Bool.Base using (if_then_else_)
open import Data.Ma... |
{-# OPTIONS --safe #-}
module Cubical.Algebra.Lattice.Base where
open import Cubical.Foundations.Prelude
open import Cubical.Foundations.Equiv
open import Cubical.Foundations.Equiv.HalfAdjoint
open import Cubical.Foundations.Function
open import Cubical.Foundations.HLevels
open import Cubical.Foundations.Isomorphism
o... |
Extensionality of a function of two arguments
\begin{code}
extensionality2 : ∀ {A B C : Set} → {f g : A → B → C} → (∀ (x : A) (y : B) → f x y ≡ g x y) → f ≡ g
extensionality2 fxy≡gxy = extensionality (λ x → extensionality (λ y → fxy≡gxy x y))
\end{code}
Isomorphism of all and exists.
\begin{code}
¬∃∀ : ∀ {A : Set} {B... |
open import Agda.Builtin.Nat
open import Agda.Builtin.Equality
_ : 10_000 * 100_000 ≡ 1_000_000_000
_ = refl
|
{-# OPTIONS --cubical-compatible #-}
module Common.Unit where
open import Agda.Builtin.Unit public renaming (⊤ to Unit; tt to unit)
|
------------------------------------------------------------------------
-- Spheres
------------------------------------------------------------------------
{-# OPTIONS --erased-cubical --safe #-}
-- This module follows the HoTT book rather closely.
import Equality.Path as P
module Sphere
{e⁺} (eq : ∀ {a p} → P.E... |
{-# OPTIONS --universe-polymorphism #-}
-- Level suc is not a constructor, and doesn't behave as one
-- for unification.
module LevelUnification where
open import Imports.Level
data _≡_ {a}{A : Set a}(x : A) : ∀ {b}{B : Set b} → B → Set where
refl : x ≡ x
sym : ∀ a b (A : Set (suc a))(B : Set (suc b))(x : A)(y : ... |
{-
Mathematical Foundations of Programming (G54FOP)
Nicolai Kraus
Lecture 6, 15 Feb 2018
-}
module lec6FOP where
{- We import everything we have done last week.
"open" means we can use all definitions directly -}
open import lec3FOP
{- Hint: middle mouse click or alt-.
[press alt/meta, then .]
jumps ... |
module Structure.Function.Ordering where
import Lvl
open import Logic
open import Logic.Propositional
open import Logic.Predicate
open import Type
module _ {ℓₒ₁ ℓₒ₂ ℓₗ₁ ℓₗ₂} {T₁ : Type{ℓₒ₁}} {T₂ : Type{ℓₒ₂}} (_≤₁_ : T₁ → T₁ → Type{ℓₗ₁}) (_≤₂_ : T₂ → T₂ → Type{ℓₗ₂}) where
record Increasing (f : T₁ → T₂) : Stmt{... |
-- Issue498: Underapplied projection-like functions did not evaluate correctly.
module Issue498 where
data ⊤ : Set where
tt : ⊤
data C : ⊤ → Set where
c : C tt
data C₂ : ⊤ → ⊤ → Set where
c : C₂ tt tt
module NoParams where
f₁ : ∀ a → C a → ⊤
f₁ a x = tt
f₁′ : ∀ a → C a → ⊤
f₁′ = f₁
check₁ : ∀ a x... |
module huffman-tree where
open import lib
data huffman-tree : Set where
ht-leaf : string → ℕ → huffman-tree
ht-node : ℕ → huffman-tree → huffman-tree → huffman-tree
-- get the frequency out of a Huffman tree
ht-frequency : huffman-tree → ℕ
ht-frequency (ht-leaf _ f) = f
ht-frequency (ht-node f _ _) = f
-- lower... |
-- Andreas, 2014-12-02, issue reported by Jesper Cockx
open import Common.Equality
mutual
Type : Set
type : Type
data Term : Type → Set where
set : Term type
Type = Term type
type = set
mutual
weakenType : Type → Type → Type
weaken : (ty ty' : Type) → Term ty → Term (weakenType ty' ty)
weakenTy... |
-- Intuitionistic propositional logic, vector-based de Bruijn approach, initial encoding
module Vi.Ip where
open import Lib using (Nat; suc; _+_; Fin; fin; Vec; _,_; proj; VMem; mem)
-- Types
infixl 2 _&&_
infixl 1 _||_
infixr 0 _=>_
data Ty : Set where
UNIT : Ty
_=>_ : Ty -> Ty -> Ty
_&&_ : T... |
module Selective.Libraries.ReceiveSublist where
open import Selective.ActorMonad public
open import Prelude
accept-sublist-unwrapped : (xs ys zs : InboxShape) → ∀{MT} → MT ∈ (xs ++ ys ++ zs) → Bool
accept-sublist-unwrapped [] [] zs p = false
accept-sublist-unwrapped [] (y ∷ ys) zs Z = true
accept-sublist-unwrapped []... |
module x where
open import Level
private
variable
a b c d e f ℓ p q r : Level
A : Set a
B : Set b
C : Set c
D : Set d
E : Set e
F : Set f
------------------------------------------------------------------------------
infixr 4 _,_
infixr 2 _^_
record _^_ (A : Set a) (B : Set b) : Set ... |
-- Andreas, 2021-04-22, issue #5339
-- Allow constructors of the same name in `constructor` block.
module _ where
module Works where
interleaved mutual
data Nat : Set
data Fin : Nat → Set
data _ where
zero : Nat
data _ where
suc : Nat → Nat
zero : ∀ {n} → Fin (suc n)
data _ w... |
------------------------------------------------------------------------
-- IO
------------------------------------------------------------------------
{-# OPTIONS --no-termination-check #-}
module IO where
open import Coinduction
open import Data.Unit
open import Data.String
open import Data.Colist
import Foreign.H... |
{-# OPTIONS --safe --warning=error --without-K #-}
open import LogicalFormulae
open import Numbers.Naturals.Semiring
open import Numbers.Integers.RingStructure.Ring
open import Rings.IntegralDomains.Definition
module Numbers.Integers.RingStructure.IntegralDomain where
intDom : (a b : ℤ) → a *Z b ≡ nonneg 0 → (a ≡ no... |
{- Byzantine Fault Tolerant Consensus Verification in Agda, version 0.9.
Copyright (c) 2020, 2021, Oracle and/or its affiliates.
Licensed under the Universal Permissive License v 1.0 as shown at https://opensource.oracle.com/licenses/upl
-}
open import LibraBFT.Base.Types
open import LibraBFT.Impl.OBM.Rust.Dura... |
-- Actually, we're cheating (for expediency); this is
-- Symmetric Rig, not just Rig.
module Categories.RigCategory where
open import Level
open import Data.Fin renaming (zero to 0F; suc to sucF)
open import Data.Product using (_,_)
open import Categories.Category
open import Categories.Functor
open import ... |
module Properties.Step where
open import Agda.Builtin.Equality using (_≡_; refl)
open import FFI.Data.Maybe using (just; nothing)
open import Luau.Heap using (Heap; lookup; alloc; ok; function_⟨_⟩_end)
open import Luau.Syntax using (Block; Expr; nil; var; addr; function⟨_⟩_end; block_is_end; _$_; local_←_; function_⟨_... |
-- The --no-coverage-check option has been removed.
{-# OPTIONS --no-coverage-check #-}
module Issue1918 where
|
module AllTests where
import Issue14
import Issue65
import Issue73
import Fixities
import LanguageConstructs
import Numbers
import Pragmas
import Sections
import Test
import Tuples
import Where
import TypeSynonyms
import Datatypes
import Records
import DefaultMethods
import Vector
{-# FOREIGN AGDA2HS
import Issue14
... |
module _ where
postulate
T U V : Set
F G : Set → Set
Sea : {A : Set} → (A → A → Set) → Set
Seas : {I : Set} (As : I → Set) → ({i j : I} → As i → As j → Set) → Set
_eq_ _to_ : T → T → Set
record K : Set₁ where
field
A : Set
B : A → A → Set
C : Sea B
record IK (I : Set) : Set₁ where
field
... |
{-# OPTIONS --without-K --safe #-}
module Categories.Diagram.End.Properties where
open import Level
open import Data.Product using (Σ; _,_)
open import Function using (_$_)
open import Categories.Category
open import Categories.Category.Product
open import Categories.Category.Construction.Functors
open import Catego... |
{-# OPTIONS --without-K --safe #-}
module Strict where
open import Agda.Builtin.Strict
open import Level
infixr 0 _$!_
_$!_ : {A : Type a} {B : A → Type b} → (∀ x → B x) → ∀ x → B x
f $! x = primForce x f
{-# INLINE _$!_ #-}
|
------------------------------------------------------------------------
-- Identity and composition for traditional non-dependent lenses
------------------------------------------------------------------------
{-# OPTIONS --cubical #-}
import Equality.Path as P
module Lens.Non-dependent.Traditional.Combinators
{e... |
{-
Joseph Eremondi
Utrecht University Capita Selecta
UU# 4229924
July 22, 2015
-}
module RETypes where
open import Data.Char
open import Data.List
open import Relation.Binary
open import Relation.Binary.PropositionalEquality
open import Data.Product
--Tag for whether an RE can match the empty string or not
data Nul... |
open import Oscar.Prelude
open import Oscar.Class
open import Oscar.Class.Surjection
open import Oscar.Data.Proposequality
module Oscar.Class.Smap where
open import Oscar.Class.Hmap public
module Smap
{𝔵₁ 𝔵₁'} {𝔛₁ : Ø 𝔵₁} {𝔛₁' : Ø 𝔵₁'}
{𝔵₂ 𝔵₂'} {𝔛₂ : Ø 𝔵₂} {𝔛₂' : Ø 𝔵₂'}
{𝔯₁₂} {𝔯₁₂'}
(ℜ₁₂ : 𝔛₁... |
{-# OPTIONS --without-K #-}
module PathOperations where
open import Types
infixr 4 _·_
infix 9 _⁻¹
_⁻¹ : ∀ {a} {A : Set a} {x y : A} →
x ≡ y → y ≡ x
_⁻¹ = J (λ x y _ → y ≡ x) (λ _ → refl) _ _
_·_ : ∀ {a} {A : Set a} {x y z : A} →
x ≡ y → y ≡ z → x ≡ z
_·_ {z = z} = J (λ x y _ → y ≡ z → x ≡ z) (λ _ p′ → p′) _ _... |
a = b module M where private
|
{-# OPTIONS --cubical --safe #-}
module Cubical.HITs.Rational where
open import Cubical.HITs.Rational.Base public
-- open import Cubical.HITs.Rational.Properties public
|
{-# OPTIONS --omega-in-omega --no-termination-check --overlapping-instances #-}
module Light.Implementation where
module Data where
module Empty where open import Light.Implementation.Data.Empty public
module Either where open import Light.Implementation.Data.Either public
module Natural where open ... |
-------------------------------------------------
-- Formalisation of the Z axioms of set theory.
-------------------------------------------------
module sv20.assign2.SetTheory.ZAxioms where
open import sv20.assign2.SetTheory.Logic
infix 1 ∃
infix 5 _⊆_ _⊂_
infix 5 _∈_ _∉_
infix 4 _≡_
-- The universe of discourse (... |
module Generic.Lib.Data.List where
open import Data.List.Base hiding ([]) renaming (fromMaybe to maybeToList) public
open List public
open import Generic.Lib.Intro
open import Generic.Lib.Equality.Propositional
open import Generic.Lib.Decidable
open import Generic.Lib.Category
open import Generic.Lib.Data.Nat
open im... |
{- Byzantine Fault Tolerant Consensus Verification in Agda, version 0.9.
Copyright (c) 2020, 2021, Oracle and/or its affiliates.
Licensed under the Universal Permissive License v 1.0 as shown at https://opensource.oracle.com/licenses/upl
-}
open import Optics.All
open import LibraBFT.Prelude
-- This module defi... |
{-# OPTIONS --without-K --safe #-}
open import Definition.Typed.EqualityRelation
module Definition.LogicalRelation.Substitution.Irrelevance {{eqrel : EqRelSet}} where
open EqRelSet {{...}}
open import Definition.Untyped
open import Definition.Typed
open import Definition.LogicalRelation
import Definition.LogicalRela... |
module Array.Base where
open import Data.Nat
open import Data.Nat.DivMod --using (_div_ ; _mod_; _/_; m/n*n≤m)
open import Data.Nat.Divisibility
open import Data.Nat.Properties
open import Data.Vec
open import Data.Vec.Properties using (lookup∘tabulate)
open import Data.Fin.Base hidi... |
module Everything where
import BoolMatcher
import Eq
import Prelude
import RegExps
import Setoids
import SimpleMatcher
|
{-# OPTIONS --cubical --safe #-}
module Data.Functor where
open import Prelude
record Functor ℓ₁ ℓ₂ : Type (ℓsuc (ℓ₁ ℓ⊔ ℓ₂)) where
field
F : Type ℓ₁ → Type ℓ₂
map : (A → B) → F A → F B
identity : map {A = A} id ≡ id
compose : (f : B → C) (g : A → B) → map (f ∘ g) ≡ map f ∘ map g
|
module GUIgeneric.GUI where
open import GUIgeneric.Prelude
open import GUIgeneric.GUIDefinitions
Frame : Set
Frame = ComponentEls frame
logOn : Bool
logOn = true
log : {A : Set} → String → (f : Unit → IO GuiLev1Interface ∞ A) →
IO GuiLev1Interface ∞ A
log s f = if logOn then (do (putStrLn s) λ x → f ... |
{-# OPTIONS --without-K --exact-split --safe #-}
open import Fragment.Equational.Theory
module Fragment.Equational.Model.Properties (Θ : Theory) where
open import Fragment.Equational.Model.Base Θ
open import Fragment.Equational.Model.Synthetic Θ
open import Fragment.Algebra.Homomorphism (Σ Θ)
open import Fragment.Al... |
{-# OPTIONS --without-K --rewriting #-}
open import HoTT
module groups.KernelCstImageCst {i j k}
(G : Group i) (H : Group j) (K : Group k)
(H-ab : is-abelian H) where
private
module H = Group H
open import groups.KernelImage {G = G} {H = H} {K = K} cst-hom cst-hom H-ab
Ker-cst-quot-Im-cst : Ker/Im ≃ᴳ... |
{-# OPTIONS --cubical --safe #-}
module HITs.PropositionalTruncation.Equivalence where
open import Prelude
open import Relation.Binary
open import HITs.PropositionalTruncation
open import HITs.PropositionalTruncation.Sugar
trunc-equivalence : ∀ {a} {A : Type a} → Equivalence A a → Equivalence A a
trunc-equivalence e... |
{-
Computable stuff constructed from the Combinatorics of Finite Sets
-}
{-# OPTIONS --safe #-}
module Cubical.Experiments.Combinatorics where
open import Cubical.Foundations.Prelude
open import Cubical.Foundations.Equiv
open import Cubical.Data.Nat
open import Cubical.Data.Nat.Order
open import Cubical.Data.Bool
... |
{-# OPTIONS --type-in-type #-}
module NoUniverseCheck where
data M : Set -> Set where
return : forall {a} -> a -> M a
_>>=_ : forall {a b} -> M a -> (a -> M b) -> M b
record Cat : Set where
field
Obj : Set
Mor : Obj -> Obj -> Set
data _≡_ {a : Set} (x : a) : a -> Set where
refl : x ≡ x
CatOfCat ... |
------------------------------------------------------------------------
-- The Agda standard library
--
-- Properties of binary relations
------------------------------------------------------------------------
-- The contents of this module should be accessed via `Relation.Binary`.
{-# OPTIONS --without-K --safe #-... |
open import Nat
open import Prelude
open import List
open import contexts
open import core
open import lemmas-general
open import lemmas-env
open import lemmas-progress
open import results-checks
open import decidability
open import completeness
open import preservation
open import progress
open import finality
open... |
-- Andreas, 2011-04-14
-- {-# OPTIONS -v tc.cover:20 -v tc.lhs.unify:20 #-}
module Issue291b where
open import Common.Coinduction
open import Common.Equality
data RUnit : Set where
runit : ∞ RUnit -> RUnit
j : (u : RUnit) -> u ≡ runit (♯ u) -> Set
j u ()
-- needs to fail because of a non strongly rigid occurrence... |
------------------------------------------------------------------------
-- The Agda standard library
--
-- Natural numbers
------------------------------------------------------------------------
module Data.Nat where
open import Function
open import Function.Equality as F using (_⟨$⟩_)
open import Function.Injectio... |
{-# OPTIONS --without-K --rewriting #-}
open import lib.Base
open import lib.PathGroupoid
open import lib.PathOver
open import lib.cubical.Square
module lib.cubical.SquareOver where
SquareOver : ∀ {i j} {A : Type i} (B : A → Type j) {a₀₀ a₀₁ a₁₀ a₁₁ : A}
{p₀₋ : a₀₀ == a₀₁} {p₋₀ : a₀₀ == a₁₀} {p₋₁ : a₀₁ == a₁₁} {p₁... |
module Star where
data Star {A : Set}(R : A -> A -> Set) : A -> A -> Set where
rf : {x : A} -> Star R x x
_<>_ : forall {x y z} -> R x y -> Star R y z -> Star R x z
|
{-# OPTIONS --without-K --rewriting #-}
open import lib.Base
open import lib.Function
open import lib.PathFunctor
open import lib.PathGroupoid
open import lib.path-seq.Concat
module lib.path-seq.Split {i} {A : Type i} where
point-from-start : (n : ℕ) {a a' : A} (s : a =-= a') → A
point-from-start O {a} s = a
point-... |
{-# OPTIONS --without-K #-}
module Note where
open import Data.Integer using (ℤ)
open import Data.Nat using (ℕ; _*_)
open import Pitch using (Pitch; transposePitch)
data Duration : Set where
duration : ℕ → Duration
unduration : Duration → ℕ
unduration (duration d) = d
data Note : Set where
tone : D... |
{-# OPTIONS --cubical --no-import-sorts --safe #-}
module Cubical.Algebra.Group.Construct.Unit where
open import Cubical.Core.Everything
open import Cubical.Foundations.Prelude
open import Cubical.Algebra.Group
open import Cubical.Data.Prod using (_,_)
open import Cubical.Data.Unit
import Cubical.Algebra.Monoid.Cons... |
{-# OPTIONS --without-K #-}
module algebra.semigroup.core where
open import level
open import equality.core
open import sum
open import hott.level
record IsSemigroup {i} (X : Set i) : Set i where
field
_*_ : X → X → X
assoc : (x y z : X) → (x * y) * z ≡ x * (y * z)
is-set : h 2 X
Semigroup : ∀ i → Se... |
------------------------------------------------------------------------
-- A wrapper that turns a representation of natural numbers (with a
-- unique representative for every number) into a representation that
-- computes roughly like the unary natural numbers (at least for some
-- operations)
------------------------... |
module Import where
import Agda.Builtin.Bool
as _
open import Agda.Builtin.Nat
as _
import Agda.Builtin.Unit
using (⊤; tt)
A
: Set
A
= Agda.Builtin.Unit.⊤
|
{-# OPTIONS --safe -W ignore #-}
module Map where
open import Data.String
open import Data.String.Properties using (_==_)
open import Data.Bool
open import Relation.Binary.PropositionalEquality
open import Agda.Builtin.Unit
open import Data.Empty
open import Relation.Nullary using (¬_)
import Relation.Nullary.Decidab... |
{-# OPTIONS --without-K #-}
module 2DTypes where
-- open import Level renaming (zero to lzero)
open import Relation.Binary.PropositionalEquality
open import Data.Unit
open import Data.Sum
open import Data.Empty using (⊥; ⊥-elim)
open import Data.Product
open import Function using (_∘_)
open import Relation.Binary usi... |
{-# OPTIONS --without-K --safe #-}
open import Categories.Category
-- Defines the following properties of a Category:
-- 1. BinaryProducts -- for when a Category has all Binary Products
-- 2. Cartesian -- a Cartesian category is a category with all products
module Categories.Category.Cartesian {o ℓ e} (𝒞 : Category... |
open import Agda.Builtin.List
open import Agda.Builtin.Char
foo : Char → List Char
foo c = c ∷ []
case-split-test : List Char → List Char
case-split-test ('-' ∷ ls) with (foo '+')
... | foo-ls = {!foo-ls!}
case-split-test ls = ls
-- WAS: case splitting on foo-ls produces:
-- case-split-test (.'-' ∷ ls) | [] = ?
--... |
-- Jesper, Andreas, 2018-10-29, issue #3332
--
-- WAS: With-inlining failed in termination checker
-- due to a DontCare protecting the clause bodies
-- (introduced by Prop).
{-# OPTIONS --prop #-}
data _≡_ {A : Set} (a : A) : A → Prop where
refl : a ≡ a
{-# BUILTIN EQUALITY _≡_ #-}
data List (A : Set) : Set where
... |
module UniDB.Morph.Sum where
open import UniDB.Spec
--------------------------------------------------------------------------------
data Sum (Ξ Ζ : MOR) (γ₁ γ₂ : Dom) : Set where
inl : Ξ γ₁ γ₂ → Sum Ξ Ζ γ₁ γ₂
inr : Ζ γ₁ γ₂ → Sum Ξ Ζ γ₁ γ₂
instance
iUpSum : {Ξ Ζ : MOR} {{upΞ : Up Ξ}} {{upΖ : Up Ζ}} → Up (Sum... |
------------------------------------------------------------------------
-- The Agda standard library
--
-- An example of how Algebra.CommutativeMonoidSolver can be used
------------------------------------------------------------------------
{-# OPTIONS --without-K --safe #-}
module Algebra.Solver.CommutativeMonoid.... |
{-# OPTIONS --cubical --no-import-sorts --no-exact-split --safe #-}
module Cubical.Data.Nat.Properties where
open import Cubical.Core.Everything
open import Cubical.Foundations.Prelude
open import Cubical.Data.Nat.Base
open import Cubical.Data.Empty as ⊥
open import Cubical.Data.Sigma
open import Cubical.Relation.N... |
-- TODO: Move some of the proofs from Function.Iteration.Proofs to here so that (_^_) on functions, natural numbers and integers can be generalised.
-- TODO: Maybe something like this
record Iteration(f)(id)(repeat : I → Y) where
field
𝟎 : I
repeat-𝟎 : repeat 𝟎 ≡ id
record Successor(𝐒 : I → I) where
... |
module #7 where
{-
Exercise 1.7. Give an alternative derivation of ind′=A from ind=A which avoids the use of universes.
(This is easiest using concepts from later chapters.)
-}
open import Relation.Binary.PropositionalEquality
ind'₌A : ∀{a}{A : Set a} → (C : (x y : A) → (x ≡ y) → Set) → ((x : A) → C x x refl) → (x ... |
module SemiLattice where
open import Prelude
open import PartialOrder as PO
import Chain
private
module IsSemiLat
{A : Set}(po : PartialOrder A)(_⊓_ : A -> A -> A) where
private open module PO = PartialOrder po
record IsSemiLattice : Set where
field
⊓-lbL : forall {x y} -> (x ⊓ y) ≤ x
⊓-lb... |
{-# OPTIONS --safe #-}
module Cubical.Algebra.CommRing.Kernel where
open import Cubical.Foundations.Prelude
open import Cubical.Algebra.CommRing.Base
open import Cubical.Algebra.CommRing.Ideal using (IdealsIn; Ideal→CommIdeal)
open import Cubical.Algebra.Ring.Kernel using () renaming (kernelIdeal to ringKernelIdeal)
... |
{-# OPTIONS --rewriting #-}
module DualContractive where
open import Data.Fin
open import Data.Maybe
open import Data.Nat hiding (_≤_ ; compare) renaming (_+_ to _+ℕ_)
open import Data.Nat.Properties
open import Data.Sum hiding (map)
open import Data.Product
open import Relation.Nullary
open import Relation.Binary.Pr... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.