text stringlengths 4 690k |
|---|
------------------------------------------------------------------------
-- Some derivable properties
------------------------------------------------------------------------
open import Algebra
module Algebra.Props.Group (g : Group) where
open Group g
import Algebra.FunctionProperties as P; open P _≈_
import Relati... |
{-# OPTIONS --without-K #-}
open import lib.Basics
open import lib.Equivalences2
open import lib.NType2
open import lib.types.Group
open import lib.types.Pi
open import lib.types.Sigma
open import lib.types.Truncation
module lib.groups.Homomorphisms where
record GroupHom {i j} (G : Group i) (H : Group j)
: Type (l... |
{-# OPTIONS --no-unicode #-}
data Two : Set where
tt ff : Two
data Foo : Set where
foo : Foo -> Foo -> Foo
test1 : Foo → Two
test1 x₀ = {!!}
test : Foo -> Foo → Two
test x1 = {!!}
|
module UniDB.Morph.ShiftsPrime where
open import UniDB.Spec
open import UniDB.Basic
open import UniDB.Subst
open import Function
open import Data.Product
--------------------------------------------------------------------------------
mutual
data Shifts* : MOR where
refl : {γ : Dom} → Shifts* γ γ
incl : {... |
------------------------------------------------------------------------
-- Terminating parser combinator interface
------------------------------------------------------------------------
module RecursiveDescent.Coinductive where
open import RecursiveDescent.Index
import RecursiveDescent.Coinductive.Internal as P
op... |
open import Type
module Formalization.ClassicalPropositionalLogic.TruthTable {ℓₚ}{P : Type{ℓₚ}} where
import Lvl
open import Data
open import Data.Boolean
open import Data.Boolean.Operators using () renaming (module Logic to Bool)
import Data.Boolean.Proofs as Bool
open import Data.Boolean.Stmt
open import ... |
------------------------------------------------------------------------
-- An example that uses natural numbers as names, implemented using
-- the coinductive definition of bisimilarity
------------------------------------------------------------------------
{-# OPTIONS --sized-types #-}
module Bisimilarity.CCS.Exam... |
import Relation.Binary.EqReasoning as EqReasoning
open import SemiNearRingRecords
module ZeroLemmas (snr : SemiNearRing) where
open SemiNearRing snr -- public
open import CommAssocLemmas s _≃s_ _+s_ zers isCommMon hiding (_<+>_) renaming (SA to Ss)
zeroˡLemma : ∀ x y → zers *s x +s zers *s y ≃s zers
zeroˡLemma... |
module Data.Finitude.Exponent where
open import Data.Finitude
open import Data.Fin as Fin using (Fin; toℕ)
open import Data.Nat
open import Data.Vec as Vec
open import Relation.Binary.PropositionalEquality as P
open import Data.Nat.DivMod
open import Relation.Nullary.Decidable
open import Function
open import Function.... |
module product where
open import level
----------------------------------------------------------------------
-- types
----------------------------------------------------------------------
data Σ {ℓ ℓ'} (A : Set ℓ) (B : A → Set ℓ') : Set (ℓ ⊔ ℓ') where
_,_ : (a : A) → (b : B a) → Σ A B
data Σi {ℓ ℓ'} (A : Set ℓ)... |
------------------------------------------------------------------------
-- Fixity and associativity
------------------------------------------------------------------------
module Mixfix.Fixity where
open import Data.Fin using (Fin; zero; suc; #_)
open import Data.Fin.Properties using (eq?)
open import Function.Left... |
{-# OPTIONS --without-K --safe #-}
open import Categories.Category.Core
-- Reflexive pairs and reflexive coequalizers
-- https://ncatlab.org/nlab/show/reflexive+coequalizer
module Categories.Diagram.ReflexivePair {o ℓ e} (𝒞 : Category o ℓ e) where
open import Level
open import Categories.Diagram.Coequalizer 𝒞
op... |
------------------------------------------------------------------------
-- A large class of algebraic structures satisfies the property that
-- isomorphic instances of a structure are equal (assuming univalence)
------------------------------------------------------------------------
{-# OPTIONS --without-K --safe #-... |
{-# OPTIONS --without-K --safe #-}
module Categories.Category.Construction.Properties.Kleisli where
open import Level
import Relation.Binary.PropositionalEquality as ≡
open import Categories.Adjoint
open import Categories.Adjoint.Properties
open import Categories.Category
open import Categories.Functor using (Functor... |
module Issue599 where
data Bool : Set where
true false : Bool
-- standard lambda here
foo : Bool → Bool
foo = ?
-- pattern matching lambda here
bar : Bool → Bool
bar = ?
|
------------------------------------------------------------------------
-- The halting problem
------------------------------------------------------------------------
module Halting-problem where
open import Equality.Propositional.Cubical
open import Logical-equivalence using (_⇔_)
open import Prelude hiding (const... |
module IrrelevantLambda where
postulate
A : Set
P : .A -> Set
f : ._ -> Set
f = λ .x -> P x
f' = λ .(x : _) -> P x
f'' = λ .{x y z : _} -> P x
g : ((.A -> Set) -> Set) -> Set
g k = k f
|
module Golden.InsertionSort where
open import Agda.Builtin.Nat
open import Agda.Builtin.List
open import Agda.Builtin.Bool
insert : Nat -> List Nat -> List Nat
insert a [] = a ∷ []
insert x (a ∷ b) with x < a
... | true = x ∷ a ∷ b
... | false = a ∷ (insert x b)
foldr : ∀ {a b : Set} → (a → b → b) → b → List a -> b
... |
------------------------------------------------------------------------
-- The Agda standard library
--
-- Universe levels
------------------------------------------------------------------------
{-# OPTIONS --without-K --safe #-}
module Level where
-- Levels.
open import Agda.Primitive as Prim public
using (... |
{-# OPTIONS --safe #-}
module Cubical.Algebra.MonoidSolver.Solver where
open import Cubical.Foundations.Prelude
open import Cubical.Foundations.Structure
open import Cubical.Data.FinData using (Fin)
open import Cubical.Data.Nat using (ℕ)
open import Cubical.Data.List
open import Cubical.Data.Vec using (Vec; lookup)
... |
{-# OPTIONS --cubical --no-import-sorts --safe #-}
module Cubical.Homotopy.Base where
open import Cubical.Foundations.Prelude
open import Cubical.Foundations.Equiv.Properties
private
variable
ℓ ℓ' : Level
_∼_ : {X : Type ℓ} {Y : X → Type ℓ'} → (f g : (x : X) → Y x) → Type (ℓ-max ℓ ℓ')
_∼_ {X = X} f g = (x : X... |
{-# OPTIONS --cubical --safe --postfix-projections #-}
module Categories.Exercises where
open import Prelude
open import Categories
open Category ⦃ ... ⦄
open import Categories.Product
open Product public
open HasProducts ⦃ ... ⦄ public
-- module _ {ℓ₁} {ℓ₂} ⦃ c : Category ℓ₁ ℓ₂ ⦄ ⦃ hp : HasProducts c ⦄ where
-- ... |
{-# OPTIONS --safe --warning=error --without-K #-}
open import LogicalFormulae
open import Numbers.Naturals.Semiring
open import Numbers.Naturals.Multiplication
open import Semirings.Definition
open import Rings.Definition
open import Setoids.Setoids
module Numbers.Integers.RingStructure.Ring where
open import Numbe... |
module Oscar.Data.Term.Injectivity {𝔣} (FunctionName : Set 𝔣) where
open import Oscar.Data.Term FunctionName
open import Data.Fin
open import Data.Nat
open import Data.Vec
open import Relation.Binary.PropositionalEquality
Term-i-inj : ∀ {m} {𝑥₁ 𝑥₂ : Fin m} → i 𝑥₁ ≡ i 𝑥₂ → 𝑥₁ ≡ 𝑥₂
Term-i-inj refl = refl
Ter... |
{-# OPTIONS --without-K --exact-split --rewriting --overlapping-instances #-}
open import lib.Basics
open import lib.NConnected
open import lib.NType2
open import lib.types.Truncation
open import lib.types.Sigma
open import lib.Equivalence
open import lib.types.Fin
open import lib.types.Coproduct
open import Graphs.D... |
{-# OPTIONS --without-K #-}
module TypeEquivalences where
open import Data.Empty
open import Data.Unit
open import Data.Unit.Core
open import Data.Nat renaming (_⊔_ to _⊔ℕ_)
open import Data.Sum renaming (map to _⊎→_)
open import Data.Product renaming (map to _×→_)
open import Function renaming (_∘_ to _○_)
-- explic... |
{-# OPTIONS --cubical #-}
module HyperPositive where
open import Prelude
infixr 4 _↬_
{-# NO_POSITIVITY_CHECK #-}
record _↬_ (A : Type a) (B : Type b) : Type (a ℓ⊔ b) where
inductive; constructor hyp
field invoke : ((A ↬ B) → A) → B
open _↬_
open import Data.List using (List; _∷_; []; foldr)
module _ {a b} {A ... |
open import Relation.Binary.Indexed
module Relation.Binary.Indexed.EqReasoning {𝒾} {I : Set 𝒾} {𝒸 ℓ} (S : Setoid I 𝒸 ℓ) where
open Setoid S
import Relation.Binary.Indexed.PreorderReasoning as PreR
open import Relation.Binary.Indexed.Extra using (Setoid⇒Preorder)
open PreR (Setoid⇒Preorder S) public
renamin... |
module Cats.Category.Discrete {li} (I : Set li) where
open import Data.Unit using (⊤)
open import Level
open import Cats.Category.Base
open import Cats.Functor using (Functor)
Obj : Set li
Obj = I
data _⇒_ : Obj → Obj → Set where
id : ∀ {A} → A ⇒ A
_∘_ : ∀ {A B C} → B ⇒ C → A ⇒ B → A ⇒ C
id ∘ id = id
Discre... |
{-# OPTIONS --cubical #-}
module Cubical.Categories.Sets where
open import Cubical.Foundations.Prelude
open import Cubical.Foundations.HLevels
open import Cubical.Categories.Category
module _ ℓ where
SET : Precategory (ℓ-suc ℓ) ℓ
SET .ob = Σ (Type ℓ) isSet
SET .hom (A , _) (B , _) = A → B
SET .idn _ = λ x →... |
-- Building some simple tactics using the reflected type checking monad.
module _ where
open import Common.Reflection
open import Common.Prelude hiding (_>>=_)
open import Common.Equality
open import Agda.Builtin.Sigma
-- Some helpers --
quotegoal : (Type → Tactic) → Tactic
quotegoal tac hole =
inferType hole >>= ... |
------------------------------------------------------------------------
-- Proofs of the map-iterate property and iterate fusion
------------------------------------------------------------------------
module MapIterate where
open import Codata.Musical.Notation
open import Codata.Musical.Stream as Stream
using (St... |
{-# OPTIONS --safe -W noTerminationIssue #-}
data ⊥ : Set where
bad : ⊥
bad = bad
|
module plfa.working.Induction where
import Relation.Binary.PropositionalEquality as Eq
open Eq using (_≡_; refl; cong; sym)
open Eq.≡-Reasoning using (begin_; _≡⟨⟩_; step-≡; _∎)
open import Data.Nat using (ℕ; zero; suc; _+_; _*_; _∸_)
+-assoc : ∀ (m n p : ℕ) → (m + n) + p ≡ m + (n + p)
+-assoc zero n p =
... |
{-# OPTIONS --sized-types --guardedness #-}
-- Note: This module is not meant to be imported.
module Js where
import Data
import Data.Boolean
import FFI.IO as FFI
main : FFI.IO Data.Unit
main = FFI.printStrLn("Okay")
|
module _ where
record R : Set₁ where
field x : Set
g : Set₁
module M (r : R) where
open R r
f = x
g = R
|
module Examples.Syntax where
open import Agda.Builtin.Equality using (_≡_; refl)
open import FFI.Data.String using (_++_)
open import Luau.Syntax using (var; _$_; return; nil; function_⟨_⟩_end; done; _∙_)
open import Luau.Syntax.ToString using (exprToString; blockToString)
f = var "f"
x = var "x"
ex1 : exprToString(... |
{-# OPTIONS --without-K --rewriting #-}
open import HoTT
open import cw.CW
open import cw.FinCW
open import cw.FinBoundary
open import cohomology.Theory
module cw.cohomology.cochainequiv.HigherCoboundaryCommSquare (OT : OrdinaryTheory lzero)
{n} (⊙fin-skel : ⊙FinSkeleton (S (S n))) where
open OrdinaryTheory OT
ope... |
module CoinductiveAfterEvaluation where
open import Common.Coinduction
data Functor : Set where
Id : Functor
_·_ : Functor → Set → Set
Id · A = A
data ν (F : Functor) : Set where
inn : ∞ (F · ν F) → ν F
-- Evaluation is required to see that Id · ν Id is a coinductive type.
foo : ∀ F → F · ν F
foo Id = inn (♯ ... |
module Dave.Algebra.Naturals.Definition where
open import Dave.Equality public
open import Dave.Structures.Monoid public
data ℕ : Set where
zero : ℕ
suc : ℕ → ℕ
one = suc zero
two = suc one
three = suc two
four = suc three
five = suc four
six = suc five
seven = suc six
eight = suc seve... |
module x07-747Negation-hc where
open import Relation.Binary.PropositionalEquality using (_≡_; cong; refl; subst; sym) -- added last
open import Data.Nat using (ℕ; zero; suc)
open import Data.Empty using (⊥; ⊥-elim)
open import Data.Sum using (_⊎_; inj₁; inj₂)
open import Data.Product using (_×_; proj₁; proj₂)
-------... |
{-# OPTIONS --safe #-}
open import Definition.Typed.EqualityRelation
module Definition.LogicalRelation.Substitution.Introductions.Cast {{eqrel : EqRelSet}} where
open EqRelSet {{...}}
open import Definition.Untyped
open import Definition.Untyped.Properties
open import Definition.Typed
open import Definition.Typed.Pr... |
module Issue277 where
data D : Set where
d : D
abstract
x : D
x = d
-- Normalise x using the Emacs mode, at the top-level. Result: d. The
-- result should be x. Agda.Interaction.GhciTop.cmd_compute_toplevel
-- receives the right arguments, so the problem does not lie in the
-- Emacs Lisp code.
y : D
y = {!x... |
{-# OPTIONS --without-K --safe #-}
-- Mentioned in passing here:
-- https://ncatlab.org/nlab/show/slice+2-category
open import Categories.Bicategory using (Bicategory)
module Categories.Bicategory.Construction.LaxSlice
{o ℓ e t}
(𝒞 : Bicategory o ℓ e t)
where
open import Data.Product using (_,... |
module L.Base.Id.Core where
-- Use the builtin _≡_ and refl
open import Agda.Builtin.Equality public
J : ∀{a c} {A : Set a} → (C : (x y : A) → x ≡ y → Set c)
→ ((x : A) → C x x refl)
→ (M N : A) → (P : M ≡ N ) → C M N P
J C c M .M refl = c M
|
open import Prelude
open import Nat
module List where
-- lets us omit a bunch of parens
infixr 99 _::_
infixr 9 _++_
-- standard definition of polymorphic lists
data List (A : Set) : Set where
[] : List A
_::_ : A → List A → List A
{-# BUILTIN LIST List #-}
-- shorthand notation for small li... |
module plfa.Relations where
import Relation.Binary.PropositionalEquality as Eq
open Eq using (_≡_; refl; cong; sym)
open import Data.Nat using (ℕ ; zero; suc; _+_)
open import Data.Nat.Properties using (+-comm)
data _≤_ : ℕ → ℕ → Set where
z≤n : ∀ { n : ℕ }
---------
→ zero ≤ n
s≤s : ∀ { m n : ℕ }
... |
{- 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
-}
{-# OPTIONS --allow-unsolved-metas #-}
open import LibraBFT.Prelude
open... |
{-# OPTIONS --cubical --safe --prop #-}
module Relation.Binary.Equivalence.PropTruncated where
open import Prelude
open import Relation.Nullary.Stable
infix 4 _≐_
data _≐_ {a} {A : Type a} (x y : A) : Prop a where
∣_∣ : x ≡ y → x ≐ y
data ∙⊥ : Prop where
private
variable
x y z : A
rerel : ∙⊥ → ⊥
rerel ()
... |
open import Mockingbird.Forest using (Forest)
-- Mockingbirds, Warblers, and Starlings
module Mockingbird.Problems.Chapter12 {b ℓ} (forest : Forest {b} {ℓ}) where
open import Data.Product using (_×_; _,_; proj₁; ∃-syntax)
open import Function using (_$_)
open import Mockingbird.Forest.Birds forest
import Mockingbird... |
module Syntax where
open import Data.List using (List; []; _∷_; _++_; lookup; length)
open import Data.Product using (Σ; Σ-syntax; proj₁; proj₂)
open import Data.Unit renaming (⊤ to top)
open import Data.Empty renaming (⊥ to bot)
open import Level using (suc; _⊔_)
module PType {ℓ} (Gr : Set ℓ) where
infixr 10 _*_
... |
-- Andreas, 2019-02-25, issue #3588
-- C-c C-r (refine) produces unqualified constructor, but only
-- a qualified constructor is accepted in this place.
-- {-# OPTIONS -v interaction.intro:100 #-}
-- {-# OPTIONS -v scope.inverse:100 #-}
-- {-# OPTIONS -v toConcrete:50 #-}
module Issue3588 where
module M (_ : Set₁) w... |
{-# OPTIONS --exact-split #-}
{-# OPTIONS --no-sized-types #-}
{-# OPTIONS --no-universe-polymorphism #-}
{-# OPTIONS --without-K #-}
module LogicalFramework.NonIntuitionistic where
infix 6 ¬_
infixr 5 _∧_
infixr 4 _∨_
postulate
⊥ : Set
⊥-elim : {A : Set} → ⊥ → A
-- D... |
-- Generalized variables in datatype (and record) parameters
module _ where
open import Agda.Primitive
open import Agda.Builtin.Nat
module NotParameterised where
variable
ℓ : Level
A : Set ℓ
x y : A
m n : Nat
data Vec (A : Set ℓ) : Nat → Set ℓ where
[] : Vec A zero
_∷_ : A → Vec A n →... |
-- {-# OPTIONS -v interaction.give:20 #-}
-- Reported by stevan.andjelkovic, Yesterday (17 hours ago)
-- Trying to give the expression in the goal gives the following error:
-- tt != tt p a of type Prop
-- when checking that the expression (λ x y → ?) has type
-- ({o : ⊤} (p : ⊤) → ⊥ → ⊤)
record _▷_ (I O : S... |
{-# OPTIONS --universe-polymorphism #-}
open import Level
open import Categories.Category
open import Categories.Product
module Categories.Product.Projections
{o ℓ e o′ ℓ′ e′}
(C : Category o ℓ e)
(D : Category o′ ℓ′ e′)
where
open import Categories.Functor
open import Data.Product using (_×_; Σ; _,... |
{-# OPTIONS --safe #-}
module Cubical.Categories.Instances.Sets where
open import Cubical.Foundations.Prelude
open import Cubical.Foundations.HLevels
open import Cubical.Foundations.Isomorphism
open import Cubical.Data.Unit
open import Cubical.Data.Sigma using (ΣPathP)
open import Cubical.Categories.Category
open imp... |
-- Andreas, 2014-01-09, extend parser of typed bindings to allow hiding
postulate
_≡_ : ∀{A : Set} (a b : A) → Set
List : Set → Set
_++_ : ∀{A : Set} (xs ys : List A) → List A
assoc : ∀{A : Set} (xs {ys} {zs} : List A) → ((xs ++ ys) ++ zs) ≡ (xs ++ (ys ++ zs))
assoc1 : ∀{A : Set} (xs {ys zs} : List A) → ... |
{-# OPTIONS --without-K --safe #-}
module Data.Nat.Base where
open import Agda.Builtin.Nat public
using (_+_; _*_; zero; suc)
renaming (Nat to ℕ; _-_ to _∸_)
open import Level
data Ordering : ℕ → ℕ → Type where
less : ∀ m k → Ordering m (suc (m + k))
equal : ∀ m → Ordering m m
greater : ∀ m k → Ord... |
open import OutsideIn.Prelude
open import OutsideIn.X
module OutsideIn.Inference.Solver(x : X) where
import OutsideIn.Inference.Separator as S
import OutsideIn.Expressions as E
import OutsideIn.Constraints as C
open import Data.Bool renaming (_∧_ to _and_)
open E(x)
open S(x)
open X(x)
open C(x)
pr... |
module Data.Boolean.Proofs where
import Lvl
open import Data
open import Data.Boolean
import Data.Boolean.Operators
open Data.Boolean.Operators.Logic using (_⊼_ ; _⊽_ ; _⊕_)
open Data.Boolean.Operators.Programming
open import Data.Either as Either using (_‖_ ; Left ; Right)
open import Function... |
open import Agda.Builtin.Equality
open import Agda.Builtin.Nat
data ⊤ : Set where
tt : ⊤
foo : Nat → ⊤ → ⊤
foo 0 tt = tt
foo (suc n) tt = foo n tt -- NB tail-recursive
test : foo 100000 tt ≡ tt
test = refl -- memory blows up here
|
module Issue2486.Import where
open import Issue2486.Haskell
{-# FOREIGN GHC import qualified MAlonzo.Code.Issue2486.Haskell #-}
data MyList (A : Set) : Set where
[] : MyList A
_::_ : A → MyList A → MyList A
{-# COMPILE GHC MyList = data MAlonzo.Code.Issue2486.Haskell.MyList ( MAlonzo.Code.Issue2486.Haskell.Nil ... |
{-# OPTIONS --allow-unsolved-metas #-}
module FLutil where
open import Level hiding ( suc ; zero )
open import Data.Fin hiding ( _<_ ; _≤_ ; _-_ ; _+_ ; _≟_)
open import Data.Fin.Properties hiding ( <-trans ; ≤-refl ; ≤-trans ; ≤-irrelevant ; _≟_ ) renaming ( <-cmp to <-fcmp )
open import Data.Fin.Permutation -- hid... |
------------------------------------------------------------------------
-- The Agda standard library
--
-- The partiality monad
------------------------------------------------------------------------
{-# OPTIONS --without-K --safe --guardedness #-}
module Category.Monad.Partiality where
open import Codata.Musical.... |
open import Algebra using (CommutativeMonoid)
open import Relation.Binary.Structures using (IsEquivalence)
open import Relation.Binary.PropositionalEquality using () renaming (cong to ≡-cong)
module AKS.Exponentiation {c ℓ} (M : CommutativeMonoid c ℓ) where
open import AKS.Nat using (ℕ; _+_; _<_)
open ℕ
open import A... |
{-# OPTIONS --cubical --safe --postfix-projections --guardedness #-}
open import Algebra
open import Prelude
open import Relation.Binary
open import WellFounded
open import Algebra.Monus
open import Data.Maybe
module Control.Comonad.IntervalHeap {s}
(mon : TMAPOM s)
(wf : WellFounded (TMAPOM._<_ mon))
(cancel :... |
------------------------------------------------------------------------------
-- First-order logic
------------------------------------------------------------------------------
{-# OPTIONS --exact-split #-}
{-# OPTIONS --no-sized-types #-}
{-# OPTIONS --no-universe-polymorphism #-}
{-# OPTIONS... |
{-# OPTIONS --without-K #-}
module NTypes.Contractible where
open import Equivalence
open import Types
isContr : ∀ {a} → Set a → Set _
isContr A = Σ A λ x → (y : A) → x ≡ y
contr→eq-⊤ : ∀ {a} {A : Set a} → isContr A → A ≃ ⊤
contr→eq-⊤ h
= (λ _ → _)
, ((λ _ → π₁ h) , λ _ → refl)
, ((λ _ → π₁ h) , π₂ h)
eq-⊤→co... |
{-# OPTIONS --cubical --no-import-sorts --no-exact-split --safe #-}
module Cubical.Data.NatMinusOne.Properties where
open import Cubical.Foundations.Prelude
open import Cubical.Foundations.Univalence
open import Cubical.Data.Nat
open import Cubical.Data.NatMinusOne.Base
open import Cubical.Reflection.StrictEquiv
-1+P... |
{- Delay operator. -}
module TemporalOps.Delay where
open import CategoryTheory.Categories
open import CategoryTheory.Instances.Reactive
open import CategoryTheory.Functor
open import CategoryTheory.CartesianStrength
open import TemporalOps.Common
open import TemporalOps.Next
open import Data.Nat.Properties using (+... |
{-# OPTIONS --cubical --no-import-sorts --safe #-}
module Cubical.HITs.Truncation.Properties where
open import Cubical.Data.NatMinusOne
open import Cubical.HITs.Truncation.Base
open import Cubical.Foundations.Prelude
open import Cubical.Foundations.Function
open import Cubical.Foundations.Equiv
open import Cubical.Fo... |
module GetTypes where
open import Level using () renaming (zero to ℓ₀)
open import Data.Nat using (ℕ)
open import Data.List using (List ; map)
open import Data.Vec using (Vec) renaming (map to mapV)
open import Function using (_∘_ ; id)
open import Relation.Binary.PropositionalEquality using (_≗_)
open import Structu... |
------------------------------------------------------------------------
-- The Agda standard library
--
-- An inductive definition of the sublist relation with respect to a
-- setoid. This is a generalisation of what is commonly known as Order
-- Preserving Embeddings (OPE).
-------------------------------------------... |
module Structure.Function where
import Lvl
open import Lang.Instance
open import Logic.Predicate
open import Logic
open import Structure.Function.Names
open import Structure.Setoid
open import Type
private variable ℓ ℓₒ ℓₒ₁ ℓₒ₂ ℓₒ₃ ℓₗ ℓₗ₁ ℓₗ₂ ℓₗ₃ : Lvl.Level
private variable A B : Type{ℓ}
-- The function `f` "(behav... |
{-# OPTIONS --cubical --no-import-sorts --safe #-}
module Cubical.Data.Prod.Base where
open import Cubical.Core.Everything
open import Cubical.Foundations.Prelude
open import Cubical.Foundations.Function
-- Here we define an inductive version of the product type, see below
-- for its uses.
-- See `Cubical.Data.Sigm... |
{- 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.Prelude
open import LibraBFT.Concrete.System.Parame... |
open import Nat
open import Prelude
open import contexts
open import dynamics-core
open import canonical-value-forms
module canonical-boxed-forms where
canonical-boxed-forms-num : ∀{Δ d} →
Δ , ∅ ⊢ d :: num →
d boxedval →
Σ[ n ∈ Nat ... |
------------------------------------------------------------------------
-- The Maybe type
------------------------------------------------------------------------
module Data.Maybe where
------------------------------------------------------------------------
-- The type
open import Data.Maybe.Core public
--------... |
open import Agda.Builtin.Reflection
open import Agda.Builtin.Unit
open import Agda.Builtin.String
open import Agda.Builtin.Nat
open import Agda.Builtin.List
infixl 5 _>>=_
_>>=_ = bindTC
pure = returnTC
defToTerm : Name → Definition → List (Arg Term) → Term
defToTerm _ (function cs) as = pat-lam cs as
defToTerm _ (d... |
{-# OPTIONS --without-K #-}
open import HoTT.Base
module HoTT.Base.Inspect where
open variables
data Inspect {i j} {A : 𝒰 i} {P : A → 𝒰 j} (f : Π A P) (x : A) (y : P x) : 𝒰 (i ⊔ j) where
[_] : y == f x → Inspect f x y
inspect : (f : Π A P) (x : A) → Inspect f x (f x)
inspect f x = [ refl ]
|
{- Next step operator. -}
module TemporalOps.Next where
open import CategoryTheory.Categories
open import CategoryTheory.Instances.Reactive
open import CategoryTheory.Functor
open import CategoryTheory.CartesianStrength
open import TemporalOps.Common
open import Data.Product
open import Data.Sum
-- One-step delay o... |
module Luau.RuntimeType where
open import Luau.Value using (Value; nil; addr; number)
data RuntimeType : Set where
function : RuntimeType
number : RuntimeType
nil : RuntimeType
valueType : Value → RuntimeType
valueType nil = nil
valueType (addr x) = function
valueType (number x) = number
|
------------------------------------------------------------------------
-- An abstraction of various forms of recursion/induction
------------------------------------------------------------------------
-- Note: The types in this module can perhaps be easier to understand
-- if they are normalised. Note also that Agd... |
------------------------------------------------------------------------
-- An equality postulate which evaluates
------------------------------------------------------------------------
module Relation.Binary.PropositionalEquality.TrustMe where
open import Relation.Binary.PropositionalEquality
private
primitive
... |
-- As reported by Andreas on 2017-01-23
open import Common.Equality
open import Common.Product
data Bool : Set where
true false : Bool
f : (x y : Bool) → Bool
f true y = y
-- f false x = true -- Missing case
test : let
X : Bool → Bool → Bool
X = {! f !}
in (∀{x y} → X (f false x) y ≡ y) × (X fals... |
open import Prelude hiding (lift; id)
module Implicits.Syntax.LNMetaType where
open import Implicits.Syntax.Type
open import Data.Nat as Nat
mutual
data MetaSType (m : ℕ) : Set where
tvar : ℕ → MetaSType m
mvar : Fin m → MetaSType m
_→'_ : (a b : MetaType m) → MetaSType m
tc : ℕ → MetaSType m
... |
{-# OPTIONS --safe #-}
module Cubical.Experiments.HAEquivInt where
open import Cubical.Experiments.HAEquivInt.Base public
|
-----------------------------------------------------------------------
-- The Agda standard library
--
-- Properties of the heterogeneous sublist relation
------------------------------------------------------------------------
{-# OPTIONS --without-K --safe #-}
module Data.List.Relation.Binary.Sublist.Heterogeneous... |
module Tactic.Nat.Subtract.Exp where
open import Prelude
open import Tactic.Nat.Exp
open import Tactic.Nat.NF
open import Container.Bag
open import Data.TreeRep
infixl 6 _⟨+⟩_ _⟨-⟩_
infixl 7 _⟨*⟩_
data SubExp : Set where
var : (x : Var) → SubExp
lit : (n : Nat) → SubExp
_⟨+⟩_ _⟨-⟩_ _⟨*⟩_ : (a b : SubExp) → Su... |
postulate
@0 A : Set
_ : @0 Set → (Set → Set) → Set
_ = λ @0 where
A G → G A
|
-- New NO_POSITIVITY_CHECK pragma for data definitions and mutual
-- blocks
-- Skipping a single data definition.
{-# NO_POSITIVITY_CHECK #-}
data D : Set where
lam : (D → D) → D
|
import Agda.Builtin.Nat as Nat public
f : let open Nat public in Nat → Nat
f x = x
|
{-# OPTIONS --without-K #-}
module sets.nat.properties where
open import equality.core
open import equality.calculus
open import equality.reasoning
open import function.isomorphism.core
open import sets.nat.core
open import sets.empty
+-left-unit : ∀ n → 0 + n ≡ n
+-left-unit n = refl
+-right-unit : ∀ n → n + 0 ≡ n
... |
{-# OPTIONS --without-K --safe #-}
module Categories.Category.Monoidal.Structure where
open import Level
open import Categories.Category
open import Categories.Category.Monoidal.Core
record MonoidalCategory o ℓ e : Set (suc (o ⊔ ℓ ⊔ e)) where
field
U : Category o ℓ e
monoidal : Monoidal U
module... |
-- Andreas, 2019-07-23, issue #3932
--
-- Mutual blocks are not supported in mutual blocks
module _ where
module M where
mutual
A : Set1
A = Set
mutual
B : Set1
B = A
module N where
mutual
A : Set1
A = Set
mutual
A = Set
module O where
mutual
A : Set1
mu... |
-- Andreas, 2021-11-19, issue #5657 reported by J Barrett
-- Regression in 2.6.2: internal error instead of error message
record R : Set₁ where
field A : Set
postulate r : R
open R r
fail : Set
fail = r .A
-- WAS:
-- An internal error has occurred. Please report this as a bug.
-- Location of the error: __IMPOSSIB... |
{-
Day 3 input
-}
module a3-input where
open import Data.Nat
open import Data.List hiding (lookup;allFin)
renaming (map to mapList)
open import Data.Vec
input : List (Vec ℕ 12)
input =
(0 ∷ 0 ∷ 0 ∷ 1 ∷ 1 ∷ 1 ∷ 1 ∷ 1 ∷ 1 ∷ 0 ∷ 0 ∷ 1 ∷ []) ∷
(1 ∷ 1 ∷ 1 ∷ 0 ∷ 1 ∷ 1 ∷ 1 ∷ 1 ∷ 0 ∷ 1 ∷ ... |
module Generic.Function.Elim where
open import Generic.Core
AllAny : ∀ {ι α β γ δ} {I : Set ι} {A : Set α} {C : I -> Set γ}
-> (B : I -> A -> Set β)
-> (∀ x -> (∀ {j} -> B j x -> C j) -> Set δ)
-> (xs : List A)
-> (∀ {j} -> Any (B j) xs -> C j)
-> Set δ
AllAny B D [] k = ⊤... |
{-# OPTIONS --without-K #-}
open import lib.Base
open import lib.PathGroupoid
open import lib.PathFunctor
open import lib.NType
module lib.Equivalences where
{-
We use the half-adjoint definition of equivalences (but this fact should be
invisible to the user of the library). The constructor of the type of
equivalenc... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.