text stringlengths 4 690k |
|---|
------------------------------------------------------------------------
-- The syntax of a toy programming language that only supports
-- allocation and deallocation of memory
------------------------------------------------------------------------
module Only-allocation where
open import Equality.Propositional
open... |
{-# OPTIONS --without-K --safe #-}
module Categories.Adjoint.Instance.PosetCore where
-- The adjunction between the "forgetful" functor from Posets to
-- Setoids and the core functor for posets.
open import Level using (_⊔_)
import Function
open import Function.Equality using (Π; _⟶_)
open import Relation.Binary usi... |
--#include "prelude.agda"
--#include "PropPrelude.agda"
proof_reverse_nil :: PropPrelude.prop_reverse_nil
= ref@_ (reverse Unit Nil@_)
proof_append_nil_1 :: PropPrelude.prop_append_nil_1
= ?
proof_append_nil_2 :: PropPrelude.prop_append_nil_2
= \ (xs::List Unit) -> ref@_ (append Unit Nil@_ xs) |
{-# OPTIONS --universe-polymorphism #-}
module Categories.Adjunction.CompositionLaws where
open import Level
open import Relation.Binary using (Rel; IsEquivalence)
open import Data.Sum
open import Data.Product
open import Function using (flip)
open import Categories.Category
open import Categories.Functor hiding (eq... |
{-# OPTIONS --without-K #-}
-- Some basic theorms about natural numbers.
module hott.types.nat.theorems where
open import hott.core
open import hott.functions
open import hott.types.nat
-- 0 is the right identity of addition.
x+0≡x : ∀(x : ℕ) → x + 0 ≡ x
x+0≡x 0 = begin 0 + 0 ≡ 0 by definition ∎
x+0≡... |
{-# OPTIONS --cubical #-}
module Type.Cubical.InductivePath where
open import Functional
import Lvl
open import Type
import Type.Cubical as Cubical
open import Type.Cubical.InductiveInterval
private variable ℓ : Lvl.Level
private variable A B P : Type{ℓ}
private variable x y z : A
data Path {P : Type{ℓ}} ... |
------------------------------------------------------------------------
-- Some results related to strong bisimilarity for the delay monad
------------------------------------------------------------------------
{-# OPTIONS --sized-types #-}
open import Prelude
module Bisimilarity.Delay-monad {a} {A : Type a} where... |
-- Andreas, 2018-04-16, inspired by issue #3032 reported by sattlerc
-- A termination issue without visible recursion.
postulate
A : Set
B : Set
t : B
mutual
data C : (b : B) → Set where
c : (x : C t) → C (foo t bar)
postulate
bar : C t
foo : (b : B) → C b → B
foo y (c x) = y
-- Should not ... |
------------------------------------------------------------------------------
-- Testing Agda internal term: @Def@
------------------------------------------------------------------------------
{-# OPTIONS --exact-split #-}
{-# OPTIONS --no-sized-types #-}
{-# OPTIONS --no-universe-polymorphism... |
{-# OPTIONS --safe #-}
module Cubical.HITs.Wedge where
open import Cubical.HITs.Wedge.Base public
|
------------------------------------------------------------------------------
-- CS410 Exercise 5
--
-- Given the overrunning of exercise 4, I've decided to shift the deadline
-- for exercise 5 back to the end of semester 2, so you can have a wee go
-- in the last week of semester 1, but then focus on your CS408 proje... |
-- Jesper, 2018-05-14: constructor patterns of the parent clause can
-- now be replaced by a variable in the with clause.
open import Common.Prelude
f : List Nat → List Nat
f [] = []
f (x ∷ xs) with Set
f xs | p = xs
|
private
record Dummy : Set₁ where
constructor ⟨_⟩
field
{h} : Set
nh : Set
pattern ⟪_,_⟫ h s = ⟨_⟩ {h} s
pattern ⟪_⟫ h = (⟨_⟩ {h} _)
|
{-# OPTIONS --without-K --exact-split --safe #-}
module Fragment.Extensions.CSemigroup.Nat where
open import Relation.Binary.PropositionalEquality as PE using (_≡_)
data ℕ⁺ : Set where
one : ℕ⁺
suc : ℕ⁺ → ℕ⁺
infixl 6 _+_
_+_ : ℕ⁺ → ℕ⁺ → ℕ⁺
one + x = suc x
suc x + y = suc (x + y)
+-suc : ∀ x y → x + suc y ≡ ... |
open import Agda.Builtin.Float
open import Agda.Builtin.Unit
open import Agda.Builtin.Reflection
open import Agda.Builtin.String
open import Agda.Builtin.Bool
open import Common.IO
data It (a : Float) : Set where
it : It a
Inf : Float
Inf = primFloatDiv 1.0 0.0
-Inf : Float
-Inf = primFloatNegate Inf
NaN : Float... |
{-# OPTIONS --without-K --exact-split --rewriting #-}
open import lib.Basics
open import lib.PathGroupoid
open import lib.types.Bool
open import lib.types.Sigma
open import lib.types.Pi
open import lib.types.Coproduct
open import lib.types.Unit
open import lib.types.Empty
open import lib.NConnected
open import lib.NTy... |
open import Categories
open import Monads
import Monads.CatofAdj
import Monads.CatofAdj.TermAdjObj
module Monads.CatofAdj.TermAdjUniq
{a b}
{C : Cat {a}{b}}
(M : Monad C)
(A : Monads.CatofAdj.ObjAdj M)
(V : Monads.CatofAdj.HomAdj M A (Monads.CatofAdj.TermAdjObj.EMObj M))
where
open import Library
open i... |
------------------------------------------------------------------------
-- The Agda standard library
--
-- Some properties about signs
------------------------------------------------------------------------
{-# OPTIONS --without-K --safe #-}
module Data.Sign.Properties where
open import Algebra
open import Data.Em... |
{-# OPTIONS --universe-polymorphism #-}
-- It's possible to compute levels
module ComputedLevels where
open import Common.Level
data ℕ : Set where
zero : ℕ
suc : ℕ → ℕ
N-ary-level : Level → Level → ℕ → Level
N-ary-level ℓ₁ ℓ₂ zero = ℓ₂
N-ary-level ℓ₁ ℓ₂ (suc n) = ℓ₁ ⊔ N-ary-level ℓ₁ ℓ₂ n
N-ary : ∀ {ℓ₁ ℓ₂} ... |
module Ex2 where
open import Ex1
|
module Examples.OpSem where
open import Luau.OpSem using (_⊢_⟶ᴱ_⊣_; _⊢_⟶ᴮ_⊣_; subst)
open import Luau.Syntax using (var; nil; local_←_; _∙_; done; return)
open import Luau.Heap using (emp)
x = var "x"
ex1 : emp ⊢ (local "x" ← nil ∙ return x ∙ done) ⟶ᴮ (return nil ∙ done) ⊣ emp
ex1 = subst
|
-- Proof that consistent negative axioms do not jeopardize canonicity.
-- https://www.cs.bham.ac.uk/~mhe/papers/negative-axioms.pdf
{-# OPTIONS --without-K --safe #-}
module Application.NegativeAxioms.Canonicity where
open import Definition.Untyped as U
open import Definition.Typed
open import Definition.Typed.Prop... |
{-# OPTIONS --without-K --safe #-}
module Categories.Category.Discrete where
open import Level
open import Data.Unit
open import Function
open import Relation.Binary.PropositionalEquality as ≡
open import Categories.Category
open import Categories.Functor
Discrete : ∀ {a} (A : Set a) → Category a a a
Discrete A = re... |
{-# OPTIONS --without-K #-}
module Equivalence where
open import Homotopy
open import PathOperations
open import Types
infix 1 _≃_
qinv : ∀ {a b} {A : Set a} {B : Set b}
(f : A → B) → Set _
qinv {A = A} {B = B} f =
Σ (B → A) λ g → (f ∘ g ∼ id) × (g ∘ f ∼ id)
isequiv : ∀ {a b} {A : Set a} {B : Set b}
(f : A →... |
module RTN where
data Nat : Set where
zero : Nat
suc : Nat -> Nat
{-# BUILTIN NATURAL Nat #-}
{-# BUILTIN SUC suc #-}
{-# BUILTIN ZERO zero #-}
|
{-# OPTIONS --without-K #-}
open import Data.Nat
open import Data.List using (List ; [] ; _∷_ ; length) renaming (_++_ to _++L_ )
open import Data.Vec using (Vec ; [] ; _∷_ ) renaming (_++_ to _++V_ )
open import Data.Fin hiding (_+_ ; _≤_ )
open import Data.Product
open import Data.Maybe
open import Relation.Bina... |
module GUIgeneric.GUIDefinitions where
open import GUIgeneric.Prelude
open import Relation.Binary.PropositionalEquality.TrustMe using (trustMe)
open import Relation.Nullary
data _⊎Comp_ {a b} (A : Set a) (B : Set b) : Set (a ⊔Level b) where
button : (x : A) → A ⊎Comp B
txtbox : (y : B) → A ⊎Comp B
data Direc... |
------------------------------------------------------------------------
-- The Agda standard library
--
-- Natural numbers with fast addition (for use together with
-- DifferenceVec)
------------------------------------------------------------------------
module Data.DifferenceNat where
open import Data.Nat as N usi... |
{-# OPTIONS --safe #-}
module Generics where
open import Data.Unit public using (⊤; tt)
open import Generics.Prelude public using (liftω; liftω-inst)
open import Generics.HasDesc public using (HasDesc)
open import Generics.Reflection public using (deriveDesc)
open im... |
module Data.BitVector.NumericOrder where
open import Data.Empty
open import Data.Sum
open import Data.Vec
open import Relation.Nullary
open import Relation.Binary
open import Relation.Binary.PropositionalEquality
open import Data.Nat hiding (decTotalOrder; _≟_; _<_; _≤_; module _≤_; _≤?_; compare) renaming (zero to ... |
{-# OPTIONS --cubical --safe #-}
open import Prelude
open import Relation.Binary
open import Function.Injective
module Relation.Binary.Construct.On
{a b ℓ₁ ℓ₂} {A : Type a} {B : Type b}
(f : A → B) (f-inj : Injective f)
(ord : TotalOrder B ℓ₁ ℓ₂)
where
open TotalOrder ord renaming (refl to ≤-refl)
_<′_ : A ... |
-- Andreas, 2015-06-17
-- Postponing checkArguments dropped already inserted implicit arguments.
{-# OPTIONS --show-implicit #-}
-- {-# OPTIONS -v tc.def.alias:100 -v tc.decl:10 -v tc.term.expr:20 -v tc.data.con:20 #-}
-- {-# OPTIONS -v tc.meta.assign:10 #-}
-- {-# OPTIONS -v tc.term.expr.args:80 #-}
-- {-# OPTIONS ... |
{-# OPTIONS --cubical --safe #-}
module WellFounded where
open import Level
data Acc {a r} {A : Type a} (R : A → A → Type r) (x : A) : Type (a ℓ⊔ r) where
acc : (∀ y → R y x → Acc R y) → Acc R x
-- record Acc {a r} {A : Type a} (R : A → A → Type r) (x : A) : Type (a ℓ⊔ r) where
-- inductive
-- constructor acc... |
------------------------------------------------------------------------
-- The Agda standard library
--
-- Fixed-size tables of values, implemented as functions from 'Fin n'.
-- Similar to 'Data.Vec', but focusing on ease of retrieval instead of
-- ease of adding and removing elements.
--------------------------------... |
{- 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
-}
-- This module provides some scaffolding to define the handlers for our
-- im... |
{-# OPTIONS --prop --without-K --rewriting #-}
-- Common cost monoids.
module Calf.CostMonoids where
open import Calf.CostMonoid
open import Data.Product
open import Relation.Binary.PropositionalEquality
ℕ-CostMonoid : CostMonoid
ℕ-CostMonoid = record
{ ℂ = ℕ
; _+_ = _+_
; zero = zero
; _≤_ = _≤_
; isCost... |
module Data.Sum.Instance where
open import Class.Equality
open import Class.Monoid
open import Class.Show
open import Data.Bool using (false)
open import Data.String.Instance
open import Data.Sum
open import Data.Sum.Properties
open import Relation.Binary.PropositionalEquality
open import Relation.Nullary
instance
... |
open import Data.Bool using (Bool; true; false)
open import Data.Empty using (⊥)
open import Data.Unit using (⊤; tt)
open import Relation.Binary.PropositionalEquality using (_≡_; refl; cong)
open import Relation.Nullary using (¬_)
--data _≡_ {A : Set} (x : A) : A → Set where
-- refl : x ≡ x
trans : ∀ {a} {A : Set a}... |
{-# OPTIONS --allow-unsolved-metas #-}
module Avionics.Probability where
--open import Data.Fin using (Fin; fromℕ<)
open import Data.Nat using (ℕ; zero; suc)
open import Data.Product using (_×_; _,_)
open import Data.Vec using (Vec; lookup)
open import Relation.Binary.PropositionalEquality using (refl)
open import Re... |
{-# IMPORT Issue223 #-}
data A : Set
{-# COMPILED_DECLARE_DATA A Issue223.A #-}
data B : Set
{-# COMPILED_DECLARE_DATA B Issue223.B #-}
data A where
BA : B → A
{-# COMPILED_DATA A Issue223.A Issue223.BA #-}
data B where
AB : A → B
BB : B
{-# COMPILED_DATA B Issue223.B Issue223.AB Issue223.BB #-}
|
{-# OPTIONS --cubical --safe --no-sized-types --no-guardedness #-}
module Agda.Builtin.Cubical.Path where
open import Agda.Primitive.Cubical
postulate
PathP : ∀ {ℓ} (A : I → Set ℓ) → A i0 → A i1 → Set ℓ
{-# BUILTIN PATHP PathP #-}
infix 4 _≡_
_≡_ : ∀ {ℓ} {A : Set ℓ} → A → A → Set ℓ
_≡_ {A... |
{-# OPTIONS --without-K --safe #-}
open import Categories.Category
open import Categories.Category.Monoidal.Core using (Monoidal)
module Categories.Category.Monoidal.Braided {o ℓ e} {C : Category o ℓ e} (M : Monoidal C) where
open import Level
open import Data.Product using (Σ; _,_)
open import Categories.Functor.... |
-- this is the first test I run
-- Its been a while since i used my brain, @KMx404
module test1 where
data 𝕟 : Set where
--zero : 𝕟 --its not practical to do so, we can use more efficient math formulas
suc : 𝕟 → 𝕟 -- since We have the value of zero => n, any next item succ will consider it as n.num
_+_ : �... |
module Base.Free.Instance.Identity where
open import Data.Empty using (⊥)
open import Base.Free using (Free)
-- Representation of the `Identity` monad using free.
Shape : Set
Shape = ⊥
Position : Shape → Set
Position _ = ⊥
Identity : Set → Set
Identity = Free Shape Position
|
{-# OPTIONS --cubical --no-import-sorts --safe #-}
module Cubical.ZCohomology.Groups.Sn where
open import Cubical.ZCohomology.Base
open import Cubical.ZCohomology.Properties
open import Cubical.ZCohomology.MayerVietorisUnreduced
open import Cubical.ZCohomology.Groups.Unit
open import Cubical.ZCohomology.Groups.Connect... |
{-# OPTIONS --without-K #-}
module Coinduction where
infix 1000 ♯_
postulate
∞ : ∀ {i} (A : Set i) → Set i
♯_ : ∀ {i} {A : Set i} → A → ∞ A
♭ : ∀ {i} {A : Set i} → ∞ A → A
{-# BUILTIN INFINITY ∞ #-}
{-# BUILTIN SHARP ♯_ #-}
{-# BUILTIN FLAT ♭ #-}
|
{-# OPTIONS --cubical --no-import-sorts --safe #-}
module Cubical.Data.Empty.Polymorphic where
open import Cubical.Core.Everything
open import Cubical.Foundations.Prelude
import Cubical.Data.Empty as Empty
⊥ : ∀ {ℓ} → Type ℓ
⊥ = Lift Empty.⊥
⊥-elim : ∀ {w ℓ} {Whatever : ⊥ {ℓ} → Type w} → (witness : ⊥ {ℓ}) → Whateve... |
{-# OPTIONS --safe #-}
module Cubical.Algebra.GradedRing.DirectSumHIT where
open import Cubical.Foundations.Prelude
open import Cubical.Foundations.HLevels
open import Cubical.Data.Sigma
open import Cubical.Algebra.Monoid
open import Cubical.Algebra.AbGroup
open import Cubical.Algebra.AbGroup.Instances.DirectSumHIT
... |
{-# OPTIONS --without-K --safe #-}
open import Axiom.Extensionality.Propositional using (Extensionality)
module Cats.Category.Sets.Facts
(funext : ∀ {a b} → Extensionality a b)
where
open import Cats.Category.Sets.Facts.Exponential funext public using (hasExponentials)
open import Cats.Category.Sets.Facts.Initial... |
{-# OPTIONS --cubical --safe #-}
module Relation.Unary where
open import Relation.Nullary.Decidable
open import Level
open import Path
Decidable : (A → Type b) → Type _
Decidable P = ∀ x → Dec (P x)
AtMostOne : (A → Type b) → Type _
AtMostOne P = ∀ x y → P x → P y → x ≡ y
|
open import Common.Prelude hiding (pred)
open import Common.Reflection
open import Common.Equality
un-function : Definition → FunDef
un-function (funDef cs) = funDef unknown cs
un-function _ = funDef unknown []
data Is-suc : Nat → Set where
is-suc : ∀ n → Is-suc (suc n)
pred : (n : Nat) → Is-suc n → Nat... |
open import Prelude renaming (_<_ to _N<_)
module Implicits.Resolution.GenericFinite.Algorithm where
open import Induction.WellFounded
open import Induction.Nat
open import Data.Vec
open import Data.List
open import Data.Fin.Substitution
open import Data.Nat.Base using (_<′_)
open import Data.Maybe
open import Data.N... |
------------------------------------------------------------------------
-- The Agda standard library
--
-- List Zipper-related properties
------------------------------------------------------------------------
{-# OPTIONS --without-K --safe #-}
module Data.List.Zipper.Properties where
open import Data.List.Base as... |
module ImplicitRecordFields where
record R (X Y : Set) : Set₁ where
field
{A} : Set
f : A → A
{B C} D {E} : Set
g : B → C → E → X → Y
postulate A : Set
r : R A A
r = record
{ f = f
; B = A
; D = A
; g = λ (_ _ _ : _) → f
}
where
f : A → A
f x = x
data _≡... |
-- Interpretation of partial weakenings as partial finite maps.
module Dimension.PartialWeakening.Model (E : Set) where
import Level
open import Data.Nat using (ℕ; zero; suc; _+_)
open import Data.Fin using (Fin; zero; suc)
open import Relation.Binary.PropositionalEquality
open ≡-Reasoning
open import Axiom.Functio... |
{-# OPTIONS --no-universe-polymorphism #-}
open import Induction.WellFounded as WF
open import Data.Product
open import Relation.Binary.Core
open import Relation.Unary as U using (Decidable)
open import Relation.Nullary
import Level as L using (zero)
module DivideEtImpera where
{-- This module implements a quite ge... |
------------------------------------------------------------------------------
-- Totality properties for Tree
------------------------------------------------------------------------------
{-# OPTIONS --exact-split #-}
{-# OPTIONS --no-sized-types #-}
{-# OPTIONS --no-universe-polymorphism #-}
... |
{-# OPTIONS --cubical --safe #-}
module Data.Binary.Testers where
open import Prelude
open import Data.Binary.Conversion.Fast.Strict
open import Data.Binary.Definition
open import Data.List using (List; _⋯_)
open import Data.List.Sugar using (liftA2)
test : (𝔹 → 𝔹 → 𝔹) →
(ℕ → ℕ → ℕ) →
ℕ → Type
test ... |
module FFI.Data.Either where
{-# FOREIGN GHC import qualified Data.Either #-}
data Either (A B : Set) : Set where
Left : A → Either A B
Right : B → Either A B
{-# COMPILE GHC Either = data Data.Either.Either (Data.Either.Left|Data.Either.Right) #-}
mapLeft : ∀ {A B C} → (A → B) → (Either A C) → (Either B C)
mapL... |
module Prelude.Data.Natural where
open import Prelude.Core
open import Prelude.Classes
open import Prelude.Orders
----------------
-- Conversion --
----------------
record ToNatural {ℓ} (A : Set ℓ) : Set ℓ where
constructor mk[ToNatural]
field
𝕟 : A → ℕ
open ToNatural {{…}}
-----------
-- Order --
--------... |
module Issue591.M where
|
{-# OPTIONS --without-K --safe #-}
module Experiment.TTG where
{-
data Phase : Set where
parse : Phase
scopecheck : Phase
typecheck : Phase
xVar : Phase → Set
xVar p = ?
idP : Phase → Set
idP p = ?
xNew : Phase → Set
data Exp (p : Phase) : Set where
var : xVar p → idP p → Exp p
new : xNew p → Exp p
-}
|
------------------------------------------------------------------------
-- The Agda standard library
--
-- This module is DEPRECATED. Please use
-- Data.List.Relation.Binary.Permutation.Inductive.Properties directly.
------------------------------------------------------------------------
{-# OPTIONS --without-K --sa... |
module _ where
open import Agda.Builtin.Float
open import Common.Prelude hiding (_+_; _*_)
print : Float → IO Unit
print x = putStrLn (primShowFloat x)
printB : Bool → IO Unit
printB true = putStrLn "true"
printB false = putStrLn "false"
_+_ = primFloatPlus
_*_ = primFloatTimes
_/_ = primFloatDiv
_==_ = primFloat... |
-- Andreas, 2015-07-01 polarity of the size argument to data
-- needs to be considered for polarity of later definitions.
-- {-# OPTIONS -v tc.pos:10 -v tc.polarity:20 #-}
open import Common.Size
open import Common.Prelude
data D : (i : Size) → Set where
c : ∀ i → D (↑ i)
E : Bool → Size → Set
E true i = D i
E f... |
-- issue 685
module ShadowedLetBoundVar where
import Common.Level
record Wrap {a}(A : Set a) : Set a where
constructor wrap
field wrapped : A
-- let is not recursive
works : Set → Set
works x = let x = x in x
fails : Set → Set
fails A = let wrap A = wrap A in A
-- works now
|
module hott.topology where
open import hott.topology.loopspace public
|
{-# OPTIONS --without-K --safe #-}
module Codiscrete where
open import Level using (Level; 0ℓ; lift; lower)
open import Data.Nat using (ℕ; suc)
open import Data.Fin hiding (lift)
open import Data.Unit
open import Function renaming (id to idf)
open import Relation.Binary.PropositionalEquality
using (_≡_; refl; sym; ... |
------------------------------------------------------------------------
-- The Agda standard library
--
-- Basic types related to coinduction
------------------------------------------------------------------------
{-# OPTIONS --without-K --safe #-}
module Codata.Musical.Notation where
open import Agda.Builtin.Coin... |
------------------------------------------------------------------------
-- The Agda standard library
--
-- Core definitions for Strings
------------------------------------------------------------------------
module Data.String.Core where
open import Data.List using (List)
open import Data.Bool using (Bool; true; fa... |
------------------------------------------------------------------------
-- The Agda standard library
--
-- Some basic properties of Rings
------------------------------------------------------------------------
{-# OPTIONS --without-K --safe #-}
open import Algebra
module Algebra.Properties.Ring {r₁ r₂} (R : Ring r... |
module Generic.Lib.Decidable where
open import Relation.Nullary public
open import Relation.Nullary.Decidable hiding (map) public
open import Relation.Binary using (Decidable) public
open import Generic.Lib.Intro
open import Generic.Lib.Equality.Propositional
open import Generic.Lib.Equality.Heteroindexed
open import... |
-- The following deeply left-nested expression illustrates a problem
-- in a previous implementation of the occurrence machinery.
postulate A : Set
data List : Set where
nil : List
snoc : List → A → List
f : A → List
f x = snoc (snoc (snoc (snoc (snoc (snoc (snoc (snoc (snoc (snoc (snoc (snoc (snoc (snoc (snoc ... |
{-# OPTIONS --show-implicit #-}
module PragmasRespected where
postulate
Foo : {A : Set₁} → Set
Bar : Foo {A = Set}
|
{-# OPTIONS --allow-unsolved-metas #-}
module gcd where
open import Data.Nat
open import Data.Nat.Properties
open import Data.Empty
open import Data.Unit using (⊤ ; tt)
open import Relation.Nullary
open import Relation.Binary.PropositionalEquality
open import Relation.Binary.Definitions
open import nat
open import lo... |
module Dave.Algebra.Naturals.Exponentiation where
open import Dave.Algebra.Naturals.Definition
open import Dave.Algebra.Naturals.Multiplication
open import Dave.Algebra.Naturals.Addition
_^_ : ℕ → ℕ → ℕ
a ^ zero = 1
a ^ suc b = (a ^ b) * a
infixl 8 _^_
^-distribₗ : ∀ (m n p : ℕ) → m ^ (n + p) ≡ (m ^... |
------------------------------------------------------------------------------
-- Lists of natural numbers
------------------------------------------------------------------------------
{-# OPTIONS --exact-split #-}
{-# OPTIONS --no-sized-types #-}
{-# OPTIONS --no-universe-polymorphism #-}
{-# ... |
open import Agda.Builtin.IO
open import Agda.Builtin.Unit
open import Agda.Builtin.Nat
data Unit : Set where
c : ⊤ → Nat → ⊤ → Unit
-- Note that the ⊤ arguments get erased and shouldn't be present in
-- the Haskell version of Unit.
{-# FOREIGN GHC data Unit = Unit Integer #-}
{-# COMPILE GHC Unit = data Unit (Unit... |
-- Andreas, 2018-06-12, issue #2170
-- Reported by tomjack
{-# OPTIONS --irrelevant-projections --subtyping #-}
open import Agda.Builtin.Equality
open import Agda.Builtin.Bool
infixr 42 _,_
record Σ (A : Set) (B : A → Set) : Set where
constructor _,_
field
fst : A
snd : B fst
open Σ
record Irr (A : Set)... |
module Issue73 where
record ImplicitField (a : Set) : Set where
field
aField : a
{anImplicitField} : a
open ImplicitField public
{-# COMPILE AGDA2HS ImplicitField class #-}
|
module nfa136 where
open import logic
open import nfa
open import automaton
open import Data.List
open import finiteSet
open import Data.Fin
open import Relation.Binary.PropositionalEquality hiding ( [_] )
data StatesQ : Set where
q1 : StatesQ
q2 : StatesQ
q3 : StatesQ
data A2 : Set where
a0 : ... |
open import Agda.Builtin.Sigma
open import Agda.Builtin.Equality
infix 1 Σ-syntax
Σ-syntax = Σ
syntax Σ-syntax A (λ x → B) = Σ[ x ∈ A ] B
pair : Set → Set
pair A = Σ[ _ ∈ A ] A
diag : Set → Set
diag A = Σ[ p ∈ pair A ] fst p ≡ snd p
diag-pat : Set → Set
diag-pat A = Σ[ p@(x , y) ∈ pair A ] p ≡ (y , x)
-- WAS: pars... |
{-# OPTIONS --without-K #-}
--
-- A pointed type is a type together with a point in it. This module
-- defines the universe of pointed types which we denote by Type● ℓ.
-- Like the type universe Type ℓ, it is an inhabitant of Type (ℓ + 1).
--
-- Editing notes:
-- ● : \ci followed by selecting the 1 option
-- ∙... |
{-# OPTIONS --universe-polymorphism #-}
module Graphs.Graph where
open import Level
open import Categories.Support.Equivalence
open import Relation.Binary
using (Rel; IsEquivalence; module IsEquivalence; Reflexive; Symmetric; Transitive)
renaming (_⇒_ to _⊆_)
open import Relation.Binary.PropositionalEquality
usi... |
------------------------------------------------------------------------
-- Up-to techniques for strong bisimilarity
------------------------------------------------------------------------
{-# OPTIONS --sized-types #-}
open import Labelled-transition-system
module Bisimilarity.Up-to {ℓ} (lts : LTS ℓ) where
open im... |
module Issue1232.List where
import Issue1232.Nat
|
record C (A : Set) : Set where
field f : A → A
open C {{...}}
module M (A : Set) where
data D : Set where
d : A → D
instance
CD : C D
CD = record { f = λ x → x }
data Bool : Set where
false true : Bool
open M Bool
-- Bug: M.CD is not considered in instance search
x : D
x = f (M.d false)
|
{-# OPTIONS --cubical #-}
open import Cubical.Core.Everything
Sq : {A : Set} {a0 a1 b0 b1 : A}
(u : a0 ≡ a1) (v : b0 ≡ b1)
(r0 : a0 ≡ b0) (r1 : a1 ≡ b1)
→ Set
Sq u v r0 r1 = PathP (λ i → r0 i ≡ r1 i) u v
ConstSq : {A : Set} {a : A} (p : a ≡ a) →
Sq p p p p
ConstSq {A} p i j = compCCHM (λ _... |
open import Data.Empty using (⊥-elim)
open import Data.Fin using (Fin; _≟_)
open import Data.Nat using (ℕ)
open import Data.Product using (∃-syntax; _,_)
open import Data.Sum using (_⊎_; inj₁; inj₂)
open import Data.Vec using (lookup; _[_]≔_)
open import Data.Vec.Properties using (lookup∘update; lookup∘update′)
open im... |
------------------------------------------------------------------------
-- The Agda standard library
--
-- Properties of operations on strings
------------------------------------------------------------------------
{-# OPTIONS --without-K --safe #-}
module Data.String.Properties where
open import Data.Bool.Base
op... |
{-# OPTIONS --cubical --no-import-sorts --safe #-}
module Cubical.HITs.FiniteMultiset.Properties where
open import Cubical.Foundations.Prelude
open import Cubical.Foundations.HLevels
open import Cubical.Data.Nat
open import Cubical.Data.Empty as ⊥
open import Cubical.Relation.Nullary
open import Cubical.HITs.FiniteMul... |
{-# OPTIONS --show-implicit --verbose=tc.reconstruct:50 #-}
open import ExtractSac as ES using ()
open import Extract (ES.kompile-fun)
open import Data.Nat
open import Data.List as L using (List; []; _∷_)
open import Data.Vec as V using (Vec; []; _∷_)
open import Data.Fin using (Fin; zero; suc; #_)
open import Relati... |
module Golden.Factorial where
open import Agda.Builtin.Nat
fac : Nat -> Nat
fac 0 = 1
fac (suc n) = suc n * fac n
a = fac 0
b = fac 10
|
------------------------------------------------------------------------
-- The Agda standard library
--
-- The binary relation defined by a constant
------------------------------------------------------------------------
{-# OPTIONS --without-K --safe #-}
module Relation.Binary.Construct.Constant where
open import... |
module HOAny where
open import Agda.Builtin.Nat
open import Agda.Builtin.Bool
data Wrapper (M : Set → Set) : Set where
mnat : M Nat → Wrapper M
mbool : M Bool → Wrapper M
{-# FOREIGN GHC data AgdaWrapper m = Mnat (m Integer) | Mbool (m Bool) #-}
{-# COMPILE GHC Wrapper = data AgdaWrapper (Mnat | Mbool) #-}
map... |
open import Algebra using (CommutativeRing)
module AKS.Polynomial {c ℓ} (R : CommutativeRing c ℓ) where
open import AKS.Polynomial.Properties R public
|
-- Andreas, 2016-06-02
-- The filename "Issue.1947.agda" is invalid as "1947" is not a valid name.
module _ where
|
import Lvl
module Structure.Groupoid {ℓₒ ℓₘ ℓₑ : Lvl.Level} where
open import Functional using (swap)
open import Logic
open import Logic.Predicate
open import Logic.Propositional
import Structure.Categorical.Names as Names
open import Structure.Categorical.Properties
open import Structure.Category{ℓₒ}{ℓₘ}{... |
{-# OPTIONS --universe-polymorphism #-}
module tests.Coind where
open import Prelude.IO
open import Prelude.Level
open import Prelude.Nat
open import Prelude.Unit
infix 1000 ♯_
postulate
∞ : ∀ {a} (A : Set a) → Set a
♯_ : ∀ {a} {A : Set a} → A → ∞ A
♭ : ∀ {a} {A : Set a} → ∞ A → A
{-# BUILTIN INFINITY ∞ #-... |
module Logic.Propositional.Equiv where
import Lvl
open import Logic
open import Logic.Propositional
import Logic.Propositional.Theorems as Theorems
open import Structure.Relator.Equivalence
open import Structure.Relator.Properties
open import Structure.Setoid
open import Type
private variable ℓ ℓ₁ ℓ₂ ℓₑ ℓₑ₁... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.