text stringlengths 4 690k |
|---|
-- Andreas, 2015-05-06 issue reported by andor.penzes@prezi.com
record CoList : Set
data CoList : Set where
record CoList where
-- Error WAS:
-- An internal error has occurred. Please report this as a bug.
-- Location of the error: src/full/Agda/Syntax/Concrete/Definitions.hs:479
-- Error should be:
-- Duplicate... |
------------------------------------------------------------------------
-- Sequential colimits
------------------------------------------------------------------------
{-# OPTIONS --erased-cubical --safe #-}
-- The definition of sequential colimits and the statement of the
-- non-dependent universal property are bas... |
{-# OPTIONS --without-K #-}
{-
Adapted from Ulrik's work in Lean (released under Apache License 2.0)
https://github.com/leanprover/lean/blob/master/hott/homotopy/cellcomplex.hlean
-}
open import HoTT
module cw.CW where
open import cw.Attached public
{-
Naming convension: most of them have the "cw-" prefix
-}... |
module Inductive.Examples.Unit where
open import Inductive
open import Tuple
open import Data.Fin
open import Data.Product
open import Data.List
open import Data.Vec
⊤ : Set
⊤ = Inductive (([] , []) ∷ [])
unit : ⊤
unit = construct zero [] []
|
------------------------------------------------------------------------
-- The Agda standard library
--
-- Convenient syntax for "equational reasoning" using a preorder
------------------------------------------------------------------------
-- I think that the idea behind this library is originally Ulf
-- Norell's. ... |
{-# OPTIONS --without-K --safe #-}
open import Algebra.Structures.Bundles.Field
module Algebra.Linear.Structures.GL
{k ℓᵏ} (K : Field k ℓᵏ)
{a ℓ}
where
open import Relation.Binary using (Setoid)
open import Algebra.Linear.Structures.Bundles
open import Algebra.Linear.Morphism.Bundles K
open import Categories.C... |
module Imports.TheWrongName where
|
-- Prop has been removed from the language
module PropNoMore where
postulate
X : Prop
|
{-A
Polynomials over commutative rings
==================================
-}
{-# OPTIONS --safe #-}
----------------------------------
module Cubical.Algebra.Polynomials where
open import Cubical.HITs.PropositionalTruncation
open import Cubical.Foundations.Prelude
open import Cubical.Foundations.HLevels
open import... |
------------------------------------------------------------------------
-- Empty type
------------------------------------------------------------------------
module Data.Empty where
data ⊥ : Set where
⊥-elim : {whatever : Set} → ⊥ → whatever
⊥-elim ()
|
------------------------------------------------------------------------------
-- Testing the translation of wild card patterns
------------------------------------------------------------------------------
{-# OPTIONS --exact-split #-}
{-# OPTIONS --no-sized-types #-}
{-# OPTIONS --no-universe-... |
open import Oscar.Prelude
open import Oscar.Class
open import Oscar.Class.Transitivity
open import Oscar.Class.Reflexivity
open import Oscar.Class.Transleftidentity
open import Oscar.Class.Transrightidentity
open import Oscar.Class.Symmetry
open import Oscar.Class.Hmap
open import Oscar.Class.Leftunit
module Oscar.Cl... |
module Subset where
data Subset (A : Set) (P : A -> Set) : Set where
inn : (a : A) -> .(P a) -> Subset A P
out : forall {A P} -> Subset A P -> A
out (inn a p) = a
|
module Bool where
import Logic
open Logic
data Bool : Set where
false : Bool
true : Bool
infixr 5 _&&_
_&&_ : Bool -> Bool -> Bool
true && x = x
false && _ = false
not : Bool -> Bool
not true = false
not false = true
IsTrue : Bool -> Set
IsTrue true = True
IsTrue false = False
IsFalse : Bool -> Set
IsFa... |
-- {-# OPTIONS -v tc.term.let.pattern:20 #-}
-- Andreas, 2013-05-06 deep let-bound patterns were translated wrongly
module Issue843 {A B C : Set} (a : A) (b : B) (c : C) where
open import Common.Product
open import Common.Equality
T : Set
T = A × B × C
val : T
val = a , (b , c)
-- This was translated wrongly:
ap : ... |
{-# OPTIONS --without-K --allow-unsolved-metas #-}
module subuniverses where
import 14-univalence
open 14-univalence public
{-
is-local :
{l1 l2 l3 l4 : Level}
{I : UU l1} {A : I → UU l2} {B : I → UU l3} (f : (i : I) → A i → B i)
(X : UU l4) → UU (l1 ⊔ (l2 ⊔ (l3 ⊔ l4)))
is-local {I = I} {B = B} f X =
(i : I)... |
open import Relation.Binary.Core
module PLRTree.Push.Permutation {A : Set}
(_≤_ : A → A → Set)
(tot≤ : Total _≤_) where
open import Data.List
open import Data.Sum
open import Induction.WellFounded
open import List.Permutation.Base A
open import List.Permutation.Base.Concate... |
{-# OPTIONS --rewriting --prop --confluence-check #-}
open import Agda.Primitive
open import Agda.Builtin.Bool
open import Agda.Builtin.Nat
open import Agda.Builtin.List
open import Agda.Builtin.Equality
open import Agda.Builtin.Equality.Rewrite
open import Agda.Builtin.Sigma
open import Agda.Builtin.Unit
open import ... |
{-# OPTIONS --without-K --safe #-}
open import Algebra.Solver.Ring.AlmostCommutativeRing
-- Some specialised tools for equaltional reasoning.
module Polynomial.Reasoning
{a ℓ}
(ring : AlmostCommutativeRing a ℓ)
where
open AlmostCommutativeRing ring
open import Relation.Binary.Reasoning.Inference setoid public
... |
module Logic.Propositional where
open import Data
open import Data.Either as Either using (_‖_)
open import Data.Tuple as Tuple using (_⨯_ ; _,_)
open import Functional
open import Logic
import Lvl
open import Type
infixl 1010 ¬_ ¬¬_
infixl 1005 _∧_
infixl 1004 _∨_
infixl 1000 _↔_
------------------------------... |
{- Basic theory about transport:
- transport is invertible
- transport is an equivalence ([transportEquiv])
-}
{-# OPTIONS --cubical --safe #-}
module Cubical.Foundations.Transport where
open import Cubical.Core.Everything
open import Cubical.Foundations.Prelude
open import Cubical.Foundations.Equiv
-- Direct defi... |
------------------------------------------------------------------------
-- Injections
------------------------------------------------------------------------
{-# OPTIONS --without-K --safe #-}
open import Equality
module Injection
{reflexive} (eq : ∀ {a p} → Equality-with-J a p reflexive) where
open Derived-def... |
module Negation where
-- Imports
open import Relation.Binary.PropositionalEquality using (_≡_; refl)
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 (_×_)
-- open import plfa.part1.Isomorphism using (_≃_; ex... |
{-# OPTIONS --copatterns #-}
module Control.Functor.NaturalTransformation where
open import Function using (id; _∘_)
open import Relation.Binary
open import Relation.Binary.PropositionalEquality
using (_≡_; refl; sym; trans; cong; cong₂; module ≡-Reasoning)
open ≡-Reasoning
open import Control.Functor using (Funct... |
module Test2 where
open import Test
-- Testing the inter-file goto facility.
test : ℕ
test = 12 + 34 + 56
-- Testing qualified names.
Eq = Test.Equiv {Test.ℕ}
|
module Sort (A : Set)(_<_ : A → A → Set) where |
module Everything where
open import Relation.Binary.Core
postulate A : Set
postulate _≤_ : A → A → Set
postulate tot≤ : Total _≤_
postulate trans≤ : Transitive _≤_
open import BBHeap.Everything _≤_ tot≤ trans≤
open import BHeap.Everything _≤_ tot≤
open import BTree.Complete.Alternative.Correctness {A}
open import... |
-----------------------------------------------------------------------
-- This file defines DC₂(Sets) and its SMC structure. --
-----------------------------------------------------------------------
module DC2Sets where
open import prelude
-- The objects:
Obj : Set₁
Obj = Σ[ U ∈ Set ] (Σ[ X ∈ Set ] (U ... |
module Esterel.Lang.CanFunction.MergePotentialRuleLeftBase where
open import utility
renaming (_U̬_ to _∪_ ; _|̌_ to _-_)
open import Esterel.Lang
open import Esterel.Lang.Binding
open import Esterel.Lang.CanFunction
open import Esterel.Lang.CanFunction.Base
open import Esterel.Lang.CanFunction.CanThetaContinuation... |
{-
This second-order signature was created from the following second-order syntax description:
syntax CommMonoid | CM
type
* : 0-ary
term
unit : * | ε
add : * * -> * | _⊕_ l20
theory
(εU⊕ᴸ) a |> add (unit, a) = a
(εU⊕ᴿ) a |> add (a, unit) = a
(⊕A) a b c |> add (add(a, b), c) = add (a, add(b, c))
... |
{-# OPTIONS --type-in-type #-}
module AgdaPrelude where
data Nat : Set where
Zero : Nat
Succ : Nat -> Nat
natElim : (m : Nat -> Set) -> (mz : m Zero) -> (ms : (l : Nat) -> m l -> m (Succ l)) -> (k : Nat) -> m k
natElim m mz ms Zero = mz
natElim m mz ms (Succ k) = ms k (natElim m mz ms k)
data Vec : Set -> Nat -... |
module TypeSig where
f
: {A : Set}
→ A
→ A
f x
= x
g
: {A : Set}
→ A
→ A
g x
= x
h
: {A : Set}
→ A
→ A
h x
= f x
_
: {A : Set}
→ A
→ A
_
= λ x → x
|
module Issue317 (A : Set) where
postulate F : Set → Set
-- Try evaluating F A at the top-level:
--
-- 1,3-4
-- Not in scope:
-- A at 1,3-4
-- when scope checking A
--
-- OK, in that case the inferred type of F should be
-- (A : Set) → Set → Set, right? No, it isn't, it's Set → Set.
--
-- I think the parameters shou... |
-- In this document we'll consider various encodings of mutual data types,
-- including those that are System Fω compatible.
module MutualData where
open import Function
open import Data.Unit.Base
open import Data.Sum
open import Data.Product
-- In the first part of this document we'll demostrate how various encodin... |
module Luau.RuntimeError.ToString where
open import Agda.Builtin.Float using (primShowFloat)
open import FFI.Data.String using (String; _++_)
open import Luau.RuntimeError using (RuntimeErrorᴮ; RuntimeErrorᴱ; local; return; TypeMismatch; UnboundVariable; SEGV; app₁; app₂; block; bin₁; bin₂)
open import Luau.RuntimeTyp... |
{-# OPTIONS --cubical --no-import-sorts --safe #-}
module Cubical.DStructures.Structures.SplitEpi where
open import Cubical.Foundations.Prelude
open import Cubical.Foundations.Equiv
open import Cubical.Foundations.HLevels
open import Cubical.Foundations.Isomorphism
open import Cubical.Foundations.Structure
open import... |
open import Relation.Binary.PropositionalEquality using (_≡_; refl; subst)
open import Data.Sum
import SingleSorted.AlgebraicTheory as SS
module SingleSorted.Combinators where
module Sum {𝓈} (Σ₁ Σ₂ : SS.Signature) (T₁ : SS.Theory 𝓈 Σ₁) (T₂ : SS.Theory 𝓈 Σ₂) where
-- disjoint sum of signatures
S : SS.Signatu... |
{-# OPTIONS --cubical #-}
module Type.Cubical.Path.Proofs where
import Lvl
open import Type
open import Type.Cubical
open import Type.Cubical.Path
private variable ℓ ℓ₁ ℓ₂ : Lvl.Level
module _ where
private variable A B : Type{ℓ}
private variable P : Interval → Type{ℓ}
private variable x y z w : A
-- ... |
open import lib
open import eq-reas-nouni
equiv = _≡_
Val = nat
data Expn : Set where
val : Val -> Expn
plus : Expn -> Expn -> Expn
eval : Expn -> Val
eval (val v) = v
eval (plus e1 e2) = (eval e1) + (eval e2)
data evalsTo : Expn -> Val -> Set where
e-val : forall {v : Val}
-----------------------... |
{-# OPTIONS --cubical --safe #-}
module Cubical.HITs.PropositionalTruncation where
open import Cubical.HITs.PropositionalTruncation.Base public
open import Cubical.HITs.PropositionalTruncation.Properties public
|
-- Kleene's three-valued logic
module bool-kleene where
open import bool
open import eq
data 𝔹ₖ : Set where
tt : 𝔹ₖ
ff : 𝔹ₖ
uu : 𝔹ₖ
infix 7 ~ₖ_
infixr 6 _&&ₖ_
infixr 5 _||ₖ_
--infixr 4 _impₖ_
~ₖ_ : 𝔹ₖ → 𝔹ₖ
~ₖ tt = ff
~ₖ ff = tt
~ₖ uu = uu
-- and
_&&ₖ_ : 𝔹ₖ → 𝔹ₖ → 𝔹ₖ
tt &&ₖ b = b
ff &&ₖ b = ff
u... |
{-# OPTIONS --cubical --no-import-sorts --safe #-}
module Cubical.HITs.Wedge.Base where
open import Cubical.Foundations.Prelude
open import Cubical.Foundations.Pointed
open import Cubical.HITs.Pushout.Base
open import Cubical.Data.Unit
_⋁_ : ∀ {ℓ ℓ'} → Pointed ℓ → Pointed ℓ' → Type (ℓ-max ℓ ℓ')
_⋁_ (A , ptA) (B , ptB... |
module Numeral.Natural.Oper.FlooredDivision.Proofs.Inverse where
import Lvl
open import Data
open import Functional
open import Logic.Propositional
open import Numeral.Natural
open import Numeral.Natural.Oper
open import Numeral.Natural.Oper.DivMod.Proofs
open import Numeral.Natural.Oper.FlooredDivision
open import Nu... |
{-# OPTIONS --without-K --safe #-}
module Categories.Category.Instance.Properties.Posets where
open import Level using (_⊔_; Lift; lift)
open import Data.Unit using (⊤; tt)
open import Data.Product as Prod using (_,_; <_,_>) renaming (_×_ to _|×|_)
open import Function using (flip)
open import Relation.Binary using (... |
------------------------------------------------------------------------------
-- Totality properties respect to Bool
------------------------------------------------------------------------------
{-# OPTIONS --exact-split #-}
{-# OPTIONS --no-sized-types #-}
{-# OPTIONS --no-universe-polymorphi... |
module Issue279 where
record Unit : Set where
constructor tt
open Unit tt -- this no longer brings tt into scope
test : Unit
test = tt
|
------------------------------------------------------------------------
-- The Agda standard library
--
-- This module is DEPRECATED.
------------------------------------------------------------------------
{-# OPTIONS --without-K --safe #-}
-- Disabled to prevent warnings from deprecated monoid solver
{-# OPTIONS -... |
open import Common.Prelude
open import Common.Reflection
postulate
X Y : Set
isX : QName → Bool
isX (quote X) = true
isX _ = false
main : IO Unit
main = putStrLn ((if isX (quote X) then "yes" else "no") +S+
(if isX (quote Y) then "yes" else "no"))
|
{-# OPTIONS --safe #-}
module Cubical.Categories.Instances.TypePrecategory where
open import Cubical.Foundations.Prelude
open import Cubical.Categories.Category.Precategory
open Precategory
-- TYPE precategory has types as objects
module _ ℓ where
TYPE : Precategory (ℓ-suc ℓ) ℓ
TYPE .ob = Type ℓ
TYP... |
open import Type
module Graph.Category {ℓ₁ ℓ₂} {V : Type{ℓ₁}} where
open import Data.Tuple as Tuple using ()
open import Functional
open import Logic.Propositional
import Lvl
open import Graph{ℓ₁}{ℓ₂}(V)
open import Graph.Walk{ℓ₁}{ℓ₂}{V}
open import Graph.Walk.Proofs{ℓ₁}{ℓ₂}{V}
open import Relator.Equals
open im... |
{-# OPTIONS --universe-polymorphism #-}
-- {-# OPTIONS --verbose tc.constr.findInScope:15 #-}
-- {-# OPTIONS --verbose tc.term.args.ifs:15 #-}
-- {-# OPTIONS --verbose tc.checkArgs:15 #-}
module 12-constraintFamilies where
open import Level
open import Function
open import Data.Unit
open import Data.List
open import ... |
{-# OPTIONS --without-K #-}
module NTypes.Nat where
open import NTypes
open import PathOperations
open import PathStructure.Nat
open import Types
ℕ-isSet : isSet ℕ
ℕ-isSet = ind
(λ m → (n : ℕ) (p q : m ≡ n) → p ≡ q)
(λ m-1 r → ind (λ n → (p q : suc m-1 ≡ n) → p ≡ q)
(λ n-1 r′ p′ q′
→ split-eq p′ ⁻¹
... |
{-# OPTIONS --without-K --safe #-}
open import Algebra
module Data.FingerTree.Measures
{r m}
(ℳ : Monoid r m)
where
open import Level using (_⊔_)
open Monoid ℳ renaming (Carrier to 𝓡)
open import Data.List as List using (List; _∷_; [])
open import Data.Product
open import Function
-- | A measure.
record σ {... |
{-# OPTIONS --allow-unsolved-metas #-}
open import Everything
module Test.ProblemWithSym where
module _ {a} {A : ¶ → Set a} where
private AList = Descender⟨ A ⟩
instance
test-works : Transassociativity.class (flip AList) Proposequality transitivity
test-works .⋆ f g h = symmetry (transassociativity h ... |
module Ag01 where
import Relation.Binary.PropositionalEquality as Eq
open Eq using (_≡_; refl)
open Eq.≡-Reasoning using (begin_; _≡⟨⟩_; _∎)
data ℕ : Set where
zero : ℕ
suc : ℕ → ℕ
{-# BUILTIN NATURAL ℕ #-}
_+_ : ℕ → ℕ → ℕ
zero + n = n
suc m + n = suc (m + n)
_*_ : ℕ → ℕ → ℕ
zero * n = zero
suc m * n = n + (... |
module Kind (Gnd : Set)(U : Set)(T : U -> Set) where
open import Basics
open import Pr
open import Nom
data Kind : Set where
Ty : Gnd -> Kind
_|>_ : Kind -> Kind -> Kind
Pi : (u : U) -> (T u -> Kind) -> Kind
infixr 60 _|>_
|
{-# OPTIONS --cubical #-}
module Miscellaneous.FiniteMultiset where
import Lvl
open import Data.List using (List)
import Data.List.Functions as List
open import Data.List.Relation.Permutation
open import Functional as Fn
open import Type.Cubical
open import Type.Cubical.Quotient
open import Type
open import... |
{-# OPTIONS --without-K --safe #-}
open import Categories.Category
module Categories.Diagram.Duality {o ℓ e} (C : Category o ℓ e) where
open Category C
open import Level
open import Function using (_$_)
open import Relation.Binary.PropositionalEquality using (_≡_; refl)
open import Categories.Functor
open import C... |
{-# OPTIONS --cubical --safe #-}
module Data.Binary.Base where
open import Prelude
import Data.Nat as ℕ
infixr 5 1ᵇ∷_ 2ᵇ∷_
data 𝔹 : Type₀ where
[] : 𝔹
1ᵇ∷_ : 𝔹 → 𝔹
2ᵇ∷_ : 𝔹 → 𝔹
inc : 𝔹 → 𝔹
inc [] = 1ᵇ∷ []
inc (1ᵇ∷ xs) = 2ᵇ∷ xs
inc (2ᵇ∷ xs) = 1ᵇ∷ inc xs
⟦_⇑⟧ : ℕ → 𝔹
⟦ zero ⇑⟧ = []
⟦ suc n ⇑⟧ = inc ... |
-- 2011-11-24 Andreas, James
{-# OPTIONS --copatterns #-}
module CopatternWithoutFieldName where
record R : Set2 where
field
f : Set1
open R
test : (f : R -> Set1) -> R
test f = bla where
bla : R
f bla = Set
-- not a copattern, since f not a field name
|
------------------------------------------------------------------------
-- The Agda standard library
--
-- Rose trees
------------------------------------------------------------------------
{-# OPTIONS --without-K --safe --sized-types #-}
module Data.Tree.Rose where
open import Level using (Level)
open import Size... |
postulate
A : Set
x : A
f : A → A → A
_●_ : A → A → A
infix 20 _●_
syntax f x y = x ○ y
doesn't-parse : A
doesn't-parse = x ○ x ● x
-- Default fixity for syntax is no longer -666, but 20 as for normal operators.
|
data Nat : Set where
zero : Nat
suc : Nat → Nat
data Zero : Nat → Set where
instance
isZero : Zero zero
data NonZero : Nat → Set where
instance
isSuc : ∀ {n : Nat} → NonZero (suc n)
pred : ∀ t {{_ : NonZero t}} → Nat
pred ._ {{isSuc {n}}} = n
test : Nat
test = pred (suc zero)
data Test (x : Nat) :... |
{-
Defines groups and adds some smart constructors
-}
{-# OPTIONS --safe #-}
module Cubical.Algebra.Group.Base where
open import Cubical.Foundations.Prelude
open import Cubical.Foundations.Structure
open import Cubical.Data.Sigma
open import Cubical.Algebra.Monoid
open import Cubical.Algebra.Semigroup
private
var... |
----------------------------------------------------------------
-- This file contains the definition natural transformations. --
----------------------------------------------------------------
module Category.NatTrans where
open import Level
open import Category.Category public
open import Category.Funct public
op... |
open import Data.Bool as Bool using (Bool; false; true; if_then_else_; not)
open import Data.String using (String)
open import Data.Nat using (ℕ; _+_; _≟_; suc; _>_; _<_; _∸_)
open import Relation.Nullary.Decidable using (⌊_⌋)
open import Data.List as l using (List; filter; map; take; foldl; length; []; _∷_)
open impor... |
module aux where
open import Data.Nat
open import Level renaming (zero to lzero)
open import Data.Fin
open import Data.Fin.Properties
open import Data.Fin.Subset renaming (∣_∣ to ∣_∣ˢ)
open import Data.Fin.Subset.Properties
open import Data.Vec
open import Data.Bool
open import Data.Bool.Properties
open import Data.Pr... |
module Issue2486 where
open import Common.Prelude
open import Issue2486.Import
open import Issue2486.ImportB
open import Issue2486.HaskellB
f : MyList String → String
f [] = "sdf"
f (x :: _) = x
xs : MyList String
xs = "sdfg" :: []
postulate
toBList : ∀ {A} → MyList A → BList A
fromBList : ∀ {A} → BList A → MyL... |
{-# OPTIONS -v treeless.opt:20 #-}
-- Tests for case-on-case simplification.
module _ where
open import Common.Prelude
open import Common.Integer
data Cmp : Set where
less equal greater : Cmp
isLess : Cmp → Bool
isLess less = true
isLess equal = false
isLess greater = false
{-# INLINE isLess #-}
postulate _-_ : I... |
-- Andreas, AIM XIII, 2011-04-07
-- {-# OPTIONS -v tc.rec.proj:50 #-}
module DependentIrrelevance where
open import Common.Irrelevance
ElimSq = {A : Set}(P : Squash A -> Set)
(ih : .(a : A) -> P (squash a)) ->
(a- : Squash A) -> P a-
elimSq : ElimSq
elimSq P ih (squash a) = ih a
elimSq' : ElimSq
el... |
{-# OPTIONS --without-K --safe #-}
module Categories.Functor.Properties where
-- Properties valid of all Functors
open import Level
open import Data.Product using (proj₁; proj₂; _,_; _×_; Σ)
open import Function.Surjection using (Surjective)
open import Function.Equivalence using (Equivalence)
open import Function.Equ... |
module RandomAccessList.Standard where
open import RandomAccessList.Standard.Core
open import RandomAccessList.Standard.Core.Properties
open import BuildingBlock.BinaryLeafTree using (BinaryLeafTree; Node; Leaf)
import BuildingBlock.BinaryLeafTree as BLT
open import Data.Empty using (⊥; ⊥-elim)
open import Data.Unit ... |
module LearnYouAn2 where
data ℕ : Set where
zero : ℕ
suc : ℕ → ℕ
_+_ : ℕ → ℕ → ℕ
zero + n = n
(suc n) + n′ = suc (n + n′)
data _even : ℕ → Set where
ZERO : zero even
STEP : ∀ x → x even → (suc (suc x)) even
-- To prove four is even
proof₁ : suc (suc (suc (suc zero))) even
proof₁ = STEP (suc (suc zer... |
-- Andreas, 2019-08-10
record R : Set₁ where
indutive
field A : Set
-- The error message is strange:
-- This declaration is illegal in a record before the last field
-- when scope checking the declaration
-- record R where
-- indutive
-- field A : Set
|
{-# OPTIONS --cubical --safe --postfix-projections #-}
module Categories where
open import Prelude
open import Cubical.Foundations.HLevels
record PreCategory ℓ₁ ℓ₂ : Type (ℓsuc (ℓ₁ ℓ⊔ ℓ₂)) where
no-eta-equality
field
Ob : Type ℓ₁
Hom : Ob → Ob → Type ℓ₂
Id : ∀ {X} → Hom X X
Comp : ∀ {X Y... |
module hott.types.theorems where
open import hott.types.nat.theorems public
|
-- Issue #1130, test generation of helper function
-- {-# OPTIONS -v tc.with:40 #-}
id : (A : Set) → A → A
id A = {!id′!}
-- C-c C-h produces: id′ : ∀ {A} → A
-- when it should produce: id′ : ∀ {A} → A → A
f : (A : Set) (B : A → Set) (a : A) → B a
f A B a = {!g A a!}
-- Before: ∀ {A} {B : A → Set} A₁ (a : ... |
module Issue117 where
Set′ = Set
record ⊤ : Set′ where
data ⊥ : Set′ where
|
module PiNF-semantics where
open import Data.Nat hiding (_⊔_; suc; _+_; _*_)
open import Data.Vec
open import Level
open import Algebra.Structures
open import PiNF-algebra
------------------------------------------------------------------------------
-- Define module over a ring (the types bot, top, disjoint union,... |
{-# OPTIONS --allow-unsolved-metas #-}
open import Agda.Builtin.Bool
open import Agda.Builtin.Nat
open import Agda.Primitive
record Graph ℓv ℓe : Set (lsuc (ℓv ⊔ ℓe)) where
field
Obj : Set ℓv
Hom : Obj → Obj → Set ℓe
open Graph public
postulate
t : Nat → Nat → Bool
ωGr : Graph lzero lzero
Obj ωGr = Nat... |
open import Data.Nat using (ℕ; zero; suc; _+_; _∸_; _≥_; _≤_; z≤n; s≤s)
open import Function.Equivalence using (_⇔_)
open import Relation.Binary.PropositionalEquality using (→-to-⟶)
postulate
adjoint : ∀ {x y z} → x + y ≥ z ⇔ x ≥ z ∸ y
unit : ∀ {x y} → x ≥ (x + y) ∸ y
apply : ∀ {x y} → (x ∸ y) + y ≥ x
|
module _ where
open import Agda.Builtin.Nat renaming (Nat to Nombre)
open import Agda.Builtin.Equality
open import Agda.Builtin.String
open import Agda.Builtin.Reflection
check₁ : primShowQName (quote Nombre) ≡ "Agda.Builtin.Nat.Nat"
check₁ = refl
check₂ : primShowQName (quote Agda.Builtin.Nat.Nat) ≡ "Agda.Builtin.... |
open import FRP.JS.Nat using ( ℕ ; _+_ ; _≤_ ; _<_ ; _≟_ )
open import FRP.JS.True using ( True ; False )
module FRP.JS.Nat.Properties where
postulate
≤-impl-≯ : ∀ {m n} → True (m ≤ n) → False (n < m)
≤≠-impl-< : ∀ {m n} → True (m ≤ n) → False (m ≟ n) → True (m < n)
<-impl-s≤ : ∀ {m n} → True (m < n) → True (1... |
module _ where
open import Agda.Builtin.Reflection
open import Agda.Builtin.Equality
module M where
open import Agda.Builtin.Nat renaming (Nat to Nombre)
a = quote Nombre
fail : M.a ≡ quote Name
fail = refl
|
{-# OPTIONS --safe --without-K #-}
open import Generics.Prelude
open import Generics.Telescope
open import Generics.Desc
open import Generics.All
module Generics.Accessibility
{P I ℓ} (A : Indexed P I ℓ)
{n} (D : DataDesc P I n)
(let A′ = uncurry P I A)
(split : ∀ {pi} → A′ pi → ⟦ D ⟧Data A′ pi)
{p} where
... |
{-
Types Summer School 2007
Bertinoro
Aug 19 - 31, 2007
Agda
Ulf Norell
-}
-- Records are labeled sigma types.
module Records where
open import Nat
open import Bool
{-
A very simple record.
-}
record Point : Set where
field
... |
{-# OPTIONS --cubical --safe #-}
module Cubical.Data.Sigma.Base where
open import Cubical.Core.Primitives public
-- Σ-types are defined in Core/Primitives as they are needed for Glue types.
|
module FMSB where
data Nat : Set where
ze : Nat
su : Nat -> Nat
data Lam (X : Nat -> Set)(n : Nat) : Set where
var : X n -> Lam X n
app : Lam X n -> Lam X n -> Lam X n
lam : Lam X (su n) -> Lam X n
_->>_ : {I : Set}(X Y : I -> Set) -> Set
X ->> Y = {i : _} -> X i -> Y i
fmsub : {X Y : Nat -> Set} -> (X ->... |
{-# OPTIONS --guardedness #-}
module Iterator where
import Lvl
open import Data.Option as Option using (Option ; Some ; None)
open import Data.Tuple as Tuple using (_⨯_ ; _,_)
open import Type
private variable ℓ : Lvl.Level
private variable T A B : Type{ℓ}
private variable a x init : T
private variable f : A ... |
{-# OPTIONS --without-K --safe #-}
module Categories.Category.Construction.Properties.Presheaves where
open import Categories.Category.Construction.Properties.Presheaves.Cartesian
using (module IsCartesian)
public
open import Categories.Category.Construction.Properties.Presheaves.CartesianClosed
using (module ... |
------------------------------------------------------------------------
-- An example
------------------------------------------------------------------------
module Mixfix.Acyclic.Example where
open import Codata.Musical.Notation
open import Data.Vec using ([]; _∷_; [_])
open import Data.List as List
using (List;... |
module List.Permutation.Base (A : Set) where
open import Data.List
data _/_⟶_ : List A → A → List A → Set where
/head : {x : A}{xs : List A}
→ (x ∷ xs) / x ⟶ xs
/tail : {x y : A}{xs ys : List A}
→ xs / y ⟶ ys
→ (x ∷ xs) / y ⟶ (x ∷ ys)
data ... |
{-# OPTIONS --safe --warning=error --without-K #-}
open import LogicalFormulae
open import Groups.Lemmas
open import Groups.Definition
open import Groups.Subgroups.Definition
open import Setoids.Setoids
open import Sets.EquivalenceRelations
open import Rings.Definition
open import Agda.Primitive using (Level; lzero; ... |
-- Note that the flag --guardedness-preserving-type-constructors is
-- not (should not be) enabled in this module.
module TypeConstructorsWhichPreserveGuardedness1 where
open import Common.Coinduction
record ⊤ : Set where
data _⊎_ (A B : Set) : Set where
inj₁ : A → A ⊎ B
inj₂ : B → A ⊎ B
record ∃ {A : Set} (B ... |
-- The same name can not be exported more than once from a module.
module Issue154 where
module A where
postulate X : Set
module B where
postulate X : Set
open A public
|
{-# OPTIONS --safe --experimental-lossy-unification #-}
module Cubical.Homotopy.HopfInvariant.Homomorphism where
open import Cubical.Homotopy.HopfInvariant.Base
open import Cubical.Homotopy.Group.Base
open import Cubical.Homotopy.Group.SuspensionMap
open import Cubical.ZCohomology.Base
open import Cubical.ZCohomology... |
{-# OPTIONS --without-K #-}
open import lib.Basics
open import lib.types.Paths
open import lib.types.Pi
open import lib.types.Sigma
module lib.types.Pointed where
Ptd : ∀ i → Type (lsucc i)
Ptd i = Σ (Type i) (λ A → A)
Ptd₀ = Ptd lzero
⊙[_,_] : ∀ {i} (A : Type i) (a : A) → Ptd i
⊙[_,_] = _,_
_⊙→_ : ∀ {i j} → Ptd ... |
data D : Set where
d : D
foo : D
foo = {!!}
-- C-c C-r gives me a weird-looking '0'
|
{-# OPTIONS --without-K --safe #-}
-- Some of the obvious properties of cartesian functors
module Categories.Functor.Cartesian.Properties where
open import Data.Product using (_,_; proj₁; proj₂)
open import Level
open import Categories.Category.Core using (Category)
open import Categories.Category.Cartesian
open imp... |
-- Sometimes we can't infer a record type
module InferRecordTypes-2 where
record R : Set₁ where
field
x₁ : Set
x₂ : Set
bad = record { x₃ = Set } |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.