text stringlengths 4 690k |
|---|
{-# OPTIONS --rewriting #-}
open import Common.Equality
{-# BUILTIN REWRITE _≡_ #-}
postulate
A : Set
f g : A → A
f≡g : ∀ a → f a ≡ g a
{-# REWRITE f≡g #-}
-- Adding the same rule again would make Agda loop
postulate
f≡g' : ∀ a → f a ≡ g a
{-# REWRITE f≡g' #-}
goal : ∀ {a} → f a ≡ g a
goal = refl
|
module Oscar.Class where
open import Oscar.Data.Equality
open import Oscar.Function
open import Oscar.Relation
open import Oscar.Level
open import Oscar.Function
open import Oscar.Relation
-- instance EquivalenceProp : ∀ {a} {A : Set a} → Equivalence (_≡_ {a} {A})
-- EquivalenceProp = {!!}
-- instance EquivalencePr... |
{-# OPTIONS --safe #-}
module Cubical.Algebra.CommRingSolver.HornerEval where
open import Cubical.Foundations.Prelude
open import Cubical.Data.Nat using (ℕ)
open import Cubical.Data.Int hiding (_+_ ; _·_ ; -_)
open import Cubical.Data.Vec
open import Cubical.Data.Bool
open import Cubical.Relation.Nullary.Base using ... |
------------------------------------------------------------------------
-- The Agda standard library
--
-- Properties of the `Reflects` construct
------------------------------------------------------------------------
{-# OPTIONS --without-K --safe #-}
module Relation.Nullary.Reflects where
open import Agda.Builti... |
{-# OPTIONS --safe #-}
module Cubical.Algebra.CommRing where
open import Cubical.Algebra.CommRing.Base public
open import Cubical.Algebra.CommRing.Properties public
|
{-# OPTIONS --without-K #-}
module Pim2Cat where
open import Level using (zero)
open import Data.Product using (_,_; _×_; proj₁; proj₂)
import Relation.Binary.PropositionalEquality as P
using (_≡_; refl; isEquivalence)
open import Categories.Category using (Category)
open import Categories.Groupoid using (Groupo... |
{-# OPTIONS --cubical #-}
module _ where
open import Agda.Primitive.Cubical
open import Agda.Builtin.Cubical.Path
data ⊤ : Set where
tt : ⊤
data S : Set where
base : S
loop : base ≡ base
postulate
P' : base ≡ base → Set
pl : P' loop
foo : P' loop
foo with tt
... | w = pl
|
{-# OPTIONS --cubical --no-import-sorts --safe #-}
module Cubical.Data.Sum where
open import Cubical.Data.Sum.Base public
open import Cubical.Data.Sum.Properties public
|
------------------------------------------------------------------------
-- The Agda standard library
--
-- Some code related to transitive closures that relies on the K rule
------------------------------------------------------------------------
{-# OPTIONS --with-K --safe #-}
module Relation.Binary.Construct.Closu... |
-- Intuitionistic propositional calculus.
-- Hilbert-style formalisation of syntax.
-- Nested terms.
module IPC.Syntax.Hilbert where
open import IPC.Syntax.Common public
-- Derivations.
infix 3 _⊢_
data _⊢_ (Γ : Cx Ty) : Ty → Set where
var : ∀ {A} → A ∈ Γ → Γ ⊢ A
app : ∀ {A B} → Γ ⊢ A ▻ B → Γ ⊢ A → Γ... |
{-
Add axioms (i.e., propositions) to a structure S without changing the definition of structured equivalence.
X ↦ Σ[ s ∈ S X ] (P X s) where (P X s) is a proposition for all X and s.
-}
{-# OPTIONS --cubical --no-import-sorts --safe #-}
module Cubical.Structures.Axioms where
open import Cubical.Foundations.Prelude... |
module OldBasicILP.Syntax.Common where
open import Common.ContextPair public
|
module Algebra.LabelledGraph.Reasoning where
open import Algebra.Dioid
open import Algebra.LabelledGraph
-- Standard syntax sugar for writing equational proofs
infix 4 _≈_
data _≈_ {A B eq} {d : Dioid B eq} (x y : LabelledGraph d A) : Set where
prove : x ≡ y -> x ≈ y
infix 1 begin_
begin_ : ∀ {A B eq} {d : Dioid... |
module Type.Category.ExtensionalFunctionsCategory.HomFunctor where
import Functional as Fn
open import Function.Proofs
open import Function.Equals
open import Function.Equals.Proofs
open import Logic.Predicate
import Lvl
import Relator.Equals.Proofs.Equiv
open import Structure.Category
open import Struc... |
{-# OPTIONS --without-K #-}
module pointed.core where
open import sum
open import equality.core
open import function.core
open import function.isomorphism.core
PSet : ∀ i → Set _
PSet i = Σ (Set i) λ X → X
PMap : ∀ {i j} → PSet i → PSet j → Set _
PMap (X , x) (Y , y) = Σ (X → Y) λ f → f x ≡ y
_∘P_ : ∀ {i j k}{𝓧 : ... |
{-# OPTIONS --without-K #-}
open import lib.Basics
module lib.types.FreeGroup where
module _ {i} where
private
data #FreeGroup-aux (A : Type i) : Type i where
#fg-nil : #FreeGroup-aux A
_#fg::_ : A → #FreeGroup-aux A → #FreeGroup-aux A
_#fg-inv::_ : A → #FreeGroup-aux A → #FreeGroup-aux A
... |
------------------------------------------------------------------------
-- The Agda standard library
--
-- Commutative semirings with some additional structure ("almost"
-- commutative rings), used by the ring solver
------------------------------------------------------------------------
{-# OPTIONS --without-K --sa... |
open import Agda.Builtin.List
open import Agda.Builtin.Reflection
open import Agda.Builtin.Unit
macro
m : Term → TC ⊤
m _ =
bindTC (quoteTC (Set → @0 Set → Set)) λ t →
typeError (termErr t ∷ [])
_ : Set
_ = m
|
{-# OPTIONS --without-K #-}
module Cat where
import Level as L
open import Data.Fin hiding (fromℕ; toℕ)
open import Data.Nat
open import Data.Product
open import Data.List
open import Function renaming (_∘_ to _○_)
open import HoTT
open import FT
open import FT-Nat
import Equivalences as E
open import Path2Equiv
{-... |
module L.Data.Bool.Core where
open import L.Base.Coproduct.Core
open import L.Base.Unit.Core
-- Deriving the introduction rule as a special case of Coproducts.
Bool : Set
Bool = ⊤ + ⊤
ff : Bool
ff = inr ⋆
tt : Bool
tt = inl ⋆
-- And the elimination rule
if : ∀{c} (C : Bool → Set c)
→ C tt → C ff → (e : Bool) ... |
{-# OPTIONS --cubical #-}
module HyperFalse where
open import Prelude hiding (false)
{-# NO_POSITIVITY_CHECK #-}
record _↬_ (A : Type a) (B : Type b) : Type (a ℓ⊔ b) where
inductive; constructor hyp
field invoke : (B ↬ A) → B
open _↬_
yes? : ⊥ ↬ ⊥
yes? .invoke h = h .invoke h
no! : (⊥ ↬ ⊥) → ⊥
no! h = h .invo... |
-- Andreas, 2016-04-14 issue 1796 for rewrite
-- {-# OPTIONS --show-implicit #-}
-- {-# OPTIONS -v tc.size.solve:100 #-}
-- {-# OPTIONS -v tc.with.abstract:40 #-}
open import Common.Size
open import Common.Equality
data Either (A B : Set) : Set where
left : A → Either A B
right : B → Either A B
either : {A B :... |
{-# OPTIONS --universe-polymorphism #-}
module Imports.Test where
open import Imports.Level
record Foo (ℓ : Level) : Set ℓ where
|
open import Agda.Builtin.Equality using (_≡_)
open import Agda.Builtin.Sigma using (Σ; _,_)
postulate
F : Set → Set₁
P : (A : Set) → F A → Set
easy : {A : Set₁} → A
A : Set₁
A = Σ Set λ B → Σ (F B) (P B)
f : (X Y : A) → X ≡ Y
f (C , x , p) (D , y , q) = proof
module _ where
abstract
proof : (C ,... |
{-# OPTIONS --without-K --safe #-}
module Categories.Adjoint.Equivalence where
open import Level
open import Categories.Adjoint
open import Categories.Category
open import Categories.Functor renaming (id to idF)
open import Categories.Functor.Properties
open import Categories.NaturalTransformation.NaturalIsomorphism... |
open import Relation.Binary.Core
module InsertSort.Everything {A : Set}
(_≤_ : A → A → Set)
(tot≤ : Total _≤_) where
open import InsertSort.Impl1.Correctness.Order _≤_ tot≤
open import InsertSort.Impl1.Correctness.Permutation.Alternative _≤_ tot≤
open import InsertSort.Impl1.Corre... |
import cedille-options
module to-string (options : cedille-options.options) where
open import cedille-types
open import constants
open import syntax-util
open import ctxt
open import rename
open import general-util
open import datatype-util
open import type-util
open import free-vars
open import json
data expr-side ... |
data Nat : Set where
zero : Nat
suc : Nat → Nat
_+_ : Nat → Nat → Nat
zero + n = n
suc m + n = suc ?
|
{-# OPTIONS --without-K #-}
open import lib.Basics
open import lib.types.Sigma
open import lib.types.Bool
open import lib.types.Truncation hiding (Trunc)
open import Pointed
open import Preliminaries hiding (_^_)
module Judgmental_Computation where
-- Chapter 6: On the Truncation's Judgmental
-- Computa... |
{-# OPTIONS --omega-in-omega --no-termination-check --overlapping-instances #-}
module Light.Library.Relation.Binary.Equality where
open import Light.Library.Relation.Binary using (Binary ; SelfBinary)
open import Light.Library.Relation using (Base)
open import Light.Variable.Levels
open import Light.Level using (Set... |
module Oscar.Category.Semifunctor where
open import Oscar.Category.Setoid
open import Oscar.Category.Semigroupoid
open import Oscar.Level
module _
{𝔬₁ 𝔪₁ 𝔮₁} (semigroupoid₁ : Semigroupoid 𝔬₁ 𝔪₁ 𝔮₁)
{𝔬₂ 𝔪₂ 𝔮₂} (semigroupoid₂ : Semigroupoid 𝔬₂ 𝔪₂ 𝔮₂)
where
private module 𝔊₁ = Semigroupoid semigro... |
module Issue561 where
open import Agda.Builtin.Bool
open import Issue561.Core
primitive
primIsDigit : Char → Bool
main : IO Bool
main = return true
|
{-# OPTIONS --without-K --rewriting #-}
open import HoTT
module Extensions where
ExtensionOf : ∀ {ℓ} {A B : Type ℓ} (f : A → B) (P : B → Type ℓ) (φ : (a : A) → P (f a)) → Type ℓ
ExtensionOf {A = A} {B = B} f P φ = Σ (Π B P) (λ ψ → (a : A) → ψ (f a) == φ a)
syntax ExtensionOf f P φ = ⟨ P ⟩⟨ φ ↗ f ⟩
path-ext... |
open import IO using ( run ; putStrLn )
open import Web.URI using ( AURI ; toString ; http://_ ; _/_ )
module Web.URI.Examples.HelloWorld where
hw : AURI
hw = http://"example.com"/"hello"/"world"
main = run (putStrLn (toString hw)) |
{-
Verified Red-Black Trees
Toon Nolten
Based on Chris Okasaki's "Red-Black Trees in a Functional Setting"
where he uses red-black trees to implement sets.
Invariants
----------
1. No red node has a red parent
2. Every Path from the root to an empty node contains the same number of
black n... |
-- Andreas, 2015-03-26
-- Andrea discovered that unfold for Lists is typable with sized types
-- (and termination checks).
-- Dually, fold for Streams should work. Therefore, the restriction
-- of coinductive records to recursive records should be lifted.
{-# OPTIONS --copatterns #-}
open import Common.Size
-- Str... |
{-# OPTIONS --without-K --safe #-}
open import Definition.Typed.EqualityRelation
module Definition.LogicalRelation.Substitution.Introductions.Empty {{eqrel : EqRelSet}} where
open EqRelSet {{...}}
open import Definition.Untyped
open import Definition.Typed
open import Definition.Typed.Properties
open import Definiti... |
{-# OPTIONS --safe #-}
module Cubical.Algebra.CommMonoid.Instances.FreeComMonoid where
open import Cubical.Foundations.Prelude
open import Cubical.HITs.FreeComMonoids
open import Cubical.Algebra.CommMonoid.Base
private variable
ℓ : Level
FCMCommMonoid : {A : Type ℓ} → CommMonoid ℓ
FCMCommMonoid {A = A} = makeComm... |
module Reduction where
import Level
open import Data.Empty
open import Data.Unit as Unit
open import Data.Nat
open import Data.List as List renaming ([] to Ø; [_] to [_]L)
open import NonEmptyList as NList
open import Data.Fin hiding (_+_)
open import Data.Vec as Vec renaming ([_] to [_]V; _++_ to _++V_)
open import D... |
{-# OPTIONS --cubical --safe #-}
module Cubical.Data.Nat.GCD where
open import Cubical.Foundations.Prelude
open import Cubical.Foundations.Function
open import Cubical.Foundations.HLevels
open import Cubical.Foundations.Equiv
open import Cubical.Foundations.Isomorphism
open import Cubical.Induction.WellFounded
open ... |
open import Oscar.Prelude
open import Oscar.Class.HasEquivalence
import Oscar.Data.Constraint
module Oscar.Data.ProductIndexEquivalence where
module _ {𝔬} {𝔒 : Ø 𝔬} {𝔭} {𝔓 : 𝔒 → Ø 𝔭} {ℓ} ⦃ _ : HasEquivalence 𝔒 ℓ ⦄ where
record _≈₀_ (P Q : Σ 𝔒 𝔓) : Ø ℓ where
constructor ∁
field
π₀ : π₀ P ≈... |
-- https://www.codewars.com/kata/50654ddff44f800200000004
{-# OPTIONS --safe #-}
module Solution where
open import Data.Nat
multiply : ℕ → ℕ → ℕ
multiply a b = a * b
|
module Channel where
open import Data.Bool hiding (_≤_)
open import Data.Fin hiding (_≤_)
open import Data.List hiding (map)
open import Data.Maybe
open import Data.Nat
open import Data.Nat.Properties
open import Data.Product hiding (map)
open import Relation.Binary.PropositionalEquality
open import Typing
open impor... |
module Structure.Categorical.Names where
import Lvl
open import Functional using (const ; swap)
open import Logic
open import Structure.Setoid
import Structure.Operator.Names as Names
import Structure.Relator.Names as Names
open import Type
private variable ℓₒ ℓₘ ℓₑ : Lvl.Level
private variable Obj : T... |
{-# OPTIONS --cubical-compatible #-}
variable
@0 A : Set
record D : Set₁ where
field
f : A
|
module QuoteContext where
open import Common.Level
open import Common.Prelude
open import Common.Product
open import Common.Equality
open import Common.Reflection
Vec : Set → Nat → Set
Vec A zero = ⊤
Vec A (suc x) = A × Vec A x
test : (n : Nat) (v : Vec Nat n) (m : Nat) → List (Arg Type)
test zero v n = quoteContext... |
data D (A : Set) : Set where
c : A → D A
postulate
f : (A : Set) → D A → D A
P : (A : Set) → D A → Set
_ : (A : Set) (B : _) (g : A → B) → P _ (f _ (c g))
|
{-# OPTIONS --cumulativity #-}
open import Agda.Primitive
open import Agda.Builtin.Equality
lone ltwo lthree : Level
lone = lsuc lzero
ltwo = lsuc lone
lthree = lsuc ltwo
fails : _≡_ {a = lthree} {A = Set₂} Set₀ Set₁
fails = refl
|
open import Agda.Builtin.Unit
open import Agda.Builtin.Bool
open import Agda.Builtin.List
open import Agda.Builtin.Reflection
open import Agda.Builtin.Equality
variable
A B : Set
data Eqn (A : Set) : Set where
eqn : (x y : A) → x ≡ y → Eqn A
infix 3 _==_
pattern _==_ x y = eqn x y refl
infixl 0 such-that
synta... |
------------------------------------------------------------------------
-- The Agda standard library
--
-- A module used for creating function pipelines, see
-- README.Function.Reasoning for examples
------------------------------------------------------------------------
{-# OPTIONS --without-K --safe #-}
module Fu... |
{-# OPTIONS --cubical --safe --postfix-projections #-}
module Function.Surjective.Properties where
open import Path
open import Function.Fiber
open import Level
open import HITs.PropositionalTruncation
open import Data.Sigma
open import Function.Surjective.Base
open import Function.Injective.Base
open import Function... |
module Data.Collection.Properties where
open import Data.Collection.Core
open import Data.Collection.Equivalence
open import Data.Collection.Inclusion
open import Data.Collection
open import Data.Sum renaming (map to mapSum)
open import Data.Product
open import Function.Equivalence using (_⇔_; equivalence)
-- open i... |
-- Classical propositional logic, de Bruijn approach, initial encoding
module Bi.Cp where
open import Lib using (List; _,_; LMem; lzero; lsuc)
-- Types
infixl 2 _&&_
infixl 1 _||_
infixr 0 _=>_
data Ty : Set where
UNIT : Ty
_=>_ : Ty -> Ty -> Ty
_&&_ : Ty -> Ty -> Ty
_||_ : Ty -> Ty -> Ty
... |
module _ where
open import Function.Iteration using (repeatᵣ ; repeatₗ)
[+]-repeatᵣ-𝐒 : ∀{x y z : ℕ} → (x + y ≡ repeatᵣ y (const 𝐒) z x)
[+]-repeatᵣ-𝐒 {x} {𝟎} = [≡]-intro
[+]-repeatᵣ-𝐒 {x} {𝐒 y} {z} = congruence₁(𝐒) ([+]-repeatᵣ-𝐒 {x} {y} {z})
[+]-repeatₗ-𝐒 : ∀{x y z : ℕ} → (x + y ≡ repeatₗ y (const ∘... |
-- Andreas, 2015-11-10, issue reported by Wolfram Kahl
-- {-# OPTIONS -v scope.mod.inst:30 #-}
-- {-# OPTIONS -v tc.mod.check:10 -v tc.mod.apply:80 -v impossible:10 #-}
postulate
A : Set
a : A
module Id (A : Set) (a : A) where
x = a
module ModParamsToLoose (A : Set) where
private module M (a : A) where modul... |
open import FRP.JS.String using ( String )
open import FRP.JS.Time using ( Time ; _+_ )
open import FRP.JS.Behaviour using ( Beh ; map ; [_] ; join )
open import FRP.JS.DOM using ( DOM ; text )
open import FRP.JS.RSet using ( ⟦_⟧; ⟨_⟩ )
open import FRP.JS.Time using ( toUTCString ; every )
open import FRP.JS.Delay usin... |
open import Agda.Builtin.Sigma
open import Agda.Builtin.Equality
postulate
A : Set
B : A → Set
a : A
Pi : (A → Set) → Set
Pi B = {x : A} → B x
foo : Pi \ y → Σ (B y) \ _ → Pi \ z → Σ (y ≡ a → B z) \ _ → B y → B z → A
foo = {!!} , (\ { refl → {!!} }) , {!!}
|
{-# OPTIONS --without-K #-}
open import Prelude
import GSeTT.Syntax
import GSeTT.Rules
import GSeTT.Typed-Syntax
open import MCaTT.Desuspension
open import CaTT.Ps-contexts
import CaTT.CaTT
module MCaTT.MCaTT where
J = CaTT.CaTT.J
eqdecJ = CaTT.CaTT.eqdecJ
open import Globular-TT.Syntax J
↓C : Pre-Ctx → Pr... |
-- Andreas, 2015-12-05 issue reported by Conor
-- {-# OPTIONS -v tc.cover.splittree:10 -v tc.cc:20 #-}
module Issue1734 where
infix 4 _≡_
data _≡_ {A : Set} (x : A) : A → Set where
refl : x ≡ x
record One : Set where constructor <>
data Two : Set where tt ff : Two
-- two : ∀{α}{A : Set α} → A → A → Two → A
two... |
-- Andreas, 2018-10-16, wrong quantity in lambda-abstraction
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:
--
-- Wrong quantity annotation in lambda abstraction.
--
-- Current error (because @ω as default q... |
{-# OPTIONS --warning=error --safe --without-K #-}
open import LogicalFormulae
open import Semirings.Definition
open import Numbers.Naturals.Order
open import Numbers.Naturals.Semiring
module Numbers.Naturals.Order.Lemmas where
open Semiring ℕSemiring
inequalityShrinkRight : {a b c : ℕ} → a +N b <N c → b <N c
inequa... |
{-# OPTIONS --without-K #-}
module Explore.Explorable.Isos where
open import Function
open import Data.Product
open import Data.Nat
open import Data.Vec renaming (sum to vsum)
open import Function.Related.TypeIsomorphisms.NP
import Relation.Binary.PropositionalEquality.NP as ≡
open ≡ using (_≡_; _≗_)
open import Expl... |
open import Preliminaries
module Lab3-LRSol where
{- de Bruijn indices are representd as proofs that
an element is in a list -}
data _∈_ {A : Set} : (x : A) (l : List A) → Set where -- type \in
i0 : {x : A} {xs : List A} → x ∈ x :: xs
iS : {x y : A} {xs : List A} → x ∈ xs → x ∈ y :: xs
{- types o... |
------------------------------------------------------------------------
-- The Agda standard library
--
-- Basic properties of ℕᵇ
------------------------------------------------------------------------
{-# OPTIONS --without-K --safe #-}
module Data.Nat.Binary.Properties where
open import Algebra.Bundles
open impor... |
------------------------------------------------------------------------
-- The Agda standard library
--
-- Lemmas for use in proving the polynomial homomorphism.
------------------------------------------------------------------------
{-# OPTIONS --without-K --safe #-}
open import Tactic.RingSolver.Core.Polynomial.P... |
{-# OPTIONS --without-K --safe #-}
module Categories.Functor.Duality where
open import Level
open import Data.Product using (Σ; _,_)
open import Categories.Category
open import Categories.Category.Construction.Cones as Con
open import Categories.Category.Construction.Cocones as Coc
open import Categories.Functor
ope... |
------------------------------------------------------------------------
-- The Agda standard library
--
-- Sum combinators for setoid equality preserving functions
------------------------------------------------------------------------
{-# OPTIONS --without-K --safe #-}
module Data.Sum.Function.Setoid where
open i... |
-- WARNING: This file was generated automatically by Vehicle
-- and should not be modified manually!
-- Metadata
-- - Agda version: 2.6.2
-- - AISEC version: 0.1.0.1
-- - Time generated: ???
open import Data.Unit
open import Data.Int as ℤ using (ℤ)
open import Data.List
open import Data.List.Relation.Unary.All as L... |
------------------------------------------------------------------------
-- An investigation of various ways to define the semantics of an
-- untyped λ-calculus and a virtual machine, and a discussion of
-- type soundness and compiler correctness
--
-- Nils Anders Danielsson
--------------------------------------------... |
open import Data.Nat using (ℕ; zero; suc; _+_)
open import Data.Nat.Show using (show)
open import Function using (_$!_)
open import IO using (run; putStrLn)
sum : ℕ
sum = f 1000000000 0
where
f : ℕ → ℕ → ℕ
f zero acc = acc
f (suc n) acc = f n $! suc n + acc
main = run (putStrLn (show sum))
|
{-# OPTIONS --without-K --rewriting #-}
module HoTT where
open import lib.Basics public
open import lib.Equivalence2 public
open import lib.NConnected public
open import lib.NType2 public
open import lib.Relation2 public
open import lib.Function2 public
open import lib.cubical.Cubical public
open import lib.types.T... |
module StreamPredicates where
open import PropsAsTypes
open import Stream
module Modalities (A : Set) where
private
Aω : Set
Aω = Stream A
record Always (P : Pred Aω) (s : Stream A) : Prop where
coinductive
field
valid : P s
step : Always P (tl s)
open Always public
data Eventua... |
{-# OPTIONS --universe-polymorphism #-}
-- in a lot of cases we have a relation that is already reflexive and symmetric
-- and we want to make it symmetric
module Categories.Support.ZigZag where
open import Level
open import Relation.Binary
open import Relation.Binary.Construct.On using () renaming (isEquivalence to o... |
-- Copyright: (c) 2016 Ertugrul Söylemez
-- License: BSD3
-- Maintainer: Ertugrul Söylemez <esz@posteo.de>
module Algebra.Category.Groupoid where
open import Algebra.Category.Category
open import Core
-- A groupoid is a category where all morphisms are isomorphisms.
record Groupoid {c h r} : Set (lsuc (c ⊔ h ⊔... |
module Data.Num.Pred where
open import Data.Num.Core
open import Data.Num
open import Data.Num.Properties
open import Data.Num.Continuous
-- open import Data.Num.Bijection
open import Data.Nat
open import Data.Nat.Properties.Simple
open import Data.Nat.Properties.Extra
open import Data.Fin using (Fin; suc; zero; #_)
... |
{-# OPTIONS --cubical #-}
module Multidimensional.Data.DirNum.Base where
open import Cubical.Foundations.Prelude
open import Cubical.Data.Unit
open import Cubical.Data.Prod
open import Cubical.Data.Nat
open import Multidimensional.Data.Dir
-- Dependent "directional numerals":
-- for natural n, obtain 2ⁿ "numerals"... |
module MinMax where
open import Prelude
open import Logic.Base
open import Logic.Relations
open import Logic.Identity using (_≡_)
import Logic.ChainReasoning
open import DecidableOrder as DecOrder
module Min {A : Set}(Ord : DecidableOrder A) where
open DecidableOrder Ord
min : A → A → A
min a b with decide a ... |
module Pruning where
le2 : {B : Set} -> (A : Set) -> A -> (C : Set) -> C -> (A -> C -> B) -> B
le2 _ x _ y f = f x y
test : le2 Set _ (Set -> Set) _ (\ H -> (\M -> (z : Set) -> H == M z))
test z = refl
{-
let : {B : Set} -> (A : Set) -> A -> (A -> B) -> B
let A x f = f x
test : let Set _ (\ H -> let (Set -> Set) _ ... |
open import Agda.Primitive using (lzero; lsuc; _⊔_)
open import Relation.Binary.PropositionalEquality
import Relation.Binary.Reasoning.Setoid as SetoidR
import Categories.Category as Category
import Categories.Category.Cartesian as Cartesian
open import Categories.Object.Terminal using (Terminal)
open import Categori... |
{- --- 4. Lists --- -}
data List (A : Set) : Set where
[] : List A
_∷_ : A → List A → List A
infixr 5 _∷_
open import Data.Nat
open import Relation.Binary.PropositionalEquality
{- 4.1 Length -}
length : {A : Set} → List A → ℕ
length [] = 0
length (x ∷ l) = 1 + (length l)
{- 4.2 List reversal -}
concat : {A ... |
{-# OPTIONS --without-K --safe #-}
open import Categories.Category using (Category; module Definitions)
-- Definition of the "Twisted Arrow" Category of a Category 𝒞
module Categories.Category.Construction.TwistedArrow {o ℓ e} (𝒞 : Category o ℓ e) where
open import Level
open import Data.Product using (_,_; _×_; ma... |
--------------------------------------------------------------------------------
-- This is part of Agda Inference Systems
{-# OPTIONS --guardedness #-}
open import Agda.Builtin.Equality
open import Data.Product
open import Data.Sum
open import Level
open import Relation.Unary using (_⊆_)
module is-lib.InfSys.FlexC... |
{-# OPTIONS --without-K --safe #-}
open import Categories.Category
module Categories.Diagram.Equalizer.Limit {o ℓ e} (C : Category o ℓ e) where
open import Level
open import Data.Nat.Base using (ℕ)
open import Data.Fin.Base hiding (lift)
open import Data.Fin.Patterns
open import Categories.Category.Lift
open import... |
module Main where
-- Ensure that the entire library is compiled.
import README
open import Coinduction
open import Data.String
open import Data.Unit using (⊤)
open import IO
open import Relation.Binary.PropositionalEquality
open import Relation.Nullary
-- Check that trustMe works.
testTrustMe : IO ⊤
testTrustMe wit... |
-- Andreas, 2016-08-26, issue 2152
-- Option --allow-unsolved-metas is not --safe
Unsolved : Set
Unsolved = ?
|
module Test.Factorial where
open import Data.Nat
factorial : ℕ -> ℕ
factorial zero = 1
factorial n@(suc n') = n * factorial n'
|
-- Andreas, 2018-05-09, issue 2636, reported by nad
-- {-# OPTIONS -v tc.pos:10 #-}
id : (A : Set₁) → A → A
id A x = x
A : Set₁
A = Set
where
F : Set₁ → Set₁
F X = X
data D : Set₁ where
c : F D → D
lemma : F (D → Set) → D → Set
lemma fp d = id (F (D → Set)) fp d
-- Problem was:
-- Positivity check... |
module Inductive.Examples.Ord where
open import Inductive
open import Tuple
open import Data.Fin
open import Data.Product
open import Data.List
open import Data.Vec hiding (lookup)
open import Inductive.Examples.Nat
Ord : Set
Ord = Inductive (([] , []) ∷ (([] , ((Nat ∷ []) ∷ [])) ∷ []))
zeroₒ : Ord
zeroₒ = constru... |
------------------------------------------------------------------------
-- INCREMENTAL λ-CALCULUS
--
-- Change contexts
--
-- This module specifies how a context of values is merged
-- together with the corresponding context of changes.
--
-- In the PLDI paper, instead of merging the contexts together, we just
-- conc... |
module GGT.Group.Bundles
{a b ℓ}
where
open import Algebra.Bundles using (Group)
open import Relation.Unary
open import Relation.Binary
open import Level
open import GGT.Group.Structures
record SubGroup (G : Group a ℓ) : Set (a ⊔ suc b ⊔ ℓ) where
open Group G public
field
P : Pred Carrier b
isSubGroup... |
------------------------------------------------------------------------
-- Code related to the paper "Compiling Programs with Erased
-- Univalence"
--
-- Nils Anders Danielsson
--
-- The paper is coauthored with Andreas Abel and Andrea Vezzosi.
------------------------------------------------------------------------
... |
module ASN1.X509 where
open import Data.Word8 using (Word8; _and_; _or_; _==_) renaming (primWord8fromNat to to𝕎; primWord8toNat to from𝕎)
open import Data.ByteString using (ByteString; Strict; pack; fromChunks; toStrict)
open import Data.ByteString.Utf8 using (packStrict)
open import Data.Bool using (Bool; true; fa... |
{-
Elementary transformation specific to coefficient ℤ
-}
{-# OPTIONS --safe #-}
module Cubical.Algebra.IntegerMatrix.Elementaries where
open import Cubical.Foundations.Prelude
open import Cubical.Foundations.Function
open import Cubical.Data.Nat hiding (_+_ ; _·_)
open import Cubical.Data.FinData
open import Cubi... |
postulate
A : Set
_+_ : A → A → A
f₁ : A → A → A
f₁ x y = {!_+ x!} -- ? + x
f₂ : A → A → A
f₂ x y = {!x +_!} -- x + ?
f₃ : A → A → A
f₃ x = {!_+ x!} -- λ section → section + x
f₄ : A → A → A
f₄ x y = {!λ z → z + x!} -- ? + x
f₅ : A → A → A
f₅ x y = {!λ a b → b + x!} -- ? + x
f₆ : A → A → A
f₆ x y = {!λ... |
open import Relation.Binary hiding (_⇒_)
module Experiments.Category {ℓ₁ ℓ₂ ℓ₃} (APO : Preorder ℓ₁ ℓ₂ ℓ₃) where
open import Level
open Preorder APO renaming (_∼_ to _≤_)
open import Function as Fun using (flip)
open import Relation.Unary using (Pred)
open import Data.Product as Prod using (_,_; _×_)
open import Rela... |
{-# OPTIONS --safe #-}
{-
Successor structures for spectra, chain complexes and fiber sequences.
This is an idea from Floris van Doorn's phd thesis.
-}
module Cubical.Structures.Successor where
open import Cubical.Foundations.Prelude
open import Cubical.Data.Int
open import Cubical.Data.Nat
private
variable
... |
------------------------------------------------------------------------
-- The Agda standard library
--
-- Sums (disjoint unions)
------------------------------------------------------------------------
{-# OPTIONS --without-K --safe #-}
module Data.Sum.Base where
open import Data.Bool.Base using (true; false)
open... |
------------------------------------------------------------------------
-- Localisation
------------------------------------------------------------------------
{-# OPTIONS --erased-cubical --safe #-}
-- Following "Modalities in Homotopy Type Theory" by Rijke, Shulman
-- and Spitters.
-- The module is parametrised ... |
-- Andreas, 2015-03-17
open import Common.Size
data ⊥ : Set where
data D (i : Size) : Set where
c : Size< i → D i
-- This definition of size predecessor should be forbidden...
module _ (i : Size) where
postulate
pred : Size< i
-- ...otherwise the injectivity test loops here.
iter : ∀ i → D i → ⊥
iter i (c ... |
module DeMorgan where
open import Definitions
deMorgan : {A B : Set} → ¬ A ∧ ¬ B → ¬ (A ∨ B)
deMorgan = {!!}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.