text stringlengths 4 690k |
|---|
------------------------------------------------------------------------
-- The Agda standard library
--
-- List-related properties
------------------------------------------------------------------------
-- Note that the lemmas below could be generalised to work with other
-- equalities than _≡_.
{-# OPTIONS --witho... |
-- Andreas, 2018-09-03, issue #3200 reported by gallais
--
-- Record let pattern bindings trigger spurious irrelevance
-- marker, probably due to confusion of Prop with dummy type.
-- {-# OPTIONS -v tc.term.let.pattern:100 #-}
-- {-# OPTIONS -v tc.lhs.top:30 #-}
open import Agda.Builtin.Bool
open import Agda.Builtin.... |
{-# OPTIONS --cubical --cumulativity #-}
open import leibniz public
open import equalities public
open import leibniz-equality public
|
{-# OPTIONS --without-K #-}
open import lib.Basics
open import lib.types.Group
open import lib.types.Lift
open import lib.groups.Homomorphisms
module lib.groups.Lift where
Lift-group-structure : ∀ {i j} {A : Type i}
→ GroupStructure A → GroupStructure (Lift {j = j} A)
Lift-group-structure GS = record
{ ident = l... |
{-# OPTIONS --show-implicit #-}
open import Relation.Binary.PropositionalEquality
module Experiments.Ref (funext : ∀ {a b} → Extensionality a b) where
open import Level
open import Data.Nat
import Data.Unit as Unit
open import Data.List
open import Data.List.Most
open import Data.Product hiding (swap)
open import Dat... |
------------------------------------------------------------------------
-- Strings
------------------------------------------------------------------------
{-# OPTIONS --without-K #-}
module String where
open import Prelude
------------------------------------------------------------------------
-- Helper code use... |
-- {-# OPTIONS --show-implicit --show-irrelevant #-}
module Data.QuadTree.FunctorProofs.Valid-QuadTreeFunctor where
open import Haskell.Prelude renaming (zero to Z; suc to S)
open import Data.Logic
open import Data.QuadTree.InternalAgda
open import Agda.Primitive
open import Data.QuadTree.FunctorProofs.FunctorLaws
ope... |
------------------------------------------------------------------------
-- Asymmetric choice
------------------------------------------------------------------------
{-# OPTIONS --universe-polymorphism #-}
module TotalParserCombinators.AsymmetricChoice where
open import Data.Empty
open import Data.List
open import ... |
{-
Agda Implementors' Meeting VI
Göteborg
May 24 - 30, 2007
Hello Agda!
Ulf Norell
-}
{-
Getting your hands on Agda
http://www.cs.chalmers.se/~ulfn/Agda
darcs get --partial http://www.cs.chalmers.se/~ulfn/darcs/Agda2
-}
-- Each ... |
open import Agda.Builtin.List
open import Agda.Builtin.Reflection
open import Agda.Builtin.Unit
postulate
F : Set → Set
module M₀ where
macro
go-tactic₀ : Term → TC ⊤
go-tactic₀ hole = unify hole (def (quote F) [])
test₀ : Set
test₀ = go-tactic₀ ⊤
module M₁ (A : Set) where
macro
go-tactic₁ : ... |
{-# OPTIONS --safe --cubical --postfix-projections #-}
module Relation.Binary where
open import Level
open import Function using (_∘_; flip; id)
open import Inspect using (inspect;〖_〗)
open import HLevels using (isSet)
open import Path as ≡ hiding (sym; refl)
open import Data.Bool using (Bool; true; ... |
{-# OPTIONS --safe #-}
data ⊥ : Set where
private
{-# TERMINATING #-}
f : ⊥
f = f
mutual
{-# TERMINATING #-}
g : ⊥
g = f
abstract
{-# TERMINATING #-}
h : ⊥
h = f
record I : Set where
{-# TERMINATING #-}
i : ⊥
i = f
instance
{-# TERMINATING #-}
j : I
j = j
|
module Duploid where
import Relation.Binary.PropositionalEquality as Eq
open Eq using (_≡_; refl; sym; cong)
open Eq.≡-Reasoning
open import Level
open import Preduploid
private
variable p q r s : Polarity
record Duploid o ℓ : Set (suc (o ⊔ ℓ)) where
field
𝒟 : Preduploid o ℓ
open Preduploid.Preduploid ... |
{- Kleisli category for a monad. -}
module CategoryTheory.Instances.Kleisli where
open import CategoryTheory.Categories
open import CategoryTheory.Functor
open import CategoryTheory.NatTrans
open import CategoryTheory.Monad
open Category
-- Kleisli category from a category ℂ and a monad on ℂ
Kleisli : ∀{n} -> (ℂ : ... |
------------------------------------------------------------------------
-- The Agda standard library
--
-- Argument visibility used in the reflection machinery
------------------------------------------------------------------------
{-# OPTIONS --without-K --safe #-}
module Reflection.Argument.Visibility where
open... |
module NotNot where
data ⊥ : Set where
Not : Set → Set
Not A = ⊥
Whoa : ∀ {A : Set} → Not (Not A) → A
Whoa ()
postulate
-- Law of excluded middle.
LEM : ∀ {A : Set} → Not (Not A) → A
Alright : ∀ {A : Set} → Not (Not A) → A
Alright p = LEM p
-- Constructive LEM requires hProp, hSet, Discrete, etc.
|
{-# OPTIONS --cubical --safe #-}
module Cubical.Structures.AbGroup where
open import Cubical.Foundations.Prelude
open import Cubical.Foundations.Equiv
open import Cubical.Foundations.HLevels
open import Cubical.Data.Sigma
open import Cubical.Foundations.SIP renaming (SNS-PathP to SNS)
open import Cubical.Structures.N... |
-- Andreas, 2015-11-18, issue 1692 reported by m0davis
-- {-# OPTIONS -v tc.with.top:20 #-}
open import Common.Level
open import Common.Equality
open import Common.Product
postulate
Key : Set
Value : Key → Set
anyOf : ∀{A : Set} → A → A → A
data Tree : Set where
node : (k : Key) (v : Value k) → Tree
data... |
------------------------------------------------------------------------
-- The rec construction can be encoded using λ-terms
------------------------------------------------------------------------
module Recursion-without-rec where
open import Equality.Propositional.Cubical
open import Prelude hiding (id; swap)
im... |
-- TODO
-- Basic Tarski-style semantics, for soundness only.
module BasicT.Semantics.BasicTarski where
open import BasicT.Syntax.Common public
-- Tarski models.
record Model : Set₁ where
infix 3 ⊩ᵅ_
field
-- Forcing for atomic propositions.
⊩ᵅ_ : Atom → Set
open Model {{…}} public
-- Forcing in a pa... |
open import Agda.Primitive
record Setoid (a : Level) : Set₁ where
constructor mk
field
carrier : Set
record HeytingAlgebra {a} (setoid : Setoid a) (A : Set) : Set a where
constructor laws
open Setoid setoid
field ∧-cong : carrier
|
{-# OPTIONS --exact-split #-}
{-# OPTIONS --no-sized-types #-}
{-# OPTIONS --no-universe-polymorphism #-}
{-# OPTIONS --without-K #-}
module Bottom where
open import Common.FOL.FOL-Eq
postulate bot : ⊥
postulate
zero : D
succ : D → D
postulate false : zero ≡ succ zero
{-# ... |
------------------------------------------------------------------------
-- Unit tests for Tactic.By.Parametrised
------------------------------------------------------------------------
-- Nothing is exported from this module.
{-# OPTIONS --without-K --safe #-}
open import Equality
module Tactic.By.Parametrised.Te... |
------------------------------------------------------------------------
-- A parametrised coinductive definition that can be used to define
-- strong and weak bisimilarity as well as expansion
------------------------------------------------------------------------
{-# OPTIONS --sized-types #-}
open import Prelude
... |
------------------------------------------------------------------------
-- Some theory of Erased, developed using Cubical Agda
------------------------------------------------------------------------
-- This module instantiates and reexports code from Erased.
{-# OPTIONS --erased-cubical --safe #-}
import Equality.... |
-- Andreas, 2019-07-11, issue #3843, reported by shinji-kono
-- recordExpressionToCopattern translation invalidates projection-likeness.
-- {-# OPTIONS -v tc.proj.like:100 -v impossible:10 #-}
data _≡_ {a} {A : Set a} (x : A) : A → Set a where
refl : x ≡ x
postulate
ANY : ∀{a} {A : Set a} → A
Nat : Set
suc... |
------------------------------------------------------------------------
-- The Agda standard library
--
-- Costrings
------------------------------------------------------------------------
{-# OPTIONS --without-K #-}
module Codata.Musical.Costring where
open import Codata.Musical.Colist as Colist using (Colist)
op... |
-- Andreas, AIM XXIII, 2016-04-25
-- Parameter arguments of overloaded projection applications
-- should not be skipped!
record R A : Set where
field f : {x y : A} → A
open R
record S A : Set where
field f : {x y : A} → A
open S
r : ∀{A} → R A
f r {x} = x
test : ∀{A B : Set} (a : A) (b : B) → A
test {A} a b = ... |
module README where
------------------------------------------------------------------------
-- Core definitions
------------------------------------------------------------------------
import Generics.Prelude
-- Generics.Telescope introduces an encoding for telescopes,
-- along with functions to manipulate indexed ... |
open import Formalization.PredicateLogic.Signature
module Formalization.PredicateLogic.Classical.Semantics.Satisfaction (𝔏 : Signature) {ℓₘ} where
open Signature(𝔏)
import Lvl
open import Data
open import Data.Boolean
open import Data.Boolean.Stmt
open import Data.ListSized
import Data.ListSized.Functions... |
-- Andreas, 2017-10-04, issue #2765, reported by nad
-- Problem: inferred level expressions are often "reversed"
open import Agda.Primitive
postulate
F : (ℓ : Level) → Set ℓ
G : (a b c : Level) → Set {!!} -- C-c C-=
G a b c = F a → F b → F c
-- WAS:
-- ?0 := c ⊔ (b ⊔ a)
-- Expected: Inferred level should be
-- ... |
{-# OPTIONS --without-K --safe #-}
module Categories.GlobularSet where
-- Globular sets are defined in a Categorical context, but
-- should they be inside the Categories hierarchy?
open import Level
open import Data.Unit using (⊤)
open import Relation.Binary.PropositionalEquality using (refl)
open import Categories.... |
module Data.QuadTree.InternalAgda where
open import Data.QuadTree.Implementation.Definition
open import Data.QuadTree.Implementation.PublicFunctions
open import Data.QuadTree.Implementation.Functors
open import Data.QuadTree.Implementation.ValidTypes
open import Data.QuadTree.Implementation.QuadrantLenses
open import ... |
module _ where
module M where
postulate A : Set
module N = M -- This alias introduces a display form M.A --> N.A
open M
postulate
a : A
{-# DISPLAY N.A = A #-} -- Makes Agda loop
test : Set
test = a
|
{-# 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.DualizedHigherBoundary (OT : OrdinaryTheory lzero)
{n} (⊙fin-skel : ⊙FinSkeleton (S (S n))) where
open OrdinaryTheory OT
privat... |
------------------------------------------------------------------------------
-- A partial function: iter₀
------------------------------------------------------------------------------
{-# OPTIONS --exact-split #-}
{-# OPTIONS --no-sized-types #-}
{-# OPTIONS --no-universe-polymorphism #-}
{-#... |
{-# OPTIONS --sized-types #-}
open import Relation.Binary.Core
module BubbleSort.Correctness.Permutation {A : Set}
(_≤_ : A → A → Set)
(tot≤ : Total _≤_) where
open import BubbleSort _≤_ tot≤
open import Data.Product
open import Data.List
open import Data.Sum
open import List.Permu... |
---------------------------------------------------------------------------
-- The rec definition using the fixed-point combinator
---------------------------------------------------------------------------
{-# OPTIONS --exact-split #-}
{-# OPTIONS --no-sized-types #-}
{-# OPTIONS --no-universe-... |
open import Prelude
open import Nat
open import Agda.Primitive using (Level; lzero; lsuc) renaming (_⊔_ to lmax)
module List where
-- definitions
data List (A : Set) : Set where
[] : List A
_::_ : A → List A → List A
_++_ : {A : Set} → List A → List A → List A
[] ++ l₂ = l₂
(h :: l₁) ++ l₂ = h :: ... |
{-# OPTIONS --safe #-}
module Definition.Conversion.Soundness where
open import Definition.Untyped
open import Definition.Typed
open import Definition.Typed.Properties
open import Definition.Conversion
open import Definition.Conversion.Whnf
open import Definition.Typed.Consequences.Syntactic
open import Definition.Ty... |
{-
This second-order term syntax was created from the following second-order syntax description:
syntax Empty | E
type
𝟘 : 0-ary
term
abort : 𝟘 -> α
theory
(𝟘η) e : 𝟘 c : α |> abort(e) = c
-}
module Empty.Syntax where
open import SOAS.Common
open import SOAS.Context
open import SOAS.Variable
open im... |
postulate
A : Set
f : {{_ : A}} → A
f = {!!}
|
open import Oscar.Prelude
open import Oscar.Class
open import Oscar.Class.Surjection
open import Oscar.Class.Smap
open import Oscar.Data.Constraint
module Oscar.Class.Surjextensionality where
module Surjextensionality
{𝔬₁ 𝔯₁ ℓ₁ 𝔬₂ 𝔯₂ ℓ₂} {𝔒₁ : Ø 𝔬₁} {𝔒₂ : Ø 𝔬₂}
(_∼₁_ : 𝔒₁ → 𝔒₁ → Ø 𝔯₁)
(_∼̇₁_ : ∀ {x ... |
{-# OPTIONS --exact-split #-}
-- {-# OPTIONS -v tc.cover.splittree:10 #-}
open import Common.Prelude
open import Common.Equality
test : {m n : Nat} → m ≡ n → Nat
test {zero} refl = zero
test {suc m} refl = suc m
|
open import Data.Nat using (ℕ; suc)
open import Data.Fin using (Fin; zero; suc)
infix 9 #_
infixl 7 _·_
infix 6 ƛ_
data Term : ℕ → Set where
#_ : ∀ {n : ℕ} → Fin n → Term n
ƛ_ : ∀ {n : ℕ} → Term (suc n) → Term n
_·_ : ∀ {n : ℕ} → Term n → Term n → Term n
Rename : ℕ → ℕ → Set
Rename n m = ... |
module Formalization.PrimitiveRecursion where
import Lvl
open import Data
open import Data.ListSized
open import Numeral.Finite
open import Numeral.Natural
open import Syntax.Number
open import Type{Lvl.𝟎}
-- Function(n) is a syntactic representation of primitive recursive functions of type (ℕⁿ → ℕ).
-- The syn... |
{-# OPTIONS --type-in-type #-}
-- {-# OPTIONS -v tc.pos:10 -v tc.polarity:10 #-}
-- Andreas, 2012-09-06, message on Agda list "Forget Hurken's paradox..."
module Issue690 where
infix 4 _≡_
data _≡_ {A : Set} (x : A) : A → Set where
refl : x ≡ x
data ⊥ : Set where
data D : Set where
abs : ∀ {E : Set} → D ≡ E → ... |
module Prelude.Empty where
open import Prelude.Erased
data ⊥ : Set where
⊥-elim : ∀ {a} {A : Set a} → ⊥ → A
⊥-elim ()
{-# INLINE ⊥-elim #-}
private postulate erasedBottom : ⊥
{-# DISPLAY erasedBottom = [erased] #-}
erase-⊥ : ⊥ → ⊥
erase-⊥ _ = erasedBottom
infix 4 ¬_
¬_ : ∀ {a} (A : Set a) → Set a
¬ A = A → ⊥
e... |
------------------------------------------------------------------------
-- Dependent lenses
------------------------------------------------------------------------
-- Some code below depends on UIP for Set ℓ (for some ℓ). This kind of
-- assumption is inconsistent in Cubical Agda. However, Andrea Vezzosi
-- and I ha... |
{-# OPTIONS --without-K --exact-split --safe #-}
module Fragment.Extensions.CSemigroup where
open import Fragment.Extensions.CSemigroup.Base using (CSemigroupFrex) public
|
{-# OPTIONS --without-K #-}
module BimonoidalCategory where
open import Level
open import Categories.Category
open import Categories.Monoidal
open import Categories.Monoidal.Braided
open import Categories.NaturalIsomorphism
open import Categories.NaturalTransformation using (id; _∘₁_; _≡_)
-------------------------... |
module Main where
import Automaton.DeterministicFinite
import Automaton.NonDeterministicFinite
import Automaton.Pushdown
import Automaton.TuringMachine
import Cardinal
import Cardinal.Finite.Count
import Cardinal.Proofs
import Data
import Data.Any
import Data.Boolean
import Data.Boolean.Stmt
import Data.Boolean.Operat... |
open import Function using (_$_)
open import Relation.Binary using (Setoid)
open import Data.Product using (_,_)
open import Algebra.Bundles using (RawGroup; RawRing)
open import Algebra.Structures using (IsGroup; IsAbelianGroup; IsRing; IsCommutativeRing)
open import AKS.Algebra.Structures using (IsNonZeroCommutati... |
{-# OPTIONS --without-K #-}
open import lib.Basics
open import lib.types.Cospan
open import lib.types.Pullback
open import lib.types.Group
open import lib.groups.Homomorphisms
module lib.groups.PullbackGroup where
-- φ ψ
-- H → G ← K
record Group-Cospan {i j k : ULevel} : Type (lsucc (lmax (lmax i j) k)) where
... |
------------------------------------------------------------------------
-- Lemmas related to bisimilarity and CCS, implemented using the
-- classical definition of bisimilarity
------------------------------------------------------------------------
{-# OPTIONS --sized-types #-}
open import Prelude
module Bisimilar... |
{-# OPTIONS --safe #-}
module Cubical.Categories.Functors.HomFunctor where
open import Cubical.Foundations.Prelude
open import Cubical.Categories.Category
open import Cubical.Categories.Functor.Base
open import Cubical.Categories.Instances.Sets
open import Cubical.Categories.Constructions.BinProduct renaming (_×_ to ... |
{-# OPTIONS --allow-exec #-}
module ExecAgda where
open import Agda.Builtin.Equality
open import Agda.Builtin.List
open import Agda.Builtin.Nat
open import Agda.Builtin.Unit
open import Agda.Builtin.Sigma
open import Agda.Builtin.String
open import Agda.Builtin.Reflection renaming (bindTC to _>>=_)
postulate
execT... |
module Nat where
data Nat : Set where
zero : Nat
suc : Nat -> Nat
infixl 60 _+_
infixl 70 _*_
_+_ : Nat -> Nat -> Nat
n + zero = n
n + suc m = suc (n + m)
_*_ : Nat -> Nat -> Nat
n * zero = zero
n * suc m = n * m + n
{-# BUILTIN NATURAL Nat #-}
{-# BUILTIN ZERO zero #-}
{-# BUILTIN SUC suc #-}
{-# BUILTIN ... |
open import Prelude
module Implicits.Resolution.Termination.Lemmas.SizeMeasures
where
open import Induction.WellFounded
open import Induction.Nat
open import Data.Vec
open import Data.Fin.Substitution
open import Extensions.Vec
open import Implicits.Syntax
open import Implicits.Syntax.Type.Unification
open import I... |
module Thesis.ANormalCTerm where
open import Thesis.ANormalDTerm
-- OK, this is all cool, but let's drop all this typing.
data CType : Set where
cache : CType
input : Type → CType
open import Data.Product
⟦_⟧CType : CType → Set
-- This is a lie, since we might need to store more complex values in there,
-- incl... |
module Int where
open import Data.Product
open import Data.Sum as S
open import Relation.Binary.PropositionalEquality as Eq
open import Relation.Binary.Core
open import Relation.Binary
open import Function.Equality hiding (cong)
open import Data.Empty
import Level
open import Nat
open Eq.≡-Reasoning
ℤb : Set
ℤb = ℕ ... |
module Issue215 where
open import Imports.Bool
{-# COMPILE GHC Bool = data Bool (True | False) #-}
|
------------------------------------------------------------------------------
-- Example of lambda-lifting
------------------------------------------------------------------------------
{-# OPTIONS --exact-split #-}
{-# OPTIONS --no-universe-polymorphism #-}
{-# OPTIONS --universal-quantified... |
{-# OPTIONS --without-K #-}
module Ch2 where
-- open import lib.Base
open import Base
module Ex2-1 where
{-
Lemma 2.1.2. For every type A and every x, y, z : A there is a function
(x = y) → (y = z) → (x = z)
written p → q → p ∙ q, such that reflx ∙ reflx ≡ reflx for any x : A.
... |
{-# OPTIONS --cubical --safe #-}
module Algebra.Construct.Free.Semilattice.Relation.Unary.All.Dec where
open import Prelude hiding (⊥; ⊤)
open import Algebra.Construct.Free.Semilattice.Eliminators
open import Algebra.Construct.Free.Semilattice.Definition
open import Cubical.Foundations.HLevels
open import Data.Empty.... |
{-# OPTIONS --cubical #-}
open import Agda.Builtin.Cubical.Path
-- Works:
data Truncate (A : Set) : Set where
[_] : A → Truncate A
sq : ∀{x y} (p q : PathP (λ _ → Truncate A) x y)
→ PathP (λ _ → PathP (λ _ → Truncate A) x y) p q
data Truncat (A : Set) : Set where
[_] : A → Truncat A
sq : ∀{x y :... |
{-
This file contains:
- Definition of groupoid truncations
-}
{-# OPTIONS --cubical --no-import-sorts --safe #-}
module Cubical.HITs.GroupoidTruncation.Base where
open import Cubical.Core.Primitives
-- groupoid truncation as a higher inductive type:
data ∥_∥₃ {ℓ} (A : Type ℓ) : Type ℓ where
∣_∣₃ : A → ∥ A ∥₃
... |
open import Oscar.Prelude
open import Oscar.Class
open import Oscar.Class.Congruity
open import Oscar.Class.Transextensionality
open import Oscar.Class.Transitivity
open import Oscar.Data.Proposequality
import Oscar.Class.Congruity.Proposequality
module Oscar.Class.Transextensionality.Proposequality where
instance
... |
------------------------------------------------------------------------------
-- Note on the equality type class using instance arguments
------------------------------------------------------------------------------
{-# OPTIONS --exact-split #-}
{-# OPTIONS --no-sized-types #-}
{-# OPTIONS --n... |
{-# OPTIONS --cubical --no-import-sorts --safe #-}
module Cubical.Categories.Limits.Terminal where
open import Cubical.Foundations.Prelude
open import Cubical.Data.Sigma
-- open import Cubical.Categories.Limits.Base
open import Cubical.Categories.Category
open import Cubical.Categories.Functor
private
variable
... |
module MLib.Semirings where
open import MLib.Prelude
open Algebra using (Semiring)
module _ {ℓ p} (semiring : Semiring ℓ p) where
open Semiring semiring renaming (Carrier to S)
pow : ℕ → S → S
pow Nat.zero x = 1#
pow (Nat.suc n) x = x * pow n x
powsum : ℕ → S → S
powsum Nat.zero x = 1#
powsum (Nat.suc... |
-- Andreas, 2016-12-30, issue #2368 reported by m0davis
-- {-# OPTIONS -v interaction.give:100 -v tc.constr:30 #-}
open import Agda.Builtin.Reflection
macro
mac : Term → Term → TC _
mac = {!!}
foo : Set → Set → Set
foo = mac (foo {!Term!} {!Term!}) -- give both solutions
-- WAS: internal error after giving th... |
{-# OPTIONS --no-termination-check #-}
module Pi-reasoning where
open import Data.Empty
open import Data.Unit hiding (_≟_)
open import Data.Bool hiding (_≟_)
open import Data.Nat
open import Data.List
open import Data.Sum hiding (map)
open import Data.Product hiding (map)
open import Level hiding (suc)
o... |
-----------------------------------------------------------------------
-- This file formalizes the proof that Dial₂(Sets) is indeed a model --
-- of Full Tensorial Logic. See Lemma 16 and Lemma 17 of the paper. --
-----------------------------------------------------------------------
module Tensorial where
open imp... |
module Grove where
open import Axiom.Extensionality.Propositional
open import Data.Bool hiding (_<_; _≟_)
open import Function.Equivalence hiding (_∘_)
open import Function hiding (_⇔_)
open import Function.Equality using (_⟨$⟩_)
open import Level using (Level)
open import Relation.Binary.PropositionalEquality hiding ... |
open import Agda.Builtin.Equality
open import Agda.Builtin.Sigma
data Unit : Set where
unit : Unit
record _∼_ (From To : Set) : Set where
field
to : From → To
from : To → From
to-from : ∀ {x} → to (from x) ≡ x
postulate
P : {A : Set} → A → Set
f : {A B : Set} (A∼B : A ∼ B) (x : A) → P (_... |
module CompilingCoinduction where
open import Common.Coinduction
open import Common.Char
open import Common.String
data Unit : Set where
unit : Unit
{-# COMPILE GHC Unit = data () (()) #-}
postulate
IO : Set → Set
{-# COMPILE GHC IO = type IO #-}
{-# BUILTIN IO IO #-}
{-# FOREIGN GHC import qualified Data.Te... |
module Fail.BadBuiltinImport where
import Agda.Builtin.Nat
{-# FOREIGN AGDA2HS
import RandomModule (Natural)
import AlsoNotRight (foo, Natural(..))
import AsConstructor (D(Natural))
#-}
|
module Functional.Dependent where
import Lvl
open import Type
private variable ℓ ℓ₁ ℓ₂ : Lvl.Level
-- Function type as a function
_→ᶠ_ : (X : Type{ℓ₁}) → (Type{ℓ₁} → Type{ℓ₂}) → Type{ℓ₁ Lvl.⊔ ℓ₂}
X →ᶠ Y = X → Y(X)
infixl 30 _→ᶠ_
module _ where
private variable X : Type{ℓ}
private variable Y : X → Type{ℓ}
... |
{-# OPTIONS --omega-in-omega #-}
open import Agda.Primitive
test : Setω
test = Setω
record R : Setω where
field
A : ∀ {ℓ} → Set ℓ
data Type : Setω where
el : ∀ {ℓ} → Set ℓ → Type
|
{-# OPTIONS --without-K --safe #-}
open import Categories.Category
-- Properties relating Initial and Terminal Objects,
-- and Product / Coproduct via op
module Categories.Object.Duality {o ℓ e} (C : Category o ℓ e) where
open Category C
open import Level
open import Relation.Binary.PropositionalEquality as ≡ using... |
module Impure.LFRef.Eval where
open import Prelude
open import Data.Fin using (fromℕ≤)
open import Data.List hiding ([_])
open import Data.List.All
open import Data.List.Any
open import Data.Vec hiding (map; _∷ʳ_)
open import Data.Maybe hiding (All; Any)
open import Extensions.List as L
open import Impure.LFRef.Synta... |
{-# OPTIONS --cubical --no-import-sorts --safe #-}
module Cubical.Algebra.RingSolver.Examples where
open import Cubical.Foundations.Prelude
open import Cubical.Algebra.CommRing
open import Cubical.Algebra.RingSolver.ReflectionSolving
private
variable
ℓ : Level
module Test (R : CommRing {ℓ}) where
open CommR... |
module Luau.RuntimeType.ToString where
open import FFI.Data.String using (String)
open import Luau.RuntimeType using (RuntimeType; function; number; nil)
runtimeTypeToString : RuntimeType → String
runtimeTypeToString function = "function"
runtimeTypeToString number = "number"
runtimeTypeToString nil = "nil"
|
{-# OPTIONS --without-K --safe #-}
module Categories.Category.Inverse where
open import Level using (Level; suc; _⊔_)
open import Categories.Category
import Categories.Morphism
record Inverse {o ℓ e} (C : Category o ℓ e) : Set (o ⊔ ℓ ⊔ e) where
open Category C public
open Definitions C public
open Categories.M... |
{-# OPTIONS --without-K --safe #-}
open import Level
open import Categories.Category
module Categories.Functor.Power.NaturalTransformation {o ℓ e : Level} (C : Category o ℓ e) where
open import Data.Nat using (ℕ)
open import Data.Fin using (Fin; inject+; raise)
open import Data.Sum using (_⊎_; [_,_]′; inj₁; inj₂)
ope... |
-- Record declarations can now contain arbitrary declarations.
-- These are included in the projection module.
module FancyRecordModule where
data Nat : Set where
zero : Nat
suc : Nat -> Nat
record Exist {A : Set}(P : A -> Set) : Set where
field witness : A
x = witness
field proof : P x
silly : Nat ->... |
module ExtendedLambdaCase where
data Bool : Set where
true false : Bool
data Void : Set where
foo : Bool -> Bool -> Bool -> Bool
foo = λ { x → λ { y z → {!!} } }
module parameterised {A : Set}(B : A -> Set) where
data Bar : (Bool -> Bool) -> Set where
baz : (t : Void) -> Bar λ { x → {!!} }
-- with hidde... |
------------------------------------------------------------------------
-- The Agda standard library
--
-- Conversion of < to ≤, along with a number of properties
------------------------------------------------------------------------
-- Possible TODO: Prove that a conversion ≤ → < → ≤ returns a
-- relation equivale... |
record R : Set₂ where
field
f : Set₁
f : Set → R
f .R.f = Set
|
------------------------------------------------------------------------
-- The Agda standard library
--
-- An explanation about how to use the solver in Tactic.MonoidSolver.
------------------------------------------------------------------------
open import Algebra
module README.Tactic.MonoidSolver {a ℓ} (M : Monoi... |
{- 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
open import LibraBFT... |
-- exercises-04-thursday.agda
open import mylib
-- 1. Coinduction
{-
Now your task is to define multiplication _*∞_ for conatural numbers.
This is harder then it sounds. Why? Because to check termination of
corecursive programs agda needs to make sure that if you want to find out a
finite amout of informati... |
module Async where
open import Data.Fin
open import Data.List hiding (drop)
open import Data.List.All
open import Typing renaming (send to ssend ; recv to srecv)
open import Syntax
open import Values
-- an asynchronous channel is a promise for a channel
ASession DSession : STypeF SType → STypeF SType
ASession s = sr... |
module Sessions.Semantics where
|
{-# OPTIONS --without-K --safe #-}
module Categories.Functor.Monoidal.Properties where
open import Level
open import Data.Product using (_,_)
open import Categories.Category
open import Categories.Category.Monoidal
open import Categories.Category.Cartesian.Structure
open import Categories.Functor renaming (id to idF... |
------------------------------------------------------------------------------
-- Mirror example
------------------------------------------------------------------------------
{-# OPTIONS --exact-split #-}
{-# OPTIONS --no-sized-types #-}
{-# OPTIONS --no-universe-polymorphism #-}
{-# OPTIONS --... |
{-# OPTIONS --safe --without-K #-}
module Generics.Telescope.Equality where
-- freely inspired by jespercockx/telescopic
-- note that our telescopes extend to the right
-- while in telescopic they extend to the left
-- a byproduct is that the following defs are overly mutual
open import Generics.Prelude
open import ... |
module ShouldBePi where
postulate X : Set
|
{-# OPTIONS --no-flat-split #-}
module _ where
postulate
A : Set
data Id (A : Set) : Set where
id : A → Id A
-- --no-flat-split disables matching on the @♭ x agument.
test2 : (@♭ x : Id A) → A
test2 (id x) = x
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.