text stringlengths 4 690k |
|---|
------------------------------------------------------------------------
-- The Agda standard library
--
-- Vectors defined in terms of Data.Star
------------------------------------------------------------------------
module Data.Star.Vec where
open import Data.Star
open import Data.Star.Nat
open import Data.Star.Fi... |
module Nats.Add.Comm where
open import Equality
open import Nats
open import Function
------------------------------------------------------------------------
-- internal stuffs
private
a+0=0+a : ∀ a → a + 0 ≡ a
a+0=0+a zero = refl
a+0=0+a (suc a) = cong suc $ a+0=0+a a
++a+b=a+b++ : ∀ a b → suc (a + b)... |
{-# OPTIONS --no-unicode #-}
module Issue2749 where
-- testing ascii only lambda and arrow
id : {A : Set} -> A -> A
id = {!!}
-- testing ascii only double braces
it : {A : Set} {{a : A}} → A → A
it = {!!}
data B : Set where
mkB : B → B → B
-- testing ascii only suffixes
left : B → B
left b1 = {!!}
open import A... |
{-# OPTIONS --copatterns --sized-types #-}
-- {-# OPTIONS -v tc.size:60 #-}
-- {-# OPTIONS -v term:20 -vterm.matrices:40 #-}
module SizedTypesMutual where
open import Common.Size
-- Syntax: Types, terms and contexts.
infixr 6 _⇒_
infixl 1 _,_
-- Types and contexts.
data Ty : Set where
_⇒_ : (a b : Ty) → Ty
d... |
module Issue402 where
record Unit : Set where
constructor inn
field
out : Unit
data _==_ {A : Set}(a : A) : A -> Set where
refl : a == a
test : (x y : Unit) -> x == y
test x y = refl
-- this used to cause an infinite loop in the conversion checker
-- now it fails, because no eta-laws are generated for the... |
{-# OPTIONS --safe #-}
module Generics.Reflection where
open import Function.Base
import Data.Unit as ⊤
import Data.Product as Product
import Relation.Binary.PropositionalEquality as Eq
open import Data.Nat.Base hiding (_⊔_)
open import Data.List.Base as List hiding (_++_)
import Data.Vec.Base as Vec
open import ... |
{-# OPTIONS --without-K --safe #-}
-- This module shows that D<: subtyping without transitivity, or equivalently, without
-- bad bounds, remains undecidable.
module DsubNoTrans where
open import Data.List as List
open import Data.List.All as All
open import Data.Nat as ℕ
open import Data.Maybe as Maybe
open import Da... |
{-
This file contains:
- Properties of set truncations
-}
{-# OPTIONS --cubical --no-import-sorts --safe #-}
module Cubical.HITs.SetTruncation.Properties where
open import Cubical.HITs.SetTruncation.Base
open import Cubical.Foundations.Prelude
open import Cubical.Foundations.Function
open import Cubical.Foundation... |
open import Relation.Binary using (Rel)
open import Algebra.Bundles using (CommutativeRing)
open import Normed
module Beside
{r ℓr} {CR : CommutativeRing r ℓr}
(open CommutativeRing CR using () renaming (Carrier to X))
{rel} {_≤_ : Rel X rel}
{ma ℓma} (MA : NormedModule CR _≤_ ma ℓma)
{mb ℓmb} (MB : NormedM... |
------------------------------------------------------------------------
-- The Agda standard library
--
-- Properties satisfied by total orders
------------------------------------------------------------------------
{-# OPTIONS --without-K --safe #-}
open import Relation.Binary
module Relation.Binary.Properties.To... |
{-# OPTIONS --without-K --exact-split --safe #-}
open import Fragment.Equational.Theory
module Fragment.Equational.FreeExtension (Θ : Theory) where
open import Fragment.Equational.FreeExtension.Base Θ public
open import Fragment.Equational.FreeExtension.Synthetic Θ using (SynFrex) public
open import Fragment.Equatio... |
------------------------------------------------------------------------
-- INCREMENTAL λ-CALCULUS
--
-- The values of terms in Parametric.Change.Term.
------------------------------------------------------------------------
import Parametric.Syntax.Type as Type
import Parametric.Syntax.Term as Term
import Parametric.... |
{-# 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 Categories.Morphism C
open import Categories.Ob... |
{-# OPTIONS --termination-depth=2 #-}
module TerminationWithMerge where
data List (a : Set) : Set where
[] : List a
_∷_ : a -> List a -> List a
open import Agda.Builtin.Bool
postulate
a : Set
_≤?_ : a -> a -> Bool
merge : List a -> List a -> List a
merge xs [] = xs
merge [] y... |
open import Agda.Builtin.List
open import Agda.Builtin.Reflection
open import Agda.Builtin.Sigma
open import Agda.Builtin.Unit
@0 m : Name → TC ⊤
m F = defineFun F
(clause
(( "A"
, arg (arg-info visible (modality relevant quantity-0))
(agda-sort (lit 0))) ∷
[])
(arg (arg-info visible ... |
{-# OPTIONS --cubical --no-import-sorts #-}
open import Cubical.Foundations.Everything renaming (_⁻¹ to _⁻¹ᵖ; assoc to ∙-assoc)
open import Function.Base using (_∋_; _$_)
open import MorePropAlgebra.Bundles
import Cubical.Algebra.Ring as Std
module MorePropAlgebra.Properties.Ring {ℓ} (assumptions : Ring {ℓ}) where
... |
{- Type class for comonads. -}
module CategoryTheory.Comonad where
open import CategoryTheory.Categories
open import CategoryTheory.Functor
open import CategoryTheory.NatTrans
-- A comonad on a category
record Comonad {n} (ℂ : Category n) : Set (lsuc n) where
open Category ℂ
field
-- Underlying endof... |
{-# OPTIONS --without-K --rewriting #-}
module LEM where
open import Basics
open import Flat
open import Bool
open import lib.Basics
open import lib.types.Bool
open import Bool
open import lib.NType2
open import Axiom.LEM public
flat-set-has-dec-eq : {@♭ i : ULevel} (@♭ A : hSet i)
... |
{-# OPTIONS --without-K --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.InverseUniv
open import... |
{-# OPTIONS --without-K #-}
open import HoTT
open import cohomology.FunctionOver
{- Flipping the pushout diagram (switching left and right) gives the
- same pushout. -}
module cohomology.FlipPushout where
{- Span-flipping functions -}
flip-span : ∀ {i j k} → Span {i} {j} {k} → Span {j} {i} {k}
flip-span (span A B ... |
open import x1-Base
open import x4-Nat
open import x3-PropositionalEquality using (_≡_; refl; cong; equivalence)
open import x2-Sort _≤?_ totalOrder
module x5-Test where
empty : OList ⊥ ⊤
empty = nil ⊥≤̂
l-9 : OList ⊥ ⊤
l-9 = insert 9 empty ⊥≤̂ ≤̂⊤
_ : l-9 ≡ cons 9 (nil ≤̂⊤) ⊥≤̂
_ = refl
l-5-9 : OList ⊥ ⊤
l-5-9 = ... |
module io-test where
open import io
open import string
open import unit
main : IO ⊤
main = (readFiniteFile "hello-world.txt") >>= λ x → writeFile "output.txt" x
|
module calculus where
open import utility
open import Esterel.Lang
open import Esterel.Lang.Binding
open import Esterel.Lang.Properties
open import Esterel.Lang.CanFunction
using (Canθₛ ; Canθₛₕ ; [S]-env)
open import Esterel.Environment as Env
using (Env ; Θ ; _←_ ; sig ; []env ; module SigMap ; module ShrMap ; ... |
data I : Set where
i : I
variable
x : I
abstract
data D : I → Set where
d : D i
accepted : {x : I} → D x → Set₁
accepted {x = i} d = Set
rejected : D x → Set₁
rejected {x = i} d = Set
|
{-# OPTIONS --without-K #-}
module Cham.Molecule where
open import Cham.Agent
open import Cham.Context
open import Cham.Label
open import Cham.Name
open import Data.List
open import Data.Product using (_×_)
data Molecule : Context → Set₁ where
Reagent : ∀ {Γ} → Agent Γ → Molecule Γ
_·ₘ_ : ∀ {Γ}
→ (... |
module Using where
module Dummy where
data DummySet1 : Set where ds1 : DummySet1
data DummySet2 : Set where ds2 : DummySet2
open Dummy
using (DummySet1)
open Dummy -- checking that newline + comment is allowed before "using"
using (DummySet2)
|
-- Testcase for #2028 by Ulf
record ⊤ : Set where
constructor tt
data Either (A B : Set) : Set where
inl : A → Either A B
inr : B → Either A B
Subset : Set → Set₁
Subset X = X → Set
U : ∀ {X} → Subset X
U _ = {!⊤!}
_⊆_ : ∀ {X} → Subset X → Subset X → Set
A ⊆ B = ∀ {x} → A x → B x
_∪_ : ∀ {X} → Subset X → Su... |
open import Coinduction using ( ♯_ )
open import Data.Natural using ( Natural ; # ; _+_ )
open import Data.Strict using ( Strict ; ! )
open import System.IO.Transducers.Session using ( I ; Σ ; ⟨_⟩ )
open import System.IO.Transducers.Lazy using ( _⇒_ ; inp ; out ; done )
module System.IO.Transducers.Weight where
-- We... |
open import Everything
module Test.Thickandthin where
module _ {x a b ℓb c ℓc} ⦃ _ : Thickandthin x a b ℓb c ℓc ⦄ where
open Thickandthin ⦃ … ⦄
test-thin : 𝓽hin A B
test-thin = thin
test-check/thin=1 : 𝓬heck/thin=1 A B C _≈C_
test-check/thin=1 = check/thin=1
test-injectivity : ∀ {m : X} {x : A (⇑₀ m... |
--{-# OPTIONS --rewriting #-}
module Array.Rewrites where
open import Array.Base
open import Data.Nat
open import Data.Fin using (Fin; zero; suc)
open import Data.Vec
open import Data.Vec.Properties
open import Relation.Binary.PropositionalEquality
open import Function
--{-# BUILTIN REWRITE _≡_ #-}
thm : ∀ {a}{X :... |
{-# OPTIONS --without-K --safe #-}
open import Algebra
open import Relation.Unary
open import Relation.Binary hiding (Decidable)
module Data.FingerTree.Split.Structures
{r m}
(ℳ : Monoid r m)
{s}
{ℙ : Pred (Monoid.Carrier ℳ) s}
(ℙ-resp : ℙ Respects (Monoid._≈_ ℳ))
(ℙ? : Decidable ℙ)
where
open import R... |
{-# OPTIONS --safe --warning=error --without-K #-}
open import LogicalFormulae
open import Orders.Total.Definition
open import Orders.Partial.Definition
open import Setoids.Setoids
open import Functions
open import Agda.Primitive using (Level; lzero; lsuc; _⊔_)
module Setoids.Orders where
partialOrderToSetoidPartia... |
{-# OPTIONS --without-K --safe #-}
open import Categories.Category.Core using (Category)
module Categories.Category.BicartesianClosed {o ℓ e} (𝒞 : Category o ℓ e) where
open import Level
open import Categories.Category.CartesianClosed 𝒞
open import Categories.Category.Cocartesian 𝒞
record BicartesianClosed : Se... |
------------------------------------------------------------------------
-- The Agda standard library
--
-- Properties of Any predicate transformer for fresh lists
------------------------------------------------------------------------
{-# OPTIONS --without-K --safe #-}
module Data.List.Fresh.Relation.Unary.Any.Prop... |
module Web.Semantic.DL.Category.Properties where
open import Web.Semantic.DL.Category.Properties.Equivalence public using
( ≣-refl ; ≣-sym ; ≣-trans )
open import Web.Semantic.DL.Category.Properties.Composition public using
( compose-resp-≣ ; compose-unit₁ ; compose-unit₂ ; compose-assoc )
open import Web.Semant... |
{-# OPTIONS --without-K #-}
module Lecture3 where
import Lecture2
open Lecture2 public
data unit : U where
star : unit
𝟙 = unit
ind-unit : {i : Level} {P : unit → UU i} → P star → ((x : unit) → P x)
ind-unit p star = p
data empty : U where
𝟘 = empty
ind-empty : {i : Level} {P : empty → UU i} → ((x : empty) ... |
{-# OPTIONS --without-K #-}
module PathStructure.Product {a b} {A : Set a} {B : Set b} where
open import Equivalence
open import PathOperations
open import Types
split-path : {x y : A × B} → x ≡ y → (π₁ x ≡ π₁ y) × (π₂ x ≡ π₂ y)
split-path p = ap π₁ p , ap π₂ p
merge-path : {x₁ x₂ : A} {y₁ y₂ : B} →
(x₁ ≡ x₂) × (y... |
module Data.List.Size where
import Lvl
open import Data.List
open import Logic.Predicate
open import Logic.Propositional
open import Numeral.Natural
open import Numeral.Natural.Oper
open import Relator.Equals
open import Relator.Equals.Proofs
open import Structure.Function.Domain
open import Type
open import Dat... |
{-# OPTIONS --cubical #-}
module all where
import 00-preamble
import 02-pi
import 03-natural-numbers
import 04-inductive-types
import 05-identity-types
import 06-universes
import 07-finite-sets
import 08-equivalences
import 09-contractible-types
import 10-fundamental-theorem
import 11-truncation-levels
import 12-func... |
{-
This second-order signature was created from the following second-order syntax description:
syntax PDiff | PD
type
* : 0-ary
term
zero : * | 𝟘
add : * * -> * | _⊕_ l20
one : * | 𝟙
mult : * * -> * | _⊗_ l20
neg : * -> * | ⊖_ r50
pd : *.* * -> * | ∂_∣_
theory
(𝟘U⊕ᴸ) a |> add ... |
{-# OPTIONS --without-K --safe #-}
module Definition.Typed.RedSteps where
open import Definition.Untyped
open import Definition.Typed
-- Concatenation of type reduction closures
_⇨*_ : ∀ {Γ A B C} → Γ ⊢ A ⇒* B → Γ ⊢ B ⇒* C → Γ ⊢ A ⇒* C
id ⊢B ⇨* B⇒C = B⇒C
(A⇒A′ ⇨ A′⇒B) ⇨* B⇒C = A⇒A′ ⇨ (A′⇒B ⇨* B⇒C)
-- Concatenation... |
open import Agda.Primitive
variable
A : Set _
levelOf : A → Level
levelOf {a} _ = a
|
open import Structures
open import Data.String using (String; _≈?_)
open import Data.List as L using (List; []; _∷_; [_])
open import Data.List.Categorical
open import Data.Nat as ℕ using (ℕ; zero; suc; _+_)
import Data.Nat.Properties as ℕ
open import Data.Nat.DivMod
open import Agda.Builtin.Nat using (div-helper; mod... |
F : {_ : Set₁} → Set₁
F {A} = A
|
module Jumble where
open import Basics
swap : {I J : Set} -> I * J -> J * I
swap (i , j) = j , i
_+L_ : {X : Set} -> List X -> List X -> List X
[] +L ys = ys
(x ,- xs) +L ys = x ,- (xs +L ys)
infixr 4 _+L_
catNatural : {X Y : Set}(f : X -> Y)(xs xs' : List X) ->
(list f xs +L list f xs') == list f (xs +L xs')
cat... |
{-# OPTIONS --cubical --safe #-}
module Cubical.Data.Strict2Group.Explicit.Path where
open import Cubical.Foundations.Prelude
open import Cubical.Data.Group.Base
open import Cubical.Data.Strict2Group.Explicit.Base
open import Cubical.Data.Strict2Group.Explicit.Notation
S2G : (ℓ : Level) → Type (ℓ-suc ℓ)
S2G ℓ = Str... |
{-# OPTIONS --without-K --safe #-}
open import Categories.Category.Core
-- Idempotents and Split Idempotents
module Categories.Morphism.Idempotent {o ℓ e} (𝒞 : Category o ℓ e) where
open import Level
open import Categories.Morphism 𝒞
open import Categories.Morphism.Reasoning 𝒞
open Category 𝒞
open HomReasoning... |
-- {-# OPTIONS --verbose tc.proj.like:100 #-}
-- Apparently, there can be projection like functions working on arguments of type Axiom.
module Issue558c where
data ⊤ : Set where
tt : ⊤
data V : Set where
aV : ⊤ → V
postulate D : ⊤ → Set
zero : D tt
suc : ∀ {t} → D t → V
test : {{v : V}} → ⊤... |
module _ where
module M where
data D : Set where
c : D
pattern c′ = c
open M hiding (c′)
x : D
x = c′
|
------------------------------------------------------------------------
-- The Agda standard library
--
-- Sums of binary relations
------------------------------------------------------------------------
module Relation.Binary.Sum where
open import Data.Sum as Sum
open import Data.Product
open import Data.Unit usin... |
module Eq where
open import Prelude
open import T
open import Contexts
open import Eq.Defs
import Eq.KleeneTheory
import Eq.ObsTheory
import Eq.LogicalTheory
import Eq.Theory
open Eq.Defs public
open Eq.KleeneTheory public using (kleene-is-equivalence ; nats-halt)
open Eq.ObsTheory public using (obs-is-coarsest ; obs... |
-- Andreas, 2014-09-01 restored this test case
module ClashingModuleImport where
module M where
open import Imports.Module public
|
{-# OPTIONS --without-K #-}
{-# OPTIONS --type-in-type #-}
module pisearch where
open import Type hiding (★_)
open import Function.NP
open import Data.Product
open import Data.Sum
open import Data.Bool.NP
open import Search.Type
open import Search.Searchable.Product
open import Search.Searchable
open import sum
fromFu... |
{-# OPTIONS --without-K --safe #-}
module Math.NumberTheory.Summation.Generic.Properties where
-- agda-stdlib
open import Algebra
import Algebra.Operations.CommutativeMonoid as CommutativeMonoidOperations
open import Data.Nat as ℕ hiding (_+_; _*_)
import Data.Fin as Fin
import Data.Nat.Properties as ℕₚ
open import R... |
-- Andreas, 2013-03-22
module Issue473a where
data D : Set where
d : D
data P : D → Set where
p : P d
record Rc : Set where
constructor c
field f : D
works : {r : Rc} → P (Rc.f r) → Set
works p = D
works' : (r : Rc) → P (Rc.f r) → Set
works' (c .d) p = D
-- If we remove the constructor, the example fails:... |
module Data.List.Relation.Quantification where
import Lvl
open import Data.List
open import Logic
open import Type
private variable ℓ ℓₑ : Lvl.Level
private variable T A B : Type{ℓ}
private variable l l₁ l₂ : List(T)
private variable x y px py : T
private variable P : T → Stmt{ℓ}
-- TODO: How about this as an a... |
{-# OPTIONS --cubical --no-import-sorts --safe #-}
module Cubical.Algebra.Semigroup.MorphismProperties where
open import Cubical.Foundations.Prelude
open import Cubical.Foundations.Isomorphism
open import Cubical.Foundations.Equiv
open import Cubical.Foundations.Equiv.HalfAdjoint
open import Cubical.Foundations.HLevel... |
------------------------------------------------------------------------
-- The Agda standard library
--
-- This module is DEPRECATED. Please use
-- Data.List.Relation.Unary.Any.Properties directly.
------------------------------------------------------------------------
{-# OPTIONS --without-K --safe #-}
module Data... |
module Thesis.ANormalDTerm where
open import Thesis.ANormal public
open import Thesis.Changes public
open import Thesis.LangChanges public
ΔΔ : Context → Context
ΔΔ ∅ = ∅
ΔΔ (τ • Γ) = Δt τ • ΔΔ Γ
-- Because the standard name is so irregular.
Δτ = Δt
ChΔ : ∀ (Δ : Context) → Set
ChΔ Δ = ⟦ ΔΔ Δ ⟧Context
-- [_]Δ_from_... |
module _ where
postulate
A B C D E F : Set
a : A
b : B
c : C
d : D
e : E
f : F
T : {A : Set} → A → Set
module M1 (a : A) where
module M2 (b : B) where
postulate g : T a → T b
module M3 (c : C) where
postulate h : T a → T b → T c
module M4 (d : D) where
module M5 (e : E) (f : F) ... |
{-# OPTIONS --without-K #-}
open import HoTT.Base
open import HoTT.Identity
open import HoTT.Homotopy
module HoTT.Equivalence where
open variables
private variable C : 𝒰 i
module _ (f : A → B) where
qinv = Σ[ g ∶ (B → A) ] (g ∘ f ~ id) × (f ∘ g ~ id)
-- Bi-invertible map
linv = Σ[ g ∶ (B → A) ] g ∘ f ~ id
... |
module CTL.Modalities.EU where
-- TODO
|
module BBHeap.Last {A : Set}(_≤_ : A → A → Set) where
open import BBHeap _≤_
open import BBHeap.Compound _≤_
open import BBHeap.DropLast _≤_
open import Bound.Lower A
open import Data.Sum
last : {b : Bound}(h : BBHeap b) → Compound h → A
last (left {b} {x} {l} {r} b≤x l⋘r) (cl .b≤x .l⋘r)
with l | r | l⋘r | lemm... |
module Categories.Functor.Discrete where
open import Categories.Category
open import Categories.Functor
open import Categories.Agda
open import Categories.Categories
open import Categories.Support.PropositionalEquality
import Categories.Discrete as D
Discrete : ∀ {o} -> Functor (Sets o) (Categories o o _)
Discrete {o... |
{-# OPTIONS --cubical --safe #-}
module Cubical.Data.Queue where
open import Cubical.Data.Queue.Base public
|
open import OutsideIn.Prelude
open import OutsideIn.X
module OutsideIn.Proof.Soundness(x : X) where
open import Data.Vec hiding (map; _>>=_)
open X(x)
import OutsideIn.Environments as EV
import OutsideIn.Expressions as E
import OutsideIn.TypeSchema as TS
import OutsideIn.TopLevel as TL
import OutsideIn.C... |
open import SOAS.Common
open import SOAS.Families.Core
-- Algebras for a signature endofunctor
module SOAS.Metatheory.Algebra {T : Set} (⅀F : Functor (𝔽amiliesₛ {T}) (𝔽amiliesₛ {T})) where
module ⅀ = Functor ⅀F
⅀ : Familyₛ → Familyₛ
⅀ = ⅀.₀
⅀₁ : {𝒳 𝒴 : Familyₛ} → 𝒳 ⇾̣ 𝒴 → ⅀ 𝒳 ⇾̣ ⅀ 𝒴
⅀₁ = Functor.₁ ⅀F
|
-- Jesper, 2017-08-13: This test case now fails since instantiation
-- of metavariables during case splitting was disabled (see #2621).
{-# OPTIONS --allow-unsolved-metas #-}
record ⊤ : Set where
constructor tt
data I : Set where
i : ⊤ → I
data D : I → Set where
d : D (i tt)
postulate
P : (x : I) → D x → S... |
{-
Day 2 task of https://adventofcode.com/
-}
module a2 where
open import Agda.Builtin.IO using (IO)
open import Agda.Builtin.Unit using (⊤)
open import Agda.Builtin.String using (String; primShowNat; primStringAppend)
open import Agda.Builtin.Equality
open import Data.Nat
open import Data.Bool using (if_then_else_... |
{-# OPTIONS --prop #-}
module Miscellaneous.ClassicalWitness where
open import Agda.Primitive using (Prop)
open import Data
open import Data.Either
open import Functional
import Lvl
open import Type.Dependent
open import Type
private variable ℓ ℓ₁ ℓ₂ : Lvl.Level
private variable T A B Obj : Type{ℓ}
private var... |
{-# OPTIONS --warning=error --safe --without-K #-}
open import Orders.Total.Definition
open import LogicalFormulae
open import Maybe
module KeyValue.LinearStore.Definition {a b : _} (keySet : Set a) (valueSet : Set b) {c : _} (keyOrder : TotalOrder keySet {c}) where
open import KeyValue.KeyValue keySet valueSet
open... |
{-# OPTIONS --without-K --safe #-}
module Algebra.Linear.Construct where
import Algebra.Linear.Construct.Vector
import Algebra.Linear.Construct.Matrix
|
{-# OPTIONS --without-K #-}
open import HoTT
open import homotopy.HSpace
module homotopy.CircleHSpace where
S¹-hSpace : HSpaceStructure S¹
S¹-hSpace = hSpaceStructure base μ μ-e-l μ-e-r μ-coh where
turn-around : (x : S¹) → x == x
turn-around = S¹-elim loop (↓-idf=idf-in (∙=∙' loop loop))
module Mu = S¹Rec (i... |
open import Agda.Builtin.Nat
-- splitting on a 'with' argument should not expand the ellipsis
foo : Nat → Nat
foo m with 0
... | n = {!n!}
-- splitting on variable hidden by ellipsis should expand the ellipsis
bar : Nat → Nat
bar m with 0
... | n = {!m!}
-- test case with nested with
baz : Nat → Nat
baz m with m
..... |
-- Andreas, 2017-11-01, issue #2824
-- Don't allow built-ins defined in parametrized modules
module _ {a} {A : Set a} where
data _≡_ (x : A) : A → Set a where
refl : x ≡ x
{-# BUILTIN EQUALITY _≡_ #-}
-- This is forbidden, could maybe allowed using lambda-lifting.
|
import Common
import Global
import Local
import Projection
import Soundness
import Completeness
import Example
|
{-# OPTIONS --show-implicit #-}
open import Agda.Builtin.Nat renaming (Nat to ℕ)
open import Agda.Builtin.Equality
postulate
funext : {X : Set} {Y : X → Set} {f g : (x : X) → Y x} → (∀ x → f x ≡ g x) → f ≡ g
_::_ : {X : ℕ → Set} → X 0 → ((n : ℕ) → X (suc n)) → ((n : ℕ) → X n)
(x :: α) 0 = x
(x :: α) (suc n) = α n
... |
module Haskell.RangedSets.Ranges where
open import Haskell.Prim
open import Haskell.Prim.Ord
open import Haskell.Prim.Bool
open import Haskell.Prim.Maybe
open import Haskell.Prim.Enum
open import Haskell.Prim.Num
open import Haskell.Prim.Eq
open import Haskell.Prim.Functor
open import Haskell.Prim.Foldable
open import... |
open import Common.Prelude
open import Common.Reflect
id : Nat → Nat
id x = x
-- Used to give error:
-- unquote must be applied to a term
-- when checking that the expression unquote has type _3 x
i : Nat → Nat
i x = unquote (def (quote id) []) x
|
{-# OPTIONS --without-K #-}
module hott.types.coproduct where
open import hott.core.universe
data _∐_ {ℓ₀ ℓ₁ : Level}
(A : Type ℓ₀)
(B : Type ℓ₁) : Type (ℓ₀ ⊔ ℓ₁) where
inl : (a : A) → A ∐ B -- left introduction
inr : (b : B) → A ∐ B -- right introduction
-- A more suggestive way of b... |
{-# OPTIONS --safe #-}
open import Generics.Prelude
open import Generics.Telescope
open import Generics.Desc
open import Generics.Mu
open import Generics.Mu.All
open import Data.Fin.Properties as Fin
open import Data.Product.Properties
open import Data.Empty
open import Relation.Nullary
module Generics.Mu.NoConfusio... |
module Numeral.Real where
import Lvl
open import Syntax.Number
open import Data
open import Functional
open import Logic.Propositional{Lvl.𝟎}
open import Logic.Predicate{Lvl.𝟎}{Lvl.𝟎}
open import Numeral.Integer hiding (𝟎)
open import Numeral.Natural
open import Sets.PredicateSet.Filter{Lvl.𝟎}{Lvl.𝟎}
open import... |
-- An ATP type must be used with data-types or postulates.
-- This error is detected by TypeChecking.Rules.Decl.
module ATPBadType2 where
foo : Set → Set
foo A = A
{-# ATP type foo #-}
|
{-# OPTIONS --without-K --safe --exact-split #-}
module Constructive.Common where
open import Level
open import Data.Product
open import Data.Sum
open import Function.Base
open import Relation.Nullary
infix 2 _<=>_
-- Logical equivalence
_<=>_ : ∀ {a b} → Set a → Set b → Set (a ⊔ b)
A <=> B = (A → B) × (B → A)
mod... |
{-# OPTIONS --without-K #-}
module Agda.Builtin.List where
infixr 5 _∷_
data List {a} (A : Set a) : Set a where
[] : List A
_∷_ : (x : A) (xs : List A) → List A
{-# BUILTIN LIST List #-}
{-# BUILTIN NIL [] #-}
{-# BUILTIN CONS _∷_ #-}
{-# FOREIGN GHC type AgdaList a b = [b] #-}
{-# COMPILE GHC List = data... |
module Issue215 where
open import Imports.Bool
{-# COMPILED_DATA Bool Bool True False #-}
|
{-# OPTIONS --rewriting #-}
module Luau.VarCtxt where
open import Agda.Builtin.Equality using (_≡_)
open import Luau.Type using (Type; _∪_; _∩_)
open import Luau.Var using (Var)
open import FFI.Data.Aeson using (KeyMap; Key; empty; unionWith; singleton; insert; delete; lookup; toString; fromString; lookup-insert; loo... |
{-# OPTIONS --allow-unsolved-metas #-}
import cedille-options
module elaboration-helpers (options : cedille-options.options) where
open import lib
open import monad-instances
open import general-util
open import cedille-types
open import syntax-util
open import ctxt
open import conversion
open import constants
open im... |
open import Function using (const; id)
open import Auto.Core using (IsHintDB; simpleHintDB; Rules; Rule; name2rule)
open import Data.List using ([]; [_]; _++_)
open import Data.Nat using (ℕ)
open import Data.Product using (_,_)
open import Data.Sum using (inj₁; inj₂)
open import Reflection using (Na... |
{-# OPTIONS --allow-unsolved-metas #-}
module Term where
open import OscarPrelude
open import VariableName
open import FunctionName
open import Arity
open import Vector
mutual
data Term : Set
where
variable : VariableName → Term
function : FunctionName → Terms → Term
record Terms : Set
where
c... |
module PLRTree.Equality.Properties {A : Set} where
open import PLRTree {A}
open import PLRTree.Equality {A}
open import Relation.Binary.Core
sym≃ : Symmetric _≃_
sym≃ ≃lf = ≃lf
sym≃ (≃nd x x' l≃r l'≃r' l≃l') = ≃nd x' x l'≃r' l≃r (sym≃ l≃l')
trans≃ : Transitive _≃_
trans≃ ≃lf t≃t'' = t≃t''
trans≃ (≃nd x x' l≃r l'≃r' ... |
module Generic.Test.Data.Fin where
open import Generic.Main
import Data.Fin as Fin
Fin : ℕ -> Set
Fin = readData Fin.Fin
pattern fzero {n} = #₀ (relv n , lrefl)
pattern fsuc {n} i = !#₁ (relv n , i , lrefl)
elimFin : ∀ {n π}
-> (P : ∀ {n} -> Fin n -> Set π)
-> (∀ {n} {i : Fin n} -> P i -> P (fs... |
module Data.Nat.Literal where
open import Data.Nat using (ℕ; suc; zero)
open import Data.Fin using (Fin; suc; zero)
open import Data.Unit using (⊤)
open import Data.Empty using (⊥)
open import Agda.Builtin.FromNat using (Number; fromNat) public
_≤_ : ℕ → ℕ → Set
zero ≤ n = ⊤
suc m ≤ zero = ⊥
suc m ≤ suc n = m ≤... |
{-# OPTIONS --without-K #-}
module higher where
open import higher.circle public
|
open import Prelude hiding (All; module All; _>>=_; ⊥; sym)
module Implicits.Resolution.Infinite.Algorithm.Completeness where
open import Data.Bool
open import Data.Unit.Base
open import Data.Maybe as Maybe using (Is-just; to-witness)
open import Coinduction
open import Data.Fin.Substitution
open import Data.List.Any... |
{-# OPTIONS --universe-polymorphism #-}
module Categories.Support.Equivalence where
open import Level
open import Relation.Binary using (Rel; IsEquivalence; module IsEquivalence; IsPreorder; Preorder; Reflexive; Transitive; Symmetric; _⇒_) renaming (Setoid to RSetoid; module Setoid to RSetoid)
open import Data.Product... |
-- Andreas, 2015-06-24
open import Common.Equality
open import Common.Product
Sing : {A : Set} (a : A) → Set
Sing a = ∃ λ b → a ≡ b
works : {A : Set} (f : ∀{a : A} → Sing a) (a : A) → Sing a
works f a = let b , p = f {_} in b , p
test : {A : Set} (f : ∀{a : A} → Sing a) (a : A) → Sing a
test f a = let b , p = f in ... |
------------------------------------------------------------------------
-- The Agda standard library
--
-- The Pair type which calls out to Haskell via the FFI
------------------------------------------------------------------------
{-# OPTIONS --without-K #-}
module Foreign.Haskell.Pair where
open import Level
ope... |
{-# OPTIONS --cubical-compatible #-}
module Common.String where
open import Agda.Builtin.String public
open import Common.Bool
open import Common.Char
open import Common.List
open import Common.Nat
open import Common.Integer
strEq : (x y : String) -> Bool
strEq = primStringEquality
infixr 30 _+S+_
_+S+_ : (x y : St... |
------------------------------------------------------------------------
-- Generic support for reduction relations.
------------------------------------------------------------------------
module Relation.Binary.Reduction where
open import Data.Fin using (Fin)
open import Data.Fin.Substitution
open import Data.Star ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.