text stringlengths 4 690k |
|---|
{-# OPTIONS --without-K --safe #-}
module Categories.Functor.Instance.SetoidDiscrete where
-- Discrete Functor
-- from Setoids to Cats.
open import Categories.Category
open import Categories.Functor
open import Categories.Category.Instance.Setoids
open import Categories.Category.Instance.Cats
open import Categories... |
module plfa.part1.Relations where
import Relation.Binary.PropositionalEquality as Eq
open Eq using (_≡_; refl; cong)
open import Data.Nat using (ℕ; zero; suc; _+_)
open import Data.Nat.Properties using (+-comm)
-- z≤n, s≤s - constructor names (with no spaces)
-- zero ≤ n - types (with spaces) indexed by
-... |
module Type{ℓ} where
open import Agda.Primitive public
using ()
renaming (Set to TYPE ; Setω to Typeω)
Type : TYPE(_)
Type = TYPE(ℓ)
{-# INLINE Type #-}
module Type where
-- Returns the type of a certain value
of : ∀{T : Type} → T → Type
of {T} _ = T
{-# INLINE of #-}
|
module _ where
open import Agda.Builtin.List
open import Agda.Builtin.Reflection
open import Agda.Builtin.Unit
postulate
A : Set
module _ (X : Set) where
macro
give : Name → Term → TC ⊤
give x goal = unify (def x []) goal
B : Set
B = give A
|
{-# OPTIONS --copatterns #-}
module Issue1290 where
record R : Set1 where
constructor con
field
A : Set
open R
postulate
X : Set
x : R
A x = X
exp : R -> R
A (exp x) = A x
|
{-# OPTIONS --without-K --safe #-}
module Categories.Category.Instance.FamilyOfSetoids where
-- The Category of "Families of Setoids"
-- This fits into this library much better than the Families of Sets
-- This particular formalization should be considered alpha, i.e. its
-- names will change once things settle.
ope... |
-- | In this module, we proof that the 2-category of endofunctors
-- inherits locally all colimits from underlying category.
-- More precisely, for a functor F : C → C, we compute in Endo(F, F)
-- colimits point-wise from those in C.
module UpToColim where
open import Level
open import Relation.Binary using (Rel; IsEq... |
module _ where
open import Agda.Builtin.Equality
module MM1 (A : Set) where
postulate a0 : A
module M1 (a : A) where
postulate
x : A
module M = M1 a0
module MM2 (A : Set) where
open module MM1A = MM1 A
check : M1.x ≡ (λ a → a)
check = refl -- used to be internal error
|
{-# OPTIONS --without-K --rewriting #-}
{- Remember to keep CodeAP.agda in sync. -}
open import HoTT
import homotopy.RelativelyConstantToSetExtendsViaSurjection as SurjExt
module homotopy.vankampen.CodeBP {i j k l}
(span : Span {i} {j} {k})
{D : Type l} (h : D → Span.C span) (h-is-surj : is-surj h) where
open... |
------------------------------------------------------------------------
-- Two eliminators for Delay-monad.Alternative.Delay (A / R)
------------------------------------------------------------------------
-- This module is largely based on (but perhaps not quite identical
-- to) the development underlying Theorem 1 ... |
module test.Negation where
open import Type
open import Declarative
open import Builtin
open import Builtin.Constant.Type
open import Builtin.Constant.Term Ctx⋆ Kind * # _⊢⋆_ con size⋆
-- zerepoch/zerepoch-core/test/data/negation.plc
open import Declarative.StdLib.Bool
negate : ∀{Γ} → Γ ⊢ boolean ⇒ boolean
negate {... |
module Structure.Logic where
|
{-# OPTIONS --cubical --no-import-sorts --safe #-}
module Cubical.Data.Int.Base where
open import Cubical.Core.Everything
open import Cubical.Data.Nat
data Int : Type₀ where
pos : (n : ℕ) → Int
negsuc : (n : ℕ) → Int
neg : (n : ℕ) → Int
neg zero = pos zero
neg (suc n) = negsuc n
sucInt : Int → Int
sucInt (p... |
{-
This file proves the higher groupoid structure of types
for homogeneous and heterogeneous paths
-}
{-# OPTIONS --cubical --no-import-sorts --safe #-}
module Cubical.Foundations.GroupoidLaws where
open import Cubical.Foundations.Prelude
private
variable
ℓ : Level
A : Type ℓ
x y z w v : A
_⁻¹ : (x ≡... |
{-# OPTIONS --rewriting #-}
-- {-# OPTIONS -v rewriting:100 -v tc.conv.atom:30 -v tc.inj.use:30 #-}
open import Common.Equality
{-# BUILTIN REWRITE _≡_ #-}
data Nat : Set where
zero : Nat
suc : Nat → Nat
_+_ : Nat → Nat → Nat
zero + n = n
(suc m) + n = suc (m + n)
postulate
plus-zero : ∀ x → (x + zero) ≡ x... |
-- Andreas and James, 2013-11-19
{-# OPTIONS --copatterns #-}
-- {-# OPTIONS -v tc.cover.splittree:15 -v tc.cc:15 #-}
open import Common.Level
open import Common.Product
mutual
data Delay (A : Set) : Set where
later : ∞Delay A → Delay A
record ∞Delay (A : Set) : Set where
coinductive
constructor de... |
open import Prelude
open import Level using (Level) renaming (zero to lz; suc to ls)
open import Data.List.Properties as ListProps renaming (∷-injective to ∷-inj)
open import Data.String
open import Data.Nat as Nat using (decTotalOrder; _≤_; s≤s; z≤n)
open import Relation.Binary using (module DecTotalOrder)
module RW.... |
{-# OPTIONS --without-K --exact-split --allow-unsolved-metas #-}
module 21-image where
import 20-sequences
open 20-sequences public
{- We give the formal specification of propositional truncation. -}
precomp-Prop :
{ l1 l2 l3 : Level} {A : UU l1} (P : hProp l2) →
(A → type-Prop P) → (Q : hProp l3) →
(type-Pro... |
open import Agda.Primitive
open import Common.Reflection
open import Common.Prelude
macro
deBruijn : Nat → Term → TC ⊤
deBruijn n = unify (lam visible (abs "x" (var n [])))
data Vec {a} (A : Set a) : Nat → Set a where
[] : Vec A 0
_∷_ : ∀ {n} → A → Vec A n → Vec A (suc n)
module _ {n} {a} {A : Set a} (xs : ... |
{- Other common operations and lemmas. -}
module TemporalOps.Common.Other where
open import Relation.Binary.HeterogeneousEquality as ≅ hiding (inspect)
open import Relation.Binary.PropositionalEquality hiding (inspect)
-- Time indexing (for clarity, synonym of function appliation at any level)
_at_ : ∀ {a b} {A : S... |
module Selective.Examples.Fibonacci where
open import Selective.ActorMonad
open import Prelude
open import Debug
open import Data.Nat.Show using (show)
data End : Set where
END : End
ℕ-message : MessageType
ℕ-message = [ ValueType ℕ ]ˡ
End-message : MessageType
End-message = [ ValueType End ]ˡ
... |
module Issue427 where
data T : Set where
tt : T
test = (λ {s : T} {t : T} → t) {tt} {tt}
f : {s t : T} → T
f = tt
test₂ = (let x = tt in λ {s : T} {t : T} → x) {tt} {tt}
|
module ColDivSeq where
open import Data.Nat using (ℕ; zero; suc)
-- -----------------------------------------------
data OneCounter : Set where
ZeroCounter : OneCounter
data LTOneCounter : ℕ → Set where
Is : (ℕ → LTOneCounter 0) → OneCounter → LTOneCounter 0
data CollatzIsTrue : Set where
-- 再帰する時に引数を減らしたから... |
module Numeral.Natural.Coprime where
open import Logic
import Lvl
open import Numeral.Natural
open import Numeral.Natural.Relation.Divisibility
open import Relator.Equals
private variable n x y : ℕ
-- Two numbers are coprime when their only divisor is 1.
record Coprime (x : ℕ) (y : ℕ) : Stmt{Lvl.𝟎} where
con... |
open import Data.Empty
open import Data.List renaming (_∷_ to _∷ₗ_ ; [_] to [_]ₗ)
open import Data.Maybe
open import Data.Product
open import Data.Sum
open import Data.Unit
open import AEff
open import AwaitingComputations
open import EffectAnnotations
open import Finality
open import Preservation
open import ProcessP... |
{-
This file contains:
- Properties of groupoid truncations
-}
{-# OPTIONS --cubical --safe #-}
module Cubical.HITs.GroupoidTruncation.Properties where
open import Cubical.Foundations.Prelude
open import Cubical.HITs.GroupoidTruncation.Base
recGroupoidTrunc : ∀ {ℓ ℓ'} {A : Type ℓ} {B : Type ℓ'} (gB : isGroupoid B)... |
module Thesis.SIRelBigStep.Lang where
open import Thesis.SIRelBigStep.Types public
open import Thesis.SIRelBigStep.Syntax public
open import Thesis.SIRelBigStep.DenSem public
open import Thesis.SIRelBigStep.OpSem public
open import Thesis.SIRelBigStep.SemEquiv public
|
{-# OPTIONS --without-K --safe #-}
open import Categories.Category
open import Categories.Category.CartesianClosed.Locally
module Categories.Category.CartesianClosed.Locally.Properties {o ℓ e} {C : Category o ℓ e}
(LCCC : Locally C) where
open import Categories.Category.CartesianClosed
open import Categories.Categ... |
------------------------------------------------------------------------
-- Types used (only) when calling out to Haskell via the FFI
------------------------------------------------------------------------
module Foreign.Haskell where
open import Coinduction
open import Data.Colist as C using ([]; _∷_)
------------... |
-- {-# OPTIONS -v tc.meta:100 #-}
-- Andreas, 2011-04-20
-- see Abel Pientka TLCA 2011
module PruningNonMillerPattern where
data _≡_ {A : Set}(a : A) : A -> Set where
refl : a ≡ a
data Nat : Set where
zero : Nat
suc : Nat -> Nat
test : let X : Nat -> Nat -> Nat
X = _
Y : Nat -> Nat -> Na... |
{-# OPTIONS --without-K --safe #-}
module Categories.Category.Cocomplete where
open import Level
open import Categories.Category using (Category)
open import Categories.Functor using (Functor)
open import Categories.Diagram.Colimit using (Colimit)
Cocomplete : (o ℓ e : Level) {o′ ℓ′ e′ : Level} (C : Category o′ ℓ′ ... |
------------------------------------------------------------------------------
-- Some proofs related to the power function
------------------------------------------------------------------------------
{-# OPTIONS --exact-split #-}
{-# OPTIONS --no-sized-types #-}
{-# OPTIONS --no-universe-poly... |
module induction where
import Relation.Binary.PropositionalEquality as Eq
open Eq using (_≡_; refl; cong; sym)
open Eq.≡-Reasoning using (begin_; _≡⟨⟩_; step-≡; _∎)
open import Data.Nat using (ℕ; zero; suc; _+_; _*_; _∸_; _^_)
-- -------------------------------
-- (zero + n) + p ≡ zero + (n + p)
--
-- (m + n) + p ≡ m ... |
module LecDiff where
open import CS410-Prelude
open import CS410-Nat
open import LecSigma
data Data : Set1 where
_+D_ _*D_ : Data -> Data -> Data
label : Set -> Data
rec : Data
infixr 4 _+D_
infixr 5 _*D_
[[_]] : Data -> Set -> Set
[[ S +D T ]] R = [[ S ]] R + [[ T ]] R
[[ S *D T ]] R = [[ ... |
module Integer8 where
open import Data.Nat
open import Data.Nat.Properties
open import Data.Product
open import Relation.Binary.PropositionalEquality as PropEq
-- ---------- record ----------
record IsSemiGroup (A : Set) (_∙_ : A → A → A) : Set where
field
assoc : ∀ x y z → (x ∙ y) ∙ z ≡ x ∙ (y ∙ z)
... |
{-# OPTIONS --rewriting #-}
open import Agda.Builtin.Equality
open import Agda.Builtin.Bool
open import Agda.Builtin.Nat
{-# BUILTIN REWRITE _≡_ #-}
not : Bool → Bool
not true = false
not false = true
data Unit : Set where
unit : Unit
postulate
X : Unit → Set
X-Nat : X unit ≡ Nat
X-Bool : (u : Unit) → X u ... |
open import Data.String using ( _++_ )
open import System.IO using ( _>>_ ; _>>=_ ; getStr ; putStr ; commit )
module System.IO.Examples.HelloUser where
main =
putStr "What is your name?\n" >>
commit >>
getStr >>= λ name →
putStr ("Hello, " ++ name ++ "\n") >>
commit
|
{-
Agda Implementors' Meeting VI
Göteborg
May 24 - 30, 2007
Hello Agda!
Ulf Norell
-}
-- This is where the fun begins.
-- Unleashing datatypes, pattern matching and recursion.
module Datatypes where
{-
Simple datatypes.
-}
-- Now which... |
{-# OPTIONS --safe --warning=error #-}
open import Numbers.Naturals.Semiring
open import Groups.FreeProduct.Definition
open import Groups.FreeProduct.Setoid
open import Groups.FreeProduct.Group
open import Groups.Definition
open import Groups.Homomorphisms.Definition
open import Groups.Isomorphisms.Definition
open imp... |
module Issue121 where
bad : Set → Set
bad A = A → A
data Bool : Set where
true : Bool
false : Bool
F : Bool → Set → Set
F true = bad
F false = λ A → A
data D : Set where
nop : (b : Bool) → F b D → D
|
open import Relation.Binary.Core
module PLRTree.Insert.Permutation {A : Set}
(_≤_ : A → A → Set)
(tot≤ : Total _≤_) where
open import Data.List
open import Data.Product renaming (_×_ to _∧_)
open import Data.Sum
open import List.Permutation.Base A
open import List.Permutati... |
-- Andreas, 2020-09-09, issue #4880
-- Parse all interleavings of hiding and irrelevance in non-dependent function space
module Issue4880 (A B : Set) where
postulate
-- dependent
-- * visible
_ : A → (_ : B) → A
_ : A → .(_ : B) → A
_ : A → ..(_ : B) → A
-- * hidden
_ : A → {_ : B} → A
_ : A → .... |
module OverloadedConstructors where
data Nat : Set where
zero : Nat
suc : Nat -> Nat
data Fin : Nat -> Set where
zero : {n : Nat} -> Fin (suc n)
suc : {n : Nat} -> Fin n -> Fin (suc n)
three : Nat
three = suc (suc (suc zero))
ftwo : Fin three
ftwo = suc (suc zero)
inc : Nat -> Nat
inc = suc
{-
{-# BUILT... |
{-# OPTIONS --cubical --no-import-sorts --safe #-}
module Cubical.HITs.Truncation.Properties where
open import Cubical.Foundations.Prelude
open import Cubical.Foundations.Function
open import Cubical.Foundations.Equiv
open import Cubical.Foundations.Isomorphism
open import Cubical.Foundations.HLevels
open import Cubic... |
{-# OPTIONS --without-K --rewriting #-}
open import HoTT
open import cohomology.Theory
open import cohomology.PtdMapSequence
open import groups.ExactSequence
open import groups.Exactness
open import groups.HomSequence
open import groups.KernelImageUniqueFactorization
open import cw.CW
module cw.cohomology.FirstCohom... |
{-# OPTIONS --safe #-}
module Cubical.Algebra.Module.Base where
open import Cubical.Foundations.Prelude
open import Cubical.Foundations.Equiv
open import Cubical.Foundations.Equiv.HalfAdjoint
open import Cubical.Foundations.HLevels
open import Cubical.Foundations.Isomorphism
open import Cubical.Foundations.SIP
open i... |
open import Prelude
open import Nat
open import List
open import Int
open import Bij
open import delta-lemmas
open import Delta
open import NatDelta
|
module BasicIPC.Metatheory.Gentzen-BasicTarski where
open import BasicIPC.Syntax.Gentzen public
open import BasicIPC.Semantics.BasicTarski public
-- Soundness with respect to all models, or evaluation.
eval : ∀ {A Γ} → Γ ⊢ A → Γ ⊨ A
eval (var i) γ = lookup i γ
eval (lam t) γ = λ a → eval t (γ , a)
eval (app t... |
module Functional.Combinations where
open import Type
-- TODO: Generalize these. Probably by lists and foldᵣ of combination and rotation construction functions. Also categorically or dependently
rotate₃Fn₃Op₂ : ∀{ℓ₁ ℓ₂}{A : Type{ℓ₁}}{B : Type{ℓ₂}} → (A → A → A → B) → (B → B → B) → (A → A → A → B)
rotate₃Fn₃Op₂(F)(_▫_... |
-- Andreas, 2013-03-15
-- Paolo Capriotti's formalization of Russell's paradox
{-# OPTIONS --cubical-compatible --type-in-type #-}
module Russell where
open import Common.Product
open import Common.Equality
data ⊥ : Set where
¬ : Set → Set
¬ A = A → ⊥
-- a model of set theory, uses Set : Set
data U : Set where
se... |
{-# OPTIONS --cubical --no-import-sorts --safe #-}
open import Cubical.Core.Everything
open import Cubical.Relation.Binary
module Cubical.Relation.Binary.Construct.NonStrictToStrict
{a ℓ} {A : Type a} (_≤_ : Rel A ℓ) where
open import Cubical.Relation.Binary.Properties
open import Cubical.Foundations.Prelude
open ... |
------------------------------------------------------------------------
-- INCREMENTAL λ-CALCULUS
--
-- Connecting Nehemiah.Change.Term and Nehemiah.Change.Value.
------------------------------------------------------------------------
module Nehemiah.Change.Evaluation where
open import Nehemiah.Syntax.Type
open imp... |
module Data.String where
import Data.List
import Data.Char
open Data.List using (List)
open Data.Char
postulate String : Set
{-# BUILTIN STRING String #-}
infixr 50 _++_
private
primitive
primStringAppend : String -> String -> String
primStringToList : String -> List Char
primStringFromList ... |
module Dave.Algebra.Naturals.Excercises where
open import Dave.Algebra.Naturals.Addition
+-rearrange : ∀ (m n p q : ℕ) → (m + n) + (p + q) ≡ m + (n + p) + q
+-rearrange m n p q = begin
(m + n) + (p + q) ≡⟨ IsSemigroup.assoc ℕ-+-IsSemigroup m n (p + q) ⟩
m + (n + (p + q)) ≡⟨ cong (λ a → m + a) (sym (IsSem... |
------------------------------------------------------------------------
-- Canonically kinded hereditary substitutions in Fω with interval kinds
------------------------------------------------------------------------
{-# OPTIONS --safe --without-K #-}
module FOmegaInt.Kinding.Canonical.HereditarySubstitution where
... |
{-# OPTIONS --without-K #-}
open import HoTT.Base
open import HoTT.Equivalence
open import HoTT.Identity.Product
module HoTT.Equivalence.Product where
private
variable
i : Level
A A' B B' : 𝒰 i
×-swap : A × B → B × A
×-swap x = pr₂ x , pr₁ x
×-comm : A × B ≃ B × A
×-comm = ×-swap , qinv→isequiv (×-swap ,... |
{-# OPTIONS --cubical --safe #-}
module Algebra where
open import Prelude
module _ {a} {A : Type a} (_∙_ : A → A → A) where
Associative : Type a
Associative = ∀ x y z → (x ∙ y) ∙ z ≡ x ∙ (y ∙ z)
Commutative : Type _
Commutative = ∀ x y → x ∙ y ≡ y ∙ x
Idempotent : Type _
Idempotent = ∀ x → x ∙ x ≡ x
mo... |
module syntax-util where
open import lib
open import cedille-types
open import general-util
open import constants
posinfo-gen : posinfo
posinfo-gen = "generated"
first-position : posinfo
first-position = "1"
dummy-var : var
dummy-var = "_dummy"
id-term : term
id-term = Lam posinfo-gen NotErased posinfo-gen "x" NoC... |
module SizedPolyIO.Object where
open import Data.Product
open import Level using (_⊔_) renaming (suc to lsuc)
record Interface μ ρ : Set (lsuc (μ ⊔ ρ)) where
field
Method : Set μ
Result : (m : Method) → Set ρ
open Interface public
-- A simple object just returns for a method the response
-- and the obje... |
open import Prelude
module Implicits.Resolution.Stack.Algorithm where
open import Induction.WellFounded
open import Induction.Nat
open import Data.Fin.Substitution
open import Data.Nat.Base using (_<′_)
open import Data.List.Any
open Membership-≡
open import Implicits.Syntax
open import Implicits.Substitutions
open i... |
{-# OPTIONS --cubical-compatible #-}
module Common.Bool where
open import Agda.Builtin.Bool public
not : Bool -> Bool
not true = false
not false = true
notnot : Bool -> Bool
notnot true = not (not true)
notnot false = not (not false)
if_then_else_ : ∀ {a} {A : Set a} → Bool → A → A → A
if true then t else f = t
... |
{- This file shows a natural attempt to do formatted printing, and where
that attempt goes wrong. See string-format.agda for a (working) solution
to this problem. -}
module string-format-issue where
open import char
open import eq
open import list
open import nat
open import nat-to-string
open import string
... |
{-# OPTIONS --safe #-}
{-
This uses ideas from Floris van Doorn's phd thesis and the code in
https://github.com/cmu-phil/Spectral/blob/master/spectrum/basic.hlean
-}
module Cubical.Homotopy.Prespectrum where
open import Cubical.Foundations.Prelude
open import Cubical.Foundations.GroupoidLaws
open import Cubical.Fo... |
------------------------------------------------------------------------
-- The Agda standard library
--
-- Alternative definition of divisibility without using modulus.
------------------------------------------------------------------------
{-# OPTIONS --without-K --safe #-}
module Data.Integer.Divisibility.Signed ... |
module Numeral.Natural.Relation.Order.Classical where
import Lvl
open import Logic.Propositional
open import Numeral.Natural
open import Numeral.Natural.Relation.Order
open import Numeral.Natural.Relation.Order.Decidable
open import Numeral.Natural.Relation.Order.Proofs
open import Relator.Equals
open import Relator.E... |
{-# OPTIONS --cubical --no-import-sorts --safe #-}
module Cubical.Algebra.Base where
open import Cubical.Core.Everything
------------------------------------------------------------------------
-- Unary and binary operations
Op₁ : ∀ {ℓ} → Type ℓ → Type ℓ
Op₁ A = A → A
Op₂ : ∀ {ℓ} → Type ℓ → Type ℓ
Op₂ A = A → A → A... |
------------------------------------------------------------------------
-- Safe modules that use --erased-cubical and --prop
------------------------------------------------------------------------
{-# OPTIONS --safe --erased-cubical --prop #-}
module README.Safe.Cubical.Erased.Prop where
-- Squashing.
import Squa... |
open import Agda.Primitive using (lzero; lsuc; _⊔_)
open import Relation.Binary.PropositionalEquality using (_≡_; refl; sym; trans; cong; cong₂; subst; setoid)
open import Data.Product using (_×_; Σ; _,_; proj₁; proj₂; zip; map; <_,_>; swap)
import Function.Equality
open import Relation.Binary using (Setoid)
import Rel... |
module Example1 where
data Nat : Set where
zero : Nat
suc : Nat -> Nat
{-# BUILTIN NATURAL Nat #-}
data _==_ {l} {a : Set l} : a -> a -> Set l where
refl : ∀{x} -> x == x
{-# BUILTIN EQUALITY _==_ #-}
cong : ∀{l} -> {A B : Set l} {x y : A} -> (f : A -> B) -> x == y -> f x == f y
cong f refl = refl
sym : ∀{l... |
module Issue482 where
open import Common.Level using (_⊔_)
postulate
P : ∀ a b → Set a → Set b → Set (a ⊔ b)
F : ∀ ℓ → Set ℓ
p : ∀ a (A : Set a) → P a a A (F a)
Q : ∀ a → Set a → ∀ b → Set (a ⊔ b)
P-to-Q : ∀ a b (A : Set a) (B : Set b) → P a b A B → Q a A b
q : ∀ a (A : Set a) → Q a A ... |
{-# OPTIONS --cubical --safe #-}
module Demos.Cantor where
open import Prelude
open import Data.Bool.Properties using (false≢true; true≢false)
Stream : Type a → Type a
Stream A = ℕ → A
_∈_ : ∀ {A : Type a} (x : A) → Stream A → Type a
x ∈ xs = ∃ i × (xs i ≡ x)
Countable : Type a → Type a
Countable A = Σ[ xs ⦂ Strea... |
{-# OPTIONS --rewriting --prop #-}
open import common
open import syntx
{- The sort corresponding to judgments -}
data JudgmentSort : Set where
Ty : JudgmentSort
Tm : JudgmentSort
Ty= : JudgmentSort
Tm= : JudgmentSort
JudgmentArityArgs = ArityArgs JudgmentSort
JudgmentArity = Arity JudgmentSort
{-
Judgme... |
{-# OPTIONS --cubical --safe #-}
module Path where
open import Cubical.Foundations.Everything
using ( _≡_
; sym
; refl
; subst
; transport
; Path
; PathP
; I
; i0
; i1
; funExt
; cong
; toPathP
; cong₂
; ... |
{-# OPTIONS --without-K #-}
module overloading.core where
-- ## Coercions
--
-- The overloading system implemented in this module is based on
-- **coercions**. A coercion is simply a function converting a type into
-- another. In object-oriented parliance, a coercion embodies an *is-a*
-- relationship. The two types ... |
module Issue606 where
infixr 1 _,_
record _×_ (A B : Set) : Set where
constructor _,_
field fst : A
snd : B
postulate A B C : Set
test : A × (B × C)
test = {!!} , {!!}
-- refining the second hole should give "? , ?" (no enclosing parens!)
|
{-# OPTIONS --no-positivity-check #-}
module Section7 where
open import Section6 public
-- 7. Correspondence between proof trees and terms
-- ===============================================
--
-- We define a function that translates the proof trees to the corresponding untyped terms nad
-- likewise for the substitu... |
{-# OPTIONS --universe-polymorphism #-}
open import Categories.Category
open import Categories.Support.Equivalence
module Categories.Object.Indexed {o ℓ e c q} (C : Category o ℓ e) (B : Setoid c q) where
open import Categories.Support.SetoidFunctions
open Category C
open _⟶_ public using () renaming (cong to cong₀; _... |
-- Andreas, 2018-10-16, erased lambda-arguments
applyErased : {@0 A B : Set} → (@0 A → B) → @0 A → B
applyErased f x = f x
test : {A : Set} → A → A
test x = applyErased (λ y → y) x
-- Expected error:
--
-- Variable y is declared erased, so it cannot be used here
-- when checking that the expression y has type _B_7
|
module RandomAccessList.Standard.Numeral where
open import Data.List
open import Data.Nat
open import Data.Nat.Properties.Simple
open import Data.Unit using (⊤)
open import Data.Empty using (⊥; ⊥-elim)
open import Relation.Nullary.Negation using (contraposition)
open import Relation.Binary.PropositionalEquality as Pro... |
open import Prelude
open import core
module ground-decidable where
-- every type is either ground or not
ground-decidable : (τ : typ) → (τ ground) + ((τ ground) → ⊥)
ground-decidable b = Inl GBase
ground-decidable ⦇·⦈ = Inr (λ ())
ground-decidable (b ==> b) = Inr (λ ())
ground-decidable (b ==> ⦇·⦈) = Inr (... |
-- Generated by src/templates/TemplatesCompiler
module templates where
open import lib
open import cedille-types
-- src/templates/Mendler.ced
MendlerTemplate = File "1" ImportsStart "1" "8" "Mendler" (ParamsCons (Decl "16" "17" NotErased "Indices" (Tkk (Star "27")) "29") ParamsNil) (CmdsNext (DefTermOrType OpacTrans ... |
module Esterel.Lang.CanFunction.MergePotentialRuleLeftInductive 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.CanThetaContinu... |
{-# OPTIONS --cubical --no-import-sorts --safe #-}
module Cubical.DStructures.Equivalences.PreXModReflGraph 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.Univalence... |
------------------------------------------------------------------------
-- Well-typed polymorphic and iso-recursive lambda terms
------------------------------------------------------------------------
module SystemF.WtTerm where
import Category.Functor as Functor
import Category.Applicative.Indexed as Applicative
o... |
{-# OPTIONS --without-K --rewriting #-}
open import lib.Basics
open import lib.types.Paths
open import lib.types.Pointed
open import lib.types.Pushout
open import lib.types.PushoutFmap
open import lib.types.Sigma
open import lib.types.Span
module lib.types.Join where
module _ {i j} (A : Type i) (B : Type j) where
... |
module OlderBasicILP.Indirect.Hilbert.Sequential where
open import OlderBasicILP.Indirect public
-- Derivations, as Hilbert-style combinator sequences.
mutual
data Tm : Set where
NIL : Tm
VAR : ℕ → Tm → Tm
MP : ℕ → ℕ → Tm → Tm
CI : Tm → Tm
CK : Tm → Tm
CS : Tm → Tm
NEC ... |
{-# OPTIONS --without-K --safe --overlapping-instances #-}
module SmallInterpreter where
open import Data.Char hiding (_≤_)
open import Data.Bool hiding (_≤_)
open import Data.Nat hiding (_≤_)
open import Data.Unit
import Data.Nat as N
open import Data.Product
open import Data.Sum
open import Relation.Binary.Propositi... |
-- Intuitionistic propositional calculus.
-- Hilbert-style formalisation of closed syntax.
-- Nested terms.
module IPC.Syntax.ClosedHilbert where
open import IPC.Syntax.Common public
-- Derivations.
infix 3 ⊢_
data ⊢_ : Ty → Set where
app : ∀ {A B} → ⊢ A ▻ B → ⊢ A → ⊢ B
ci : ∀ {A} → ⊢ A ▻ A
ck ... |
{-# OPTIONS --without-K --safe #-}
module Cats.Category.Sets.Facts.Product where
open import Data.Bool using (Bool ; true ; false)
open import Data.Product using (_×_ ; _,_ ; proj₁ ; proj₂)
open import Relation.Binary.PropositionalEquality using (_≡_ ; refl ; cong₂)
open import Cats.Category
open import Cats.Category... |
open import Agda.Builtin.Nat
open import Agda.Builtin.Equality
open import Agda.Builtin.String
open import Agda.Builtin.List
Id : (A : Set) → A → A → Set
Id _ = _≡_
pattern suc² n = suc (suc n)
pattern suc³ n = suc (suc² n)
_ : (n : Nat) → Id Nat (suc³ n) (suc (suc n))
_ = {!!}
data Vec {a} (A : Set a) : Nat → Set... |
------------------------------------------------------------------------
-- The Agda standard library
--
-- Integer division
------------------------------------------------------------------------
module Issue846.OldDivMod where
open import Data.Nat as Nat
open import Data.Nat.Properties
open SemiringSolver
open imp... |
postulate
A : Set
T : A → Set
g : {{a : A}} → Set → T a
test : {{a b : A}} → Set
test {{a}} {{b}} = {!g A!} -- C-u C-u C-c C-d gives T b
|
module _ where
module A where
syntax c x = ⟦ x
data D₁ : Set where
b : D₁
c : D₁ → D₁
module B where
syntax c x = ⟦ x ⟧
data D₂ : Set where
c : A.D₁ → D₂
open A
open B
test₁ : D₂
test₁ = ⟦ (⟦ c b) ⟧
test₂ : D₂ → D₁
test₂ ⟦ x ⟧ = ⟦ x
test₃ : D₁ → D₂
test₃ b = c b
test₃ (⟦ x) = ⟦ x ⟧
te... |
module simpleAgda where
-- main : IO ()
-- main = putStrLn "Testing simple Idris"
--
-- Some simple equivalent Idris and Agda code.
--
-- data N = Z | Suc N
data N : Set where
Z : N
suc : N -> N
-- one : N
-- one = Suc Z
one : N
one = suc Z
-- addOne : N -> N
-- addOne Z = Suc Z
-- addOne (Suc n) = Suc (Suc ... |
-- Andreas, 2015-07-10, issue reported by asr
-- {-# OPTIONS -v scope:20 #-}
-- {-# OPTIONS -v scope.createModule:10 #-}
module _ where
module A where
module Y where
module B where
-- FAILS:
module X = A
open X public
-- open A public --WORKS
module C = B
-- On maint and master:
-- An internal error has ... |
module Foundation.Bottom where
open import Foundation.Primitive
record IsBottom {ℓ-⊥} (⊥ : Set ℓ-⊥) ℓ-elim : ℞ ⟰ ℓ-elim ⊔ ℓ-⊥ where
field
⊥-elim : ⊥ → {A : Set ℓ-elim} → A
open IsBottom ⦃ … ⦄ public
record Bottom ℓ-⊥ ℓ-elim : ℞₁ ℓ-elim ⊔ ℓ-⊥ where
field
⊥ : Set ℓ-⊥
instance ⦃ isBottom ⦄ : IsBottom ... |
{-
Define finitely generated ideals of commutative rings and
show that they are an ideal.
Parts of this should be reusable for explicit constructions
of free modules over a finite set.
-}
{-# OPTIONS --safe #-}
module Cubical.Algebra.CommRing.FGIdeal where
open import Cubical.Foundations.Prelude
open import Cu... |
open import Prelude
open import Nat
open import dynamics-core
open import contexts
module lemmas-gcomplete where
-- if you add a complete type to a complete context, the result is also a
-- complete context
gcomp-extend : ∀{Γ τ x} → Γ gcomplete → τ tcomplete → x # Γ → (Γ ,, (x , τ)) gcomplete
gcomp-extend {Γ} ... |
{-# OPTIONS --without-K #-}
module FinVecProperties where
open import Data.Nat using (ℕ; _+_; _*_)
open import Data.Fin using (Fin; zero; suc; inject+; raise)
open import Data.Sum using (inj₁; inj₂; [_,_]′)
open import Data.Product using (_×_; proj₁; proj₂; _,′_)
open import Data.Vec
using (Vec; []; _∷_; tabulate... |
module Agda.Builtin.String where
open import Agda.Builtin.Bool
open import Agda.Builtin.List
open import Agda.Builtin.Char
postulate String : Set
{-# BUILTIN STRING String #-}
primitive
primStringToList : String → List Char
primStringFromList : List Char → String
primStringAppend : String → String → Strin... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.