text stringlengths 4 690k |
|---|
-- Andreas, 2019-05-03, issue #3742, reported by nad
--
-- Regression introduced in 2.5.2:
--
-- getConstInfo applied to abstract constructor D.c
-- in metaOccurs check throws funny "not in scope" error for D.c
record Σ (A : Set) (B : A → Set₁) : Set₁ where
mutual
abstract
data D (A : Set) : Set where
c... |
------------------------------------------------------------------------
-- Some derivable properties
------------------------------------------------------------------------
open import Algebra
module Algebra.Props.AbelianGroup (g : AbelianGroup) where
open AbelianGroup g
import Relation.Binary.EqReasoning as EqR; ... |
-- Andreas, 2016-11-03, issue #2211
-- The occurs check did not take variables labeled as `UnusedArg`
-- on the left hand side into consideration.
-- {-# OPTIONS -v tc.check.term:40 #-}
-- {-# OPTIONS -v tc.meta:45 #-}
-- {-# OPTIONS -v tc.polarity:20 #-}
open import Agda.Builtin.Equality
open import Common.Nat
cong... |
-- Minimal implicational modal logic, PHOAS approach, initial encoding
module Pi.BoxMp where
open import Lib using (Nat; suc)
-- Types
infixr 0 _=>_
data Ty : Set where
UNIT : Ty
_=>_ : Ty -> Ty -> Ty
BOX : Ty -> Ty
-- Context and truth judgement with modal depth
Cx : Set1
Cx = Ty -> Na... |
module Numeric.Nat.Properties where
open import Prelude hiding (less-antisym; less-antirefl; leq-antisym)
open import Prelude.Nat.Properties public
open import Tactic.Nat
--- Subtraction ---
sub-less : {a b : Nat} → a ≤ b → b - a + a ≡ b
sub-less {zero} _ = auto
sub-less {suc a} (diff! k) = auto
sub-underflow : (a... |
{-# OPTIONS --universe-polymorphism #-}
open import Categories.Category
module Categories.Morphisms {o ℓ e} (C : Category o ℓ e) where
open import Level
open import Relation.Binary using (IsEquivalence; Setoid)
open Category C
Mono : ∀ {A B} → (f : A ⇒ B) → Set _
Mono {A} f = ∀ {C} → (g₁ g₂ : C ⇒ A) → f ∘ g₁ ≡ f ∘ ... |
{-# OPTIONS --safe --cubical #-}
module Data.Pi.Base where
open import Level
Π : (A : Type a) (B : A → Type b) → Type _
Π A B = (x : A) → B x
∀′ : {A : Type a} (B : A → Type b) → Type _
∀′ {A = A} B = Π A B
infixr 4.5 ∀-syntax
∀-syntax : ∀ {a b} {A : Type a} (B : A → Type b) → Type (a ℓ⊔ b)
∀-syntax = ∀′
syntax ∀... |
module Thesis.IntChanges where
open import Data.Integer.Base
open import Relation.Binary.PropositionalEquality
open import Thesis.Changes
open import Theorem.Groups-Nehemiah
private
intCh = ℤ
instance
intCS : ChangeStructure ℤ
intCS = record
{ Ch = ℤ
; ch_from_to_ = λ dv v1 v2 → v1 + dv ≡ v2
; isCompChange... |
-- {-# OPTIONS -v tc.lhs.unify:50 #-}
module Issue81 where
data ⊥ : Set where
data D : Set where
d : D
c : D
data E : Set where
e : E
⌜_⌝ : E -> D
⌜ e ⌝ = c
data R : D -> E -> Set where
Val : (v : E) -> R ⌜ v ⌝ v
foo : R d e -> ⊥
foo ()
|
open import Agda.Primitive
open import Agda.Builtin.Sigma
variable
ℓ₁ ℓ₂ : Level
is-universal-element : {X : Set ℓ₁} {A : X → Set ℓ₂} → Σ X A → Set (ℓ₁ ⊔ ℓ₂)
is-universal-element {ℓ₁} {ℓ₂} {X} {A} (x , a) = ∀ y → A y
fails : {X : Set ℓ₁} {A : X → Set ℓ₂} (x : X) (a : A x)
→ is-universal-element {A = _} (x ,... |
{-# OPTIONS --without-K --rewriting #-}
open import HoTT
open import homotopy.HSpace renaming (HSpaceStructure to HSS)
open import homotopy.Freudenthal
open import homotopy.IterSuspensionStable
import homotopy.Pi2HSusp as Pi2HSusp
open import homotopy.EM1HSpace
open import homotopy.EilenbergMacLane1
module homotopy.E... |
------------------------------------------------------------------------------
-- Definition of the gcd of two natural numbers using the Euclid's algorithm
------------------------------------------------------------------------------
{-# OPTIONS --exact-split #-}
{-# OPTIONS --no-sized-types #-... |
{-# OPTIONS --warning=error --safe --without-K #-}
open import LogicalFormulae
open import Agda.Primitive using (Level; lzero; lsuc; _⊔_)
open import Functions.Definition
open import Setoids.Setoids
open import Setoids.DirectSum
open import Setoids.Subset
open import Graphs.Definition
open import Sets.FinSet.Definitio... |
{-# OPTIONS --show-implicit #-}
-- {-# OPTIONS -v tc:10 #-}
-- {-# OPTIONS -v tc.with:40 #-}
-- Andreas, 2014-11-26
-- Reported by twanvl
data Unit : Set where
unit : Unit
module Mod₁ (t : Unit) where
postulate Thing : Set
module Mod₂ (u : Unit) where
open Mod₁ unit
record Foo : Set where
field
... |
------------------------------------------------------------------------------
-- Totality of natural numbers addition
------------------------------------------------------------------------------
{-# OPTIONS --exact-split #-}
{-# OPTIONS --no-sized-types #-}
{-# OPTIONS --no-universe-polymorph... |
{-# OPTIONS --without-K --rewriting #-}
open import lib.Base
open import lib.Function
open import lib.NType
open import lib.PathGroupoid
open import lib.Relation
open import lib.types.Coproduct
open import lib.types.Empty
module lib.types.Nat where
infixl 80 _+_
_+_ : ℕ → ℕ → ℕ
0 + n = n
(S m) + n = S (m + n)
{-# B... |
------------------------------------------------------------------------
-- The Agda standard library
--
-- Basic definitions for morphisms between algebraic structures
------------------------------------------------------------------------
{-# OPTIONS --without-K --safe #-}
open import Relation.Binary.Core
module ... |
open import Common.Equality
open import Common.Prelude renaming (Nat to ℕ)
infixr 4 _,_
infix 4 ,_
record Σ (A : Set) (B : A → Set) : Set where
constructor _,_
field
proj₁ : A
proj₂ : B proj₁
open Σ
,_ : {A : Set} {B : A → Set} {x : A} → B x → Σ A B
, y = _ , y
should-be-accepted : Σ ℕ λ i → Σ ℕ λ j →... |
module Prelude.Level where
postulate
Level : Set
zero : Level
suc : Level → Level
max : Level → Level → Level
{-# BUILTIN LEVEL Level #-}
{-# BUILTIN LEVELZERO zero #-}
{-# BUILTIN LEVELSUC suc #-}
{-# BUILTIN LEVELMAX max #-}
|
module Issue705 where
module A where
data A : Set where
open A
open A |
{-# OPTIONS --without-K --safe #-}
module Categories.Category.Instance.FinSetoids where
-- Category of Finite Setoids, as a sub-category of Setoids
open import Level
open import Data.Fin.Base using (Fin)
open import Data.Nat.Base using (ℕ)
open import Data.Product using (Σ)
open import Function.Bundles using (Invers... |
module HeapPropertiesDefs where
open import Silica
import Relation.Binary.PropositionalEquality as Eq
import Context
open import Data.List.Relation.Unary.All
import Relation.Unary
import Data.List.Properties
import Data.List
open import Data.Sum
open import Data.Maybe
open import Data.List.Membe... |
open import Issue983-Bad
|
{-# OPTIONS --cubical --no-import-sorts --safe #-}
module Cubical.ZCohomology.Groups.Sn where
open import Cubical.ZCohomology.Base
open import Cubical.ZCohomology.Properties
open import Cubical.ZCohomology.Groups.Unit
open import Cubical.ZCohomology.Groups.Connected
open import Cubical.ZCohomology.GroupStructure
open ... |
------------------------------------------------------------------------
-- The Agda standard library
--
-- The basic code for equational reasoning with two relations:
-- equality and some other ordering.
------------------------------------------------------------------------
--
-- See `Data.Nat.Properties` or `Relati... |
{-# OPTIONS --allow-unsolved-metas #-}
module Issue501 where
record ⊤ : Set where
constructor tt
data _⊎_ (A : Set) (B : Set) : Set where
inj₁ : (x : A) → A ⊎ B
inj₂ : (y : B) → A ⊎ B
[_,_] : ∀ {A : Set} {B : Set} {C : A ⊎ B → Set} →
((x : A) → C (inj₁ x)) → ((x : B) → C (inj₂ x)) →
((x : A ⊎ B... |
------------------------------------------------------------------------
-- The Agda standard library
--
-- Properties satisfied by meet semilattices
------------------------------------------------------------------------
{-# OPTIONS --without-K --safe #-}
open import Relation.Binary.Lattice
module Relation.Binary.... |
{-# OPTIONS --safe #-}
module Cubical.Data.Int.Properties where
open import Cubical.Core.Everything
open import Cubical.Foundations.Prelude
open import Cubical.Foundations.Equiv
open import Cubical.Foundations.Transport
open import Cubical.Foundations.HLevels
open import Cubical.Foundations.Isomorphism
open import Cu... |
{- Constructor-headedness and projection-likeness don't play well
together. Unless they are kept apart or their differences can
be reconciled this example will leave unsolved metas. The problem
is that invoking constructor-headedness on a projection-like
the dropped arguments won't be checked (or rather, th... |
-- Andreas, 2016-07-29, issue #1720 reported by Mietek Bak
{-# OPTIONS --double-check #-}
postulate
A : Set
B : A → Set
a0 : A
b0 : B a0
record R (a1 : A) (b1 : B a1) : Set where
field fa : A
a : A
a = {!a1!}
field fb : B fa
b : B {!!}
b = {!b1!}
field f : A
-- Problem:
-- Interaction p... |
------------------------------------------------------------------------------
-- A stronger (maybe invalid) principle for ≈-coind
------------------------------------------------------------------------------
{-# OPTIONS --exact-split #-}
{-# OPTIONS --no-sized-types #-}
{-# OPTIONS --no-univer... |
open import Data.Product using ( _×_ ; _,_ )
open import FRP.LTL.ISet.Core using ( ISet ; MSet ; [_] ; _⇛_ ; _,_ )
open import FRP.LTL.Time using ( _+_ ; +-resp-≤ ; +-resp-< )
open import FRP.LTL.Time.Bound using
( Time∞ ; +∞ ; fin ; _≼_ ; _≺_ ; +∞-top ; ≤-impl-≼ ; t≺+∞ ; ≺-impl-⋡ ; ≺-impl-< ; <-impl-≺ )
open import... |
-- Intuitionistic logic, PHOAS approach, initial encoding
module Pi.I (Indiv : Set) where
-- Types
data Ty : Set
Pred : Set
Pred = Indiv -> Ty
infixl 2 _&&_
infixl 1 _||_
infixr 0 _=>_
data Ty where
UNIT : Ty
_=>_ : Ty -> Ty -> Ty
_&&_ : Ty -> Ty -> Ty
_||_ : Ty -> Ty -> Ty
FALSE : ... |
{-# OPTIONS --cubical --allow-unsolved-metas --postfix-projections #-}
module Data.Row where
open import Prelude
open import Data.Nat.Properties using (snotz)
open import Data.Bool.Properties using (isPropT)
infixr 5 _∷_
data Row (A : Type a) : Type a where
[] : Row A
_∷_ : A → Row A → Row A
swap : ∀ x y xs → ... |
-- Andreas, 2012-09-24 Ensure that size successor is monotone
-- Andreas, 2015-03-16 SizeUniv is still imperfect, so we need type-in-type
-- here to work around the conflation of sLub and the PTS rule.
{-# OPTIONS --type-in-type #-}
module SizeSucMonotone where
open import Common.Size
data Bool : Set where
true f... |
------------------------------------------------------------------------
-- The Agda standard library
--
-- Dependent product combinators for setoid equality preserving
-- functions
------------------------------------------------------------------------
{-# OPTIONS --without-K --safe #-}
module Data.Product.Function... |
module Error-in-imported-module.M where
Foo : Set
Foo = Set
|
{-# OPTIONS --without-K --safe #-}
module Bundles where
open import Algebra.Core
open import Relation.Binary
open import Level
open import Algebra.Bundles
open import Algebra.Structures
open import Structures
------------------------------------------------------------------------
-- Bundles with 1 binary operation
... |
module Issue4267.M where
record R : Set₂ where
field
f : Set₁
|
open import Nat
open import Prelude
open import core
open import contexts
open import lemmas-consistency
open import lemmas-ground
open import progress-checks
open import canonical-boxed-forms
open import canonical-value-forms
open import canonical-indeterminate-forms
open import ground-decidable
open import htype-d... |
module Main where
import Data.Any
import Data.Boolean
import Data.Either
-- import Data.List
-- import Data.ListNonEmpty
-- import Data.ListSized
import Data.Option
-- import Data.Proofs
import Data.Tuple
import Lang.Instance
import Lang.Irrelevance
import Lang.Size
import Logic
-- import Logic.Classical
-- import Log... |
{-# OPTIONS --without-K --safe #-}
module Util.HoTT.Homotopy where
open import Relation.Binary using (IsEquivalence)
open import Util.Prelude
open import Util.Relation.Binary.PropositionalEquality using (cong-app)
module _ {α β} {A : Set α} {B : A → Set β} where
_~_ : (f g : ∀ a → B a) → Set (α ⊔ℓ β)
f ~ g = ∀... |
{-# OPTIONS --cubical --no-import-sorts #-}
open import Cubical.Foundations.Everything renaming (_⁻¹ to _⁻¹ᵖ; assoc to ∙-assoc)
open import Cubical.Relation.Nullary.Base renaming (¬_ to ¬ᵗ_)-- ¬ᵗ_
open import Cubical.Relation.Binary.Base
open import Cubical.Data.Sum.Base renaming (_⊎_ to infixr 4 _⊎_)
open import Cub... |
{-# OPTIONS --without-K --safe #-}
module Math.NumberTheory.Summation.Nat.Properties where
-- agda-stdlib
open import Algebra
import Algebra.Operations.CommutativeMonoid as CommutativeMonoidOperations
open import Data.Nat
open import Data.Nat.Properties
open import Data.Nat.Solver
open import Relation.Binary.Proposit... |
-- Andreas, 2013-02-21, example by Andres Sicard Ramirez
module Issue782 where
open import Common.Prelude renaming (zero toz; suc tos; Nat toℕ)
f : ℕ → ℕ
f z = z
f (s n) = z
|
------------------------------------------------------------------------------
-- Proving properties without using pattern matching on refl
------------------------------------------------------------------------------
{-# OPTIONS --no-pattern-matching #-}
{-# OPTIONS --exact-split #-}
{-# OPTIONS --... |
{-# OPTIONS --without-K --exact-split --safe #-}
open import Fragment.Algebra.Signature
module Fragment.Algebra.Properties where
open import Fragment.Algebra.Algebra
open import Fragment.Algebra.Free
open import Level using (Level)
open import Data.Nat using (ℕ)
open import Data.Vec using (Vec; []; _∷_)
private
... |
{-# OPTIONS --type-in-type #-}
{-# OPTIONS --no-termination-check #-}
-- In this post we'll consider how to define and generalize fixed-point combinators for families of
-- mutually recursive functions. Both in the lazy and strict settings.
module FixN where
open import Function
open import Relation.Binary.P... |
module Basic.Compiler.CorrectTo where
open import Data.List
open import Relation.Binary.PropositionalEquality
open import Basic.Compiler.Code
open import Basic.AST
open import Basic.BigStep
open import Utils.Decidable
{-
Lemma 3.21
One half of the correctness proof for the compiler.
The proof here is a bit neate... |
-- Paths in a graph
{-# OPTIONS --safe #-}
module Cubical.Data.Graph.Path where
open import Cubical.Data.Graph.Base
open import Cubical.Data.List.Base hiding (_++_)
open import Cubical.Data.Nat.Base
open import Cubical.Data.Nat.Properties
open import Cubical.Data.Sigma.Base hiding (Path)
open import Cubical.Foundatio... |
{-# OPTIONS --without-K --rewriting #-}
open import lib.Base
open import lib.PathGroupoid
open import lib.PathFunctor
open import lib.path-seq.Concat
open import lib.path-seq.Reasoning
module lib.path-seq.Inversion {i} {A : Type i} where
seq-! : {a a' : A} → a =-= a' → a' =-= a
seq-! [] = []
seq-! (p ◃∙ s) = seq-! s... |
module Avionics.List where
open import Data.Bool using (Bool; true; false; T)
open import Data.List as List using (List; []; _∷_; any)
open import Data.List.Relation.Unary.Any using (Any; here; there)
open import Function using (_∘_)
open import Relation.Binary.PropositionalEquality using (_≡_; inspect; [_]; refl)
op... |
------------------------------------------------------------------------
-- The Agda standard library
--
-- The Either type which calls out to Haskell via the FFI
------------------------------------------------------------------------
{-# OPTIONS --without-K #-}
module Foreign.Haskell.Either where
open import Level... |
{-# OPTIONS --without-K --safe #-}
-- Definition of Monoidal Category
-- Big design decision that differs from the previous version:
-- Do not go through "Functor.Power" to encode variables and work
-- at the level of NaturalIsomorphisms, instead work at the object/morphism
-- level, via the more direct _⊗₀_ _⊗₁_ _⊗-... |
module TicketServer where
open import IO using (run; putStrLn; mapM′; _>>_)
open import Coinduction using (♯_)
open import Data.Nat as ℕ using (ℕ; suc; zero)
open import Data.Pos as ℕ⁺ using (ℕ⁺; suc; NumberPos)
open import Data.String using (String)
open import Data.List using (List; []; _∷_; map)
open import Data.Co... |
postulate
A : Set
F : (A : Set₁) → (A → A → Set) → Set
syntax F A (λ x y → B) = y , y ⟨ A ∼ B ⟩ x
|
module Cats.Category.Slice where
open import Data.Product using (_,_ ; proj₁ ; proj₂)
open import Level
open import Relation.Binary using (IsEquivalence ; _Preserves₂_⟶_⟶_)
open import Cats.Category
module _ {lo la l≈} (C : Category lo la l≈) (X : Category.Obj C) where
infixr 9 _∘_
infixr 4 _≈_
private
... |
-- An Agda implementation of the n queens program from the nofib
-- benchmark. Very inefficient, uses unary natural numbers instead of
-- machine integers.
module N-queens where
open import Category.Monad
open import Coinduction
open import Data.Bool hiding (_≟_)
open import Data.Char hiding (_≟_)
open import Data.Fi... |
------------------------------------------------------------------------
-- Logical equivalences
------------------------------------------------------------------------
{-# OPTIONS --without-K --safe #-}
module Logical-equivalence where
open import Prelude as P hiding (id) renaming (_∘_ to _⊚_)
private
variable
... |
{-# OPTIONS --without-K --rewriting #-}
open import lib.Basics
open import lib.NType2
open import lib.types.TLevel
open import lib.types.Sigma
open import lib.types.Pi
module lib.types.Groupoid where
record GroupoidStructure {i j} {El : Type i} (Arr : El → El → Type j)
(_ : ∀ x y → has-level 0 (Arr x y)) : Type (l... |
-- Andreas, 2017-01-05, issue #2376 reporte by gallais
-- Termination checker should eta-expand clauses to see more.
-- This may have a slight performance penalty when computing call matrices,
-- but not too big, as they are sparse.
open import Agda.Builtin.Nat
-- Arity ~ 300, still does not kill termination checker... |
{-# OPTIONS --without-K --rewriting #-}
module Generalize where
data _≡_ {ℓ}{A : Set ℓ} (x : A) : A → Set ℓ where
refl : x ≡ x
infix 4 _≡_
{-# BUILTIN REWRITE _≡_ #-}
------------------------------------------------------------------
postulate Con : Set
postulate Ty : (Γ : Con... |
-- Andreas, 2020-05-18, issue #3933
--
-- Duplicate imports of the same modules should be cumulative,
-- rather than overwriting the previous scope.
{-# OPTIONS -v scope.import:10 #-}
{-# OPTIONS -v scope:clash:20 #-}
open import Agda.Builtin.Nat using ()
Nat = Agda.Builtin.Nat.Nat
zero = Agda.Builtin.Nat.zero
imp... |
{-# OPTIONS --without-K --safe #-}
module Cats.Category.Setoids.Facts where
open import Cats.Category.Setoids.Facts.Exponential public using
(hasExponentials)
open import Cats.Category.Setoids.Facts.Initial public using
(hasInitial)
open import Cats.Category.Setoids.Facts.Limit public using
(complete)
open impo... |
------------------------------------------------------------------------
-- The Agda standard library
--
-- This module is DEPRECATED. Please use Data.List.Relation.Unary.Any
-- directly.
------------------------------------------------------------------------
{-# OPTIONS --without-K --safe #-}
module Data.List.Any w... |
{- Byzantine Fault Tolerant Consensus Verification in Agda, version 0.9.
Copyright (c) 2020, 2021, Oracle and/or its affiliates.
Licensed under the Universal Permissive License v 1.0 as shown at https://opensource.oracle.com/licenses/upl
-}
open import Optics.All
open import LibraBFT.Prelude
open import LibraBFT... |
module Oscar.Data.Fin where
open import Data.Fin public using (Fin; zero; suc)
-- open import Oscar.Data.Fin.Core public
-- --open import Data.Fin hiding (thin; thick; check) public
-- --open import Data.Fin.Properties hiding (thin-injective; thick-thin; thin-check-id) public
-- -- module _ where
-- -- open imp... |
{-# OPTIONS --without-K --rewriting #-}
open import lib.Base
open import lib.PathGroupoid
{-
This file contains various basic definitions and lemmas about functions
(non-dependent [Pi] types) that do not belong anywhere else.
-}
module lib.Function where
{- Basic lemmas about pointed maps -}
-- concatenation
⊙∘-pt... |
{-# OPTIONS --without-K --exact-split --rewriting #-}
open import lib.Basics
open import lib.types.Bool
module Graphs.Definition where
{- A graph consists of types of Edges and Vertices together with two endpoint maps. We
often just talk about the types and the endpoint maps are clear from the context
(i.e. de... |
{-# OPTIONS --cubical --safe #-}
module Algebra.Construct.Free.Semilattice.Relation.Unary.All.Def where
open import Prelude hiding (⊥; ⊤)
open import Algebra.Construct.Free.Semilattice.Eliminators
open import Algebra.Construct.Free.Semilattice.Definition
open import Cubical.Foundations.HLevels
open import Data.Empty.... |
{-# OPTIONS --without-K --safe #-}
open import Categories.Category
module Categories.Category.Duality {o ℓ e} (C : Category o ℓ e) where
open import Relation.Binary.PropositionalEquality using (_≡_; refl)
open import Categories.Category.Cartesian
open import Categories.Category.Cocartesian
open import Categories.Ca... |
{-# OPTIONS --cubical --allow-unsolved-metas #-}
open import Agda.Builtin.Cubical.Path
open import Agda.Builtin.Nat
pred : Nat → Nat
pred (suc n) = n
pred zero = zero
data [0-1] : Set where
𝟎 𝟏 : [0-1]
int : 𝟎 ≡ 𝟏
-- The following holes can be filled, so they should not cause a
-- typechecking failure.
0=x... |
-- This test case seems to be due to Andreas Abel, Andrea Vezzosi and
-- NAD. The code below should be rejected.
open import Agda.Builtin.Size
data SizeLt (i : Size) : Set where
size : (j : Size< i) → SizeLt i
-- Legal again in 2.5.1
getSize : ∀{i} → SizeLt i → Size
getSize (size j) = j
-- Structurally inductive ... |
module hello-world where
open import Agda.Builtin.IO using (IO)
open import Agda.Builtin.Unit using (⊤)
open import Agda.Builtin.String using (String)
postulate putStrLn : String → IO ⊤
{-# FOREIGN GHC import qualified Data.Text as T #-}
{-# COMPILE GHC putStrLn = putStrLn . T.unpack #-}
main : IO ⊤
main = putStrLn ... |
module Bush where
data Nat : Set where
zero : Nat
suc : Nat -> Nat
{-# BUILTIN NATURAL Nat #-}
_+_ : Nat -> Nat -> Nat
zero + m = m
suc n + m = suc (n + m)
_^_ : (Set -> Set) -> Nat -> Set -> Set
(F ^ zero) A = A
(F ^ suc n) A = F ((F ^ n) A)
data Bush (A : Set) : Set where
leaf : Bush A
node : A -> (B... |
module nodcap.NF.Contract where
open import Function using (_$_)
open import Data.Nat as ℕ using (ℕ; suc; zero)
open import Data.Pos as ℕ⁺
open import Data.List as L using (List; []; _∷_; _++_)
open import Data.Environment
open import nodcap.Base
open import nodcap.NF.Typing
-- Lemma:
-- We can contract n repetiti... |
module SizedIO.Base where
open import Data.Maybe.Base
open import Data.Sum renaming (inj₁ to left; inj₂ to right; [_,_]′ to either)
open import Function
--open import Level using (_⊔_) renaming (suc to lsuc)
open import Size
open import Data.List
open import SizedIO.Object
open import NativeIO
open import Data.Prod... |
------------------------------------------------------------------------
-- Results relating different instances of certain axioms related to
-- equality
------------------------------------------------------------------------
{-# OPTIONS --without-K --safe #-}
module Equality.Instances-related where
import Bijectio... |
module index where
-- natural numbers
--- additions
import Nats.Add.Assoc
using (nat-add-assoc) -- associative law
import Nats.Add.Comm
using (nat-add-comm) -- commutative law
import Nats.Add.Invert
using (nat-add-invert) -- a + a == b + b implies a == b
using (nat-add-invert-1) -- a + 1 == b + 1 implies a == ... |
module sk where
open import nat
data comb : Set where
S : comb
K : comb
app : comb → comb → comb
data _↝_ : comb → comb → Set where
↝K : (a b : comb) → (app (app K a) b) ↝ a
↝S : (a b c : comb) → (app (app (app S a) b) c) ↝ (app (app a c) (app b c))
↝Cong1 : {a a' : comb} (b : comb) → a ↝ a' → (app a b) ... |
{-# OPTIONS --exact-split #-}
module ExactSplitBerry where
data Bool : Set where
true false : Bool
maj : Bool → Bool → Bool → Bool
maj true true true = true
maj x true false = x
maj false y true = y
maj true false z = z
maj false false false = false
|
-- 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: ???
{-# OPTIONS --allow-exec #-}
open import Vehicle
open import Vehicle.Data.Tensor
open import Data.Product
open import Data.I... |
------------------------------------------------------------------------
-- The Agda standard library
--
-- Properties related to propositional list membership
------------------------------------------------------------------------
{-# OPTIONS --without-K --safe #-}
module Data.List.Membership.Propositional.Properti... |
------------------------------------------------------------------------
-- The derivative operator does not introduce any unneeded ambiguity
------------------------------------------------------------------------
module TotalParserCombinators.Derivative.LeftInverse where
open import Codata.Musical.Notation
open imp... |
-- 'Set' is no longer a keyword but a primitive defined in
-- 'Agda.Primitive'. It is imported by default but this can be
-- disabled with a flag:
{-# OPTIONS --no-import-sorts #-}
-- By importing Agda.Primitive explicitly we can rename 'Set' to
-- something else:
open import Agda.Primitive renaming (Set to Type)
--... |
-- {-# OPTIONS -v tc.conv:30 -v tc.conv.level:60 -v tc.meta.assign:15 #-}
module UniversePolymorphism where
open import Common.Level renaming (_⊔_ to max)
data Nat : Set where
zero : Nat
suc : Nat → Nat
infixr 40 _∷_
data Vec {i}(A : Set i) : Nat → Set i where
[] : Vec {i} A zero
_∷_ : ∀ {n} → A → Vec {i... |
open import Agda.Builtin.Nat
data Fin : Nat → Set where
zero : {n : Nat} → Fin (suc n)
suc : {n : Nat} → Fin n → Fin (suc n)
f : Fin 1 → Nat
f zero = 0
|
{-# OPTIONS --safe --warning=error --without-K #-}
open import LogicalFormulae
open import Setoids.Setoids
open import Sets.EquivalenceRelations
open import Agda.Primitive using (Level; lzero; lsuc; _⊔_)
open import Numbers.Naturals.Semiring
open import Numbers.Integers.Integers
open import Groups.Definition
module G... |
{-# OPTIONS --cubical --no-import-sorts --safe #-}
module Cubical.Data.Prod.Properties where
open import Cubical.Core.Everything
open import Cubical.Data.Prod.Base
open import Cubical.Data.Sigma renaming (_×_ to _×Σ_) hiding (prodIso ; toProdIso ; curryIso)
open import Cubical.Foundations.Prelude
open import Cubical... |
------------------------------------------------------------------------
-- Linearisation of mixfix operators
------------------------------------------------------------------------
open import Mixfix.Expr
open import Mixfix.Acyclic.PrecedenceGraph
using (acyclic; precedence)
module Mixfix.Acyclic.Show
(g... |
{-# OPTIONS --no-termination-check
#-}
------------------------------------------------------------------------
-- A library of parser combinators
------------------------------------------------------------------------
module Parallel.Lib where
open import Utilities
open import Parallel
open import Parallel.Index... |
-- Andreas, 2014-01-07 Issue reported by Dmitriy Traytel
{-# OPTIONS --copatterns #-}
module _ where
open import Common.Size
open import Common.Prelude hiding (map)
record Stream (A : Set) : Set where
coinductive
field
head : A
tail : Stream A
open Stream
-- This type should be empty.
data D : (i : Siz... |
{-# OPTIONS --instance-search-depth=5 --show-implicit #-}
open import Oscar.Prelude
open import Oscar.Class.Smap
open import Oscar.Class.Surjextensionality
open import Oscar.Class.Symmetry
open import Oscar.Class.Transitivity
open import Oscar.Data.Proposequality
open import Oscar.Data.Surjcollation
import Oscar.Class... |
module Ex3 where -- Conor: 5.5/15 (marked in sem 1 for 3.1-3.4)
-- really 5.5/7 then another 3/8 in sem 2, giving 8.5/15
----------------------------------------------------------------------------
-- EXERCISE 3 -- MONADS FOR HUTTON'S RAZOR
--
-- VALUE: 15%
-- DEADLINE: 5pm, Friday 20 November ... |
module bool-test where
open import bool
open import eq
open import level
~~tt : ~ ~ tt ≡ tt
~~tt = refl
~~ff : ~ ~ ff ≡ ff
~~ff = refl
~~-elim2 : ∀ (b : 𝔹) → ~ ~ b ≡ b
~~-elim2 tt = ~~tt
~~-elim2 ff = ~~ff
~~tt' : ~ ~ tt ≡ tt
~~tt' = refl{lzero}{𝔹}{tt}
~~ff' : ~ ~ ff ≡ ff
~~ff' = refl{lzero}{𝔹}{ff}
test1 : 𝔹... |
import Level as L
open import Relation.Nullary
open import Relation.Binary
open import Relation.Binary.PropositionalEquality
open import Data.Product
open import Data.Empty
open import Data.Nat
open import Data.Nat.Properties
open import RevMachine
module PartialRevNoRepeat {ℓ} (M : PartialRevMachine {ℓ}) where
infi... |
module lob--2015-06-14--III where
data ℕ : Set where
zero : ℕ
suc : ℕ → ℕ
{-# BUILTIN NATURAL ℕ #-}
record Σ {X : Set} (F : X → Set) : Set where
constructor _,_
field fst : X
snd : F fst
data ⊤ : Set where
unit : ⊤
data Tree (X : Set) : Set where
br : Tree X → Tree X → Tree X
leaf : X →... |
-- A solution for
-- https://github.com/josevalim/nested-data-structure-traversal
-- in Agda using fold. Basically it is identical to its Haskell sibling except
-- fancy unicode symbols. The `refl` proof at the end is pretty nice though.
--
-- Coded against agda-2.6.1.3 and agda-stdlib-1.5
module Fold where
open... |
{-# OPTIONS --without-K --safe #-}
open import Definition.Typed.EqualityRelation
module Definition.LogicalRelation.Irrelevance {{eqrel : EqRelSet}} where
open EqRelSet {{...}}
open import Definition.Untyped
open import Definition.Typed
open import Definition.Typed.Properties
open import Definition.LogicalRelation
op... |
{-# OPTIONS --copatterns #-}
{-# OPTIONS --allow-unsolved-metas #-}
-- {-# OPTIONS --show-implicit #-}
-- One-place functors (decorations) on Set
module Control.Decoration where
open import Data.Product using (_×_; _,_; proj₁; proj₂; uncurry)
open import Function using (id; _∘_; const)
open import Relation.Binary.Pr... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.