text stringlengths 4 690k |
|---|
module plfa-exercises.part1.Decidable where
import Relation.Binary.PropositionalEquality as Eq
open Eq using (_≡_; refl; sym; cong)
open Eq.≡-Reasoning
open import Data.Nat using (ℕ; zero; suc; pred)
open import Data.Product using (_×_) renaming (_,_ to ⟨_,_⟩)
open import Data.Sum using (_⊎_; inj₁; inj₂)
open import R... |
-- Andreas, 2014-08-28, reported by Jacques Carette
{-# OPTIONS --cubical-compatible #-}
-- {-# OPTIONS -v term:20 #-}
module _ where
data Bool : Set where true false : Bool
data List (A : Set) : Set where
[] : List A
_∷_ : A → List A → List A
module Sort (A : Set) ( _≤_ : A → A → Bool) where
insert : A →... |
data _≡_ {ℓ}{A : Set ℓ} (x : A) : A → Set ℓ where
refl : x ≡ x
record Box (B : Set) : Set₁ where
constructor box
field
unbox : B
open Box public
=box :{B : Set}{Γ₀ Γ₁ : Box B} → _≡_ {A = B} (unbox Γ₀) (unbox Γ₁) → Γ₀ ≡ Γ₁
=box {b} {box unbox} {box .unbox} refl = ?
-- WAS: internal error at src/full/Agda... |
module _ where
open import Agda.Builtin.Nat hiding (_+_)
import Agda.Builtin.Nat as N
open import Agda.Builtin.TrustMe
open import Agda.Builtin.Equality
open import Agda.Builtin.Sigma
data ⊥ : Set where
module SimplifiedTestCase where
record Fin : Set where
constructor mkFin
field m .p : Nat
module _ ... |
{-
This second-order term syntax was created from the following second-order syntax description:
syntax UTLC | Λ
type
* : 0-ary
term
app : * * -> * | _$_ l20
lam : *.* -> * | ƛ_ r10
theory
(ƛβ) b : *.* a : * |> app (lam (x.b[x]), a) = b[a]
(ƛη) f : * |> lam (x.app (f, x)) = f
(lβ) b ... |
{-# OPTIONS --without-K --safe #-}
open import Definition.Typed.EqualityRelation
module Definition.LogicalRelation.Properties.Reduction {{eqrel : EqRelSet}} where
open EqRelSet {{...}}
open import Definition.Typed
open import Definition.Typed.Properties
import Definition.Typed.Weakening as Wk
open import Definition.... |
------------------------------------------------------------------------
-- Call-by-value (CBV) reduction in Fω with interval kinds.
------------------------------------------------------------------------
{-# OPTIONS --safe --without-K #-}
module FOmegaInt.Reduction.Cbv where
open import Data.Fin.Substitution
open ... |
module int-tests where
open import int
open import eq
open import product
three : ℤ
three = , next next unit{pos}
-two : ℤ
-two = , next unit{neg}
one = -two +ℤ three
one-lem : one ≡ ,_ { a = nonzero pos } unit
one-lem = refl
six = three +ℤ three
-four = -two +ℤ -two
|
module Luau.Heap where
open import Agda.Builtin.Equality using (_≡_)
open import FFI.Data.Maybe using (Maybe; just)
open import FFI.Data.Vector using (Vector; length; snoc; empty)
open import Luau.Addr using (Addr)
open import Luau.Var using (Var)
open import Luau.Syntax using (Block; Expr; Annotated; FunDec; nil; add... |
open import Functional hiding (Domain)
import Structure.Logic.Classical.NaturalDeduction
import Structure.Logic.Classical.SetTheory.ZFC
module Structure.Logic.Classical.SetTheory.ZFC.BinaryRelatorSet {ℓₗ} {Formula} {ℓₘₗ} {Proof} {ℓₒ} {Domain} ⦃ classicLogic : _ ⦄ (_∈_ : Domain → Domain → Formula) ⦃ signature... |
open import Data.Bool using ( Bool ; true ; false ; _∧_ )
open import Data.Product using ( _×_ )
open import Relation.Binary.PropositionalEquality using ( _≡_ )
open import Relation.Unary using ( _∈_ )
open import Web.Semantic.DL.Concept using
( Concept ; ⟨_⟩ ; ¬⟨_⟩ ; ⊤ ; ⊥ ; _⊓_ ; _⊔_ ; ∀[_]_ ; ∃⟨_⟩_ ; ≤1 ; >1 )
ope... |
-- Jesper, 2018-05-17: Fixed internal error. Now the second clause is
-- marked as unreachable (which is perhaps reasonable) and the first
-- clause is marked as not satisfying --exact-split (which is perhaps
-- unreasonable). To fix this properly, we would need to keep track of
-- excluded literals for not just patte... |
------------------------------------------------------------------------------
-- We only translate first-order definitions
------------------------------------------------------------------------------
{-# OPTIONS --exact-split #-}
{-# OPTIONS --no-sized-types #-}
{-# OPTIONS --no-universe-poly... |
------------------------------------------------------------------------
-- The Agda standard library
--
-- "Finite" sets indexed on coinductive "natural" numbers
------------------------------------------------------------------------
{-# OPTIONS --without-K --safe --sized-types #-}
module Codata.Cofin where
open i... |
-- Andreas, 2016-11-02, issue #2290
postulate
A : Set
a : A
F : Set → Set
mutual
data D : A → _ where
FDa = F (D a)
-- ERROR WAS:
-- The sort of D cannot depend on its indices in the type A → Set _7
-- Should pass.
mutual
data E : (x : A) → _ where
FEa = F (E a)
|
open import Agda.Primitive using (_⊔_)
-- Set being type of all types (which is infinitely nested as Set₀ Set₁ etc
postulate
String : Set
{-# BUILTIN STRING String #-}
data bool : Set where
tt : bool
ff : bool
ex₀ : bool → String
ex₀ tt = "true"
ex₀ ff = "false"
-- parameterization over all "Sets"
-- other... |
{-# OPTIONS --without-K --rewriting #-}
open import HoTT
open import groups.Cokernel
open import groups.Image
import homotopy.ConstantToSetExtendsToProp as ConstExt
-- A collection of useful lemmas about exactness
module groups.Exactness where
module Exact {i j k} {G : Group i} {H : Group j} {K : Group k}
{φ : G ... |
module Extensions.VecFirst where
open import Data.Vec
open import Data.Product
open import Level
open import Relation.Nullary
open import Function using (_∘_; _$_)
-- proof that an element is the first in a vector to satisfy the predicate B
data First {a b} {A : Set a} (B : A → Set b) : ∀ {n} (x : A) → Vec A n → Set ... |
{-# OPTIONS --without-K #-}
module function.core where
open import level
-- copied from Agda's standard library
infixr 9 _∘'_
infixr 0 _$_
_∘'_ : ∀ {a b c}
{A : Set a} {B : A → Set b} {C : {x : A} → B x → Set c} →
(∀ {x} (y : B x) → C y) → (g : (x : A) → B x) →
((x : A) → C (g x))
f ∘' g = λ x → f... |
module _ where
record Semiring (A : Set) : Set where
infixl 6 _+_
field _+_ : A → A → A
open Semiring {{...}} public
infix 4 _≡_
postulate
Ord : Set → Set
Nat Bool : Set
zero : Nat
_≡_ : Nat → Nat → Set
refl : ∀ {x} → x ≡ x
to : ∀ {x} y → x ≡ y
trans : {x y z : Nat} → x ≡ y → y ≡ z → x ≡ ... |
module Itse.Checking where
open import Itse.Grammar
open import Relation.Nullary
open import Relation.Binary.PropositionalEquality
open import Data.Unit
open import Data.Bool
open import Data.List hiding (lookup)
open import Data.Product
open import Data.Maybe
{-
# Checking
-}
{-
## Context
-}
data Context : Set
... |
-- Andreas, 2016-01-22, issue 1790
-- Projections should be highlighted as such everywhere,
-- even in the parts of a record declaration that
-- make the record constructor type.
record Σ A (B : A → Set) : Set where
field
fst : A
snd : B fst -- fst should be highlighted as projection here
-- Should also wo... |
{-# OPTIONS --cubical --safe #-}
module Data.Tuple.Base where
open import Prelude hiding (⊤; tt)
open import Data.Unit.UniversePolymorphic
open import Data.Fin
Tuple : ∀ n → (Lift a (Fin n) → Type b) → Type b
Tuple zero f = ⊤
Tuple {a = a} {b = b} (suc n) f = f (lift f0) × Tuple {a = a} {b = b} n (f ∘ lift ∘ fs ∘... |
import Issue2217.M
{-# TERMINATING #-}
A : Set
A = ?
a : A
a = ?
|
{-# OPTIONS --without-K #-}
open import HoTT
module cohomology.WithCoefficients where
→Ω-group-structure : ∀ {i j} (X : Ptd i) (Y : Ptd j)
→ GroupStructure (fst (X ⊙→ ⊙Ω Y))
→Ω-group-structure X Y = record {
ident = ⊙cst;
inv = λ F → ((! ∘ fst F) , ap ! (snd F));
comp = λ F G → ⊙conc ⊙∘ ⊙×-in F G;
unitl = ... |
------------------------------------------------------------------------
-- The Agda standard library
--
-- Support for reflection
------------------------------------------------------------------------
{-# OPTIONS --with-K #-}
module Reflection where
open import Data.Unit.Base using (⊤)
open import Data.Bool.Base ... |
{-# OPTIONS --cubical --safe #-}
module Data.Empty.UniversePolymorphic where
open import Prelude hiding (⊥)
import Data.Empty as Monomorphic
data ⊥ {ℓ} : Type ℓ where
Poly⊥⇔Mono⊥ : ∀ {ℓ} → ⊥ {ℓ} ⇔ Monomorphic.⊥
Poly⊥⇔Mono⊥ .fun ()
Poly⊥⇔Mono⊥ .inv ()
Poly⊥⇔Mono⊥ .leftInv ()
Poly⊥⇔Mono⊥ .rightInv ()
|
module Cats.Util.Reflection where
open import Reflection public
open import Data.List using ([])
open import Data.Unit using (⊤)
open import Function using (_∘_)
open import Level using (zero ; Lift)
open import Cats.Util.Monad using (RawMonad ; _>>=_ ; _>>_ ; return ; mapM′)
instance
tcMonad : ∀ {l} → RawMonad ... |
{-# OPTIONS --cubical --safe --postfix-projections #-}
module Demos.Binary where
open import Data.Nat
open import Testers
open import Prelude
infixl 5 _1𝕓 _2𝕓
data 𝔹 : Type where
0𝕓 : 𝔹
_1𝕓 : 𝔹 → 𝔹
_2𝕓 : 𝔹 → 𝔹
⟦_⇓⟧ : 𝔹 → ℕ
⟦ 0𝕓 ⇓⟧ = 0
⟦ n 1𝕓 ⇓⟧ = 1 + ⟦ n ⇓⟧ * 2
⟦ n 2𝕓 ⇓⟧ = 2 + ⟦ n ⇓⟧ * 2
inc ... |
-- This contains material which used to be in the Sane module, but is no
-- longer used. It is not junk, so it is kept here, as we may need to
-- resurrect it.
module Obsolete where
import Data.Fin as F
--
open import Data.Empty
open import Data.Unit
open import Data.Unit.Core
open import Data.Nat renaming (_⊔_ to _... |
{-# OPTIONS --without-K --safe #-}
module Math.NumberTheory.Summation.Nat.Properties.Lemma where
-- agda-stdlib
open import Data.Nat
open import Data.Nat.Properties
open import Data.Nat.Solver
open import Relation.Binary.PropositionalEquality
open import Function.Base
lemma₁ : ∀ n → n * (1 + n) * (1 + 2 * n) + 6 * (... |
open import Nat
open import Prelude
open import dynamics-core
open import contexts
open import htype-decidable
open import lemmas-matching
open import lemmas-consistency
open import disjointness
open import typed-elaboration
module elaborability where
mutual
elaborability-synth : {Γ : tctx} {e : hexp} {τ ... |
module DFA where
open import Level
open import Data.Unit
open import Data.List using (List; []; _∷_)
open import Data.Bool using (Bool; true; false; _∧_; _∨_; T; not)
open import Function
open import Relation.Nullary using (Dec; yes; no; ¬_)
open import Relation.Nullary.Negation using (contradiction)
open import Relat... |
{-# OPTIONS --safe --no-qualified-instances #-}
module CF.Transform.Compile.Expressions where
open import Function using (_∘_)
open import Level
open import Data.Unit
open import Data.Bool
open import Data.Product as P
open import Data.List as L hiding (null; [_])
open import Data.List.Membership.Propositional
open im... |
module _ where
record _×_ (A B : Set) : Set where
field
fst : A
snd : B
open _×_
partial : ∀ {A B} → A → A × B
partial x .fst = x
open import Agda.Builtin.Equality
theorem : ∀ {A} (x : A) → partial x .snd ≡ x
theorem x = refl
|
{-# OPTIONS --without-K --safe #-}
open import Categories.Category.Core using (Category)
open import Categories.Monad using (Monad)
module Categories.Adjoint.Construction.Kleisli {o ℓ e} {C : Category o ℓ e} (M : Monad C) where
open import Categories.Category.Construction.Kleisli using (Kleisli)
open import Categori... |
module TrailingImplicits where
-- see also https://lists.chalmers.se/pipermail/agda-dev/2015-January/000041.html
open import Common.IO
open import Common.Unit
open import Common.Nat
f : (m : Nat) {l : Nat} -> Nat
f zero {l = l} = l
f (suc y) = y
main : IO Unit
main = printNat (f 0 {1}) ,,
putStr "\n" ,,
printNa... |
open import Prelude
open import Level using (Level; _⊔_; Lift) renaming (zero to lz; suc to ls)
open import Data.Maybe using (Maybe; nothing; just)
module RW.Utils.Monads where
---------------------
-- Monad Typeclass --
---------------------
record Monad {a}(M : Set a → Set a) : Set (ls a) where
infixl ... |
module FStream.FVec where
------------------------------------------------------------------------
-- Dissecting effectful streams
------------------------------------------------------------------------
open import Library
open import FStream.Core
open import Data.Fin
infixr 5 _▻_
infix 6 ⟨_▻⋯
infix 7 _⟩
data FVec... |
------------------------------------------------------------------------
-- The Agda standard library
--
-- Integers
------------------------------------------------------------------------
{-# OPTIONS --without-K --safe #-}
module Data.Integer where
import Data.Nat.Show as ℕ
open import Data.Sign as Sign using (Sig... |
{-# OPTIONS --warning=error --safe --without-K #-}
open import LogicalFormulae
open import Lists.Lists
open import Numbers.Naturals.Semiring
open import Numbers.Naturals.Naturals
open import Numbers.Naturals.Order
open import Numbers.BinaryNaturals.Definition
open import Semirings.Definition
open import Orders.Total.D... |
{-# OPTIONS --without-K --safe #-}
open import Level
open import Data.Quiver using (Quiver)
-- The Category of (free) paths over a Quiver
module Categories.Category.Construction.PathCategory {o ℓ e} (G : Quiver o ℓ e) where
open import Function.Base using (_$_)
open import Relation.Binary.Construct.Closure.Reflexive... |
-- Andreas, 2019-02-03, issue #3541:
-- Treat indices like parameters in positivity check.
data Works (A : Set) : Set where
nest : Works (Works A) → Works A
data Foo : Set → Set where
foo : ∀{A} → Foo (Foo A) → Foo A
-- Should pass.
|
{-# OPTIONS --without-K --safe #-}
open import Categories.Category.Core
open import Categories.Object.Terminal hiding (up-to-iso)
module Categories.Object.NaturalNumber {o ℓ e} (𝒞 : Category o ℓ e) (𝒞-Terminal : Terminal 𝒞) where
open import Level
open import Categories.Morphism 𝒞
open import Categories.Morphis... |
-- A Beth model of normal forms
open import Library
module NfModelCaseTreeConv (Base : Set) where
import Formulas ; open module Form = Formulas Base
import Derivations; open module Der = Derivations Base
-- Beth model
data Cover (P : Cxt → Set) (Γ : Cxt) : Set where
returnC : (p : P Γ) → Cover P Γ
falseC... |
------------------------------------------------------------------------
-- Compatibility lemmas
------------------------------------------------------------------------
open import Atom
module Compatibility (atoms : χ-atoms) where
open import Bag-equivalence hiding (trans)
open import Equality.Propositional
open im... |
{- Byzantine Fault Tolerant Consensus Verification in Agda, version 0.9.
Copyright (c) 2020 Oracle and/or its affiliates.
Licensed under the Universal Permissive License v 1.0 as shown at https://opensource.oracle.com/licenses/upl
-}
{-# OPTIONS --allow-unsolved-metas #-}
open import Optics.All
open import Libra... |
{-# OPTIONS --without-K --safe #-}
open import Categories.Category
module Categories.Morphism.Properties {o ℓ e} (𝒞 : Category o ℓ e) where
open import Data.Product using (_,_; _×_)
open Category 𝒞
open HomReasoning
import Categories.Morphism as M
open M 𝒞
open import Categories.Morphism.Reasoning 𝒞
private
... |
-- Andreas, 2016-07-26, issue 2215, reported by effectfully
data Term : Set where
abs : Term → Term
Type = Term
f : Type → Term
f (abs b@(abs _)) = b
-- WAS: Panic: Pattern match failure in AsPatterns.conPattern
-- due to a missing reduce
-- Should work.
|
-- Andreas, 2016-10-01, issue #2231
-- The termination checker should not always see through abstract definitions.
abstract
data Nat : Set where
zero' : Nat
suc' : Nat → Nat
-- abstract hides constructor nature of zero and suc.
zero = zero'
suc = suc'
data D : Nat → Set where
c1 : ∀ n → D n → D (... |
{-# OPTIONS --without-K --rewriting #-}
open import HoTT
open import homotopy.Bouquet
open import homotopy.FinWedge
open import cohomology.Theory
module cohomology.SubFinBouquet (OT : OrdinaryTheory lzero) where
open OrdinaryTheory OT
open import cohomology.Sphere OT
open import cohomology.SubFinWedge cohomology-the... |
open import FRP.LTL.RSet.Core using ( RSet )
open import FRP.LTL.Time using ( _+_ )
module FRP.LTL.RSet.Next where
○ : RSet → RSet
○ A t = A (t + 1)
|
module Issue1436-2 where
module A where
infixl 19 _↑_
infixl 1 _↓_
data D : Set where
● : D
_↓_ _↑_ : D → D → D
module B where
infix -1000000 _↓_
data D : Set where
_↓_ : D → D → D
open A
open B
rejected = ● ↑ ● ↓ ● ↑ ● ↓ ● ↑ ●
|
-- Andreas, 2017-05-17, issue #2574 reported by G. Allais
-- This file is intentionally without module header.
private
postulate A : Set
|
open import Prelude
open import Nat
open import Agda.Primitive using (Level; lzero; lsuc) renaming (_⊔_ to lmax)
module List where
-- definitions
data List (A : Set) : Set where
[] : List A
_::_ : A → List A → List A
_++_ : {A : Set} → List A → List A → List A
[] ++ l₂ = l₂
(h :: l₁) ++ l₂ = h :: ... |
{-# OPTIONS --without-K #-}
open import HoTT
module homotopy.3x3.PushoutPushout where
-- Numbering is in row/column form
-- A span^2 is a 5 × 5 table (numbered from 0 to 4) where
-- * the even/even cells are types
-- * the odd/even and even/odd cells are functions
-- * the odd/odd cells are equalities between functi... |
{-# OPTIONS --without-K --safe #-}
-- This module packages up all the stuff that's passed to the other
-- modules in a convenient form.
module Polynomial.Parameters where
open import Function
open import Algebra
open import Relation.Unary
open import Level
open import Algebra.Solver.Ring.AlmostCommutativeRing
open im... |
module Prelude.Erased where
data [erased]-is-only-for-printing : Set where
[erased] : [erased]-is-only-for-printing
|
module Common.ContextPair where
open import Common.Context public
-- Context pairs.
infix 4 _⁏_
record Cx² (U V : Set) : Set where
constructor _⁏_
field
int : Cx U
mod : Cx V
open Cx² public
∅² : ∀ {U V} → Cx² U V
∅² = ∅ ⁏ ∅
-- Context inclusion.
module _ {U V : Set} where
infix 3 _⊆²_
_⊆²_ : C... |
{-# OPTIONS --cubical --safe #-}
module Cubical.ZCohomology.S1.S1 where
open import Cubical.ZCohomology.Base
open import Cubical.ZCohomology.Properties
open import Cubical.HITs.S1
open import Cubical.Foundations.Prelude
open import Cubical.Foundations.Isomorphism
open import Cubical.HITs.SetTruncation
open import Cubi... |
-- Generic term traversals
module Syntax.Substitution.Lemmas where
open import Syntax.Types
open import Syntax.Context
open import Syntax.Terms
open import Syntax.Substitution.Kits
open import Syntax.Substitution.Instances
open import Data.Sum
open import Relation.Binary.PropositionalEquality as ≡
using (_≡_ ; r... |
-- Record modules for no-eta records should not be irrelevant in
-- record even if all fields are irrelevant (cc #392).
open import Agda.Builtin.Equality
postulate A : Set
record Unit : Set where
no-eta-equality
postulate a : A
record Irr : Set where
no-eta-equality
field .unit : Unit
postulate a : A
re... |
open import Data.Bool using (Bool; true; false)
open import Data.Float using (Float)
open import Avionics.Maybe using (Maybe; just; nothing; _>>=_; map)
--open import Data.Maybe using (Maybe; just; nothing; _>>=_; map)
open import Data.Nat using (ℕ)
open import Function using (_∘_)
open import Level using (0ℓ; _⊔_) ren... |
-- Andreas, 2018-05-27, issue #3090, reported by anka-213
-- Parser should not raise internal error for invalid symbol in name
{-# BUILTIN NATURAL ( #-}
-- Should fail with a parse error, not internal error
|
--------------------------------------------------------------------------------
-- This file contains functions to convert between agda terms and meta-cedille
-- terms
--------------------------------------------------------------------------------
module Conversion where
open import Class.Monad.Except
open import D... |
{-# OPTIONS --cubical --safe #-}
module Algebra.Construct.Free.Semilattice.Homomorphism where
open import Prelude
open import Algebra
open import Path.Reasoning
open import Algebra.Construct.Free.Semilattice.Definition
open import Algebra.Construct.Free.Semilattice.Eliminators
open import Algebra.Construct.Free.Semi... |
module BTA5 where
open import Data.Nat hiding (_<_)
open import Data.Bool
open import Data.List
open import Data.Nat.Properties
open import Relation.Nullary
-----------------
-- CLEANUP (∈) : this is surely in the standard library
-----------------
-- More general purpose definitions (should also be in standard lib... |
------------------------------------------------------------------------
-- The Agda standard library
--
-- Argument relevance used in the reflection machinery
------------------------------------------------------------------------
{-# OPTIONS --without-K --safe #-}
module Reflection.Argument.Relevance where
open i... |
{-# OPTIONS --without-K --rewriting #-}
open import lib.Base
open import lib.Function
open import lib.Equivalence
open import lib.Univalence
open import lib.NType
open import lib.PathGroupoid
{-
A proof of function extensionality from the univalence axiom.
-}
module lib.Funext {i} {A : Type i} where
-- Naive non de... |
module Lec6Done where
open import Lec1Done
data List (X : Set) : Set where
[] : List X
_,-_ : X -> List X -> List X
infixr 4 _,-_
-- ListF : Set -> Set -> Set
-- ListF X T = One + (X * T)
mkList : {X : Set} -> One + (X * List X) -> List X
mkList (inl <>) = []
mkList (inr (x , xs)) = x ,- xs
foldr : {... |
{-
This file contains:
- Properties of 2-groupoid truncations
-}
{-# OPTIONS --cubical --no-import-sorts --safe #-}
module Cubical.HITs.2GroupoidTruncation.Properties where
open import Cubical.Foundations.Prelude
open import Cubical.Foundations.Function
open import Cubical.Foundations.HLevels
open import Cubical.Fo... |
-- This module introduces parameterised datatypes.
module DataParameterised where
-- First some of our old friends.
data Nat : Set where
zero : Nat
suc : Nat -> Nat
data Bool : Set where
false : Bool
true : Bool
-- A datatype can be parameterised over a telescope, (A : Set) in the case of
-- lists. The ... |
------------------------------------------------------------------------------
-- Testing the translation of scheme's instances
------------------------------------------------------------------------------
{-# OPTIONS --exact-split #-}
{-# OPTIONS --no-sized-types #-}
{-# OPTIONS --no-universe-... |
{-# OPTIONS --without-K --rewriting #-}
module hSet where
open import lib.Basics
open import lib.Funext
open import lib.NType2
open import lib.types.Truncation
open import lib.types.Bool
open import PropT
_is-a-set : {i : ULevel} (A : Type i) → Type i
A is-a-set = is-set A
-- To get an element a... |
{-# 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... |
------------------------------------------------------------------------
-- Convenient syntax for equational reasoning
------------------------------------------------------------------------
-- Example use:
-- n*0≡0 : ∀ n → n * 0 ≡ 0
-- n*0≡0 zero = refl
-- n*0≡0 (suc n) =
-- begin
-- suc n * 0
-- ≈⟨ byDe... |
-- In this document we'll show that having `ifix :: ((k -> *) -> k -> *) -> k -> *` is enough to
-- get `fix :: (k -> k) -> k` for any particular `k`.
module IFixIsEnough where
open import Agda.Primitive
-- First, the definition of `IFix`:
{-# NO_POSITIVITY_CHECK #-}
data IFix {α φ} {A : Set α} (F : (A -> Set φ) ->... |
{-# OPTIONS --cubical --no-import-sorts --safe #-}
module Cubical.Categories.Presheaf.Properties where
open import Cubical.Categories.Category
open import Cubical.Categories.NaturalTransformation
open import Cubical.Categories.Instances.Sets
open import Cubical.Categories.Instances.Functors
open import Cubical.Catego... |
import Lvl
open import Type
module Data.IndexedList {ℓ ℓᵢ} (T : Type{ℓ}) {I : Type{ℓᵢ}} where
private variable i : I
record Index : Type{ℓᵢ Lvl.⊔ ℓ} where
constructor intro
field
∅ : I
_⊰_ : T → I → I
module _ ((intro ∅ᵢ _⊰ᵢ_) : Index) where
data IndexedList : I → Type{ℓᵢ Lvl.⊔ ℓ} where
∅ ... |
module _ where
open import Common.Prelude
open import Common.Reflection
const : ∀ {a b} {A : Set a} {B : Set b} → A → B → A
const x _ = x
id : ∀ {a} {A : Set a} → A → A
id x = x
first : Tactic
first = give (def (quote const) [])
second : Tactic
second = give (def (quote const) (arg (argInfo visible relevant) (def... |
{-# OPTIONS --universe-polymorphism #-}
module Categories.Presheaf where
open import Categories.Category
open import Categories.Functor
Presheaf : ∀ {o ℓ e} {o′ ℓ′ e′} (C : Category o ℓ e) (V : Category o′ ℓ′ e′) → Set _
Presheaf C V = Functor C.op V
where module C = Category C |
-- Andreas, 2018-10-13, re issue #3244
--
-- Error should be raised when --no-prop and trying to use Prop
-- (universe-polymorphic or not).
{-# OPTIONS --no-prop #-}
data False {ℓ} : Prop ℓ where
-- Expected: Failure with error message
|
open import Data.Nat using (ℕ)
open import Data.Vec using (Vec; []; _∷_; map)
open import Dipsy.Polarity renaming (pos to +; neg to -)
module Dipsy.Form
(FOp : {n : ℕ} (as : Vec Polarity n) (b : Polarity) → Set)
where
data Form : Set where
op : {n : ℕ} {as : Vec Polarity n} {b : Polarity}
→ FOp as b → Vec ... |
{-# OPTIONS --without-K --safe #-}
module Categories.Category.Monoidal.Structure where
open import Level
open import Categories.Category
open import Categories.Category.Monoidal.Core
open import Categories.Category.Monoidal.Braided
open import Categories.Category.Monoidal.Symmetric
record MonoidalCategory o ℓ e : S... |
{-# OPTIONS --without-K --safe #-}
open import Level
-- This is really a degenerate version of Categories.Category.Instance.One
-- Here SingletonSet is not given an explicit name, it is an alias for Lift o ⊤
module Categories.Category.Instance.SingletonSet where
open import Data.Unit using (⊤; tt)
open import Relati... |
------------------------------------------------------------------------------
-- Well-founded induction on the relation LTC
------------------------------------------------------------------------------
{-# OPTIONS --exact-split #-}
{-# OPTIONS --no-sized-types #-}
{-# OPTIONS --no-universe-pol... |
------------------------------------------------------------------------
-- Binary trees
------------------------------------------------------------------------
{-# OPTIONS --without-K --safe #-}
open import Equality
module Tree {c⁺} (eq : ∀ {a p} → Equality-with-J a p c⁺) where
open Derived-definitions-and-proper... |
{-# OPTIONS --without-K --rewriting #-}
open import lib.Basics
open import lib.cubical.Square
open import lib.types.Bool
open import lib.types.Cofiber
open import lib.types.Lift
open import lib.types.Paths
open import lib.types.Pointed
open import lib.types.PushoutFmap
open import lib.types.Sigma
open import lib.types... |
{-# OPTIONS --universe-polymorphism #-}
module Categories.Functor.Constant where
open import Categories.Category
open import Categories.Functor
Constant : ∀ {o′ ℓ′ e′} {D : Category o′ ℓ′ e′} (x : Category.Obj D) → ∀ {o ℓ e} {C : Category o ℓ e} → Functor C D
Constant {D = D} x = record
{ F₀ = λ ... |
{-# OPTIONS --allow-unsolved-metas #-}
postulate
A : Set
a : A
record Q .(x : A) : Set where
field q : A
record R : Set where
field s : Q _
t : A
t = Q.q s
|
module LinkedList.Properties where
open import LinkedList
open import Data.Nat
open import Data.Nat.Properties.Simple
open import Relation.Nullary.Decidable using (False)
open import Relation.Binary.PropositionalEquality as PropEq
using (_≡_; _≢_; refl; cong; cong₂; trans; sym; inspect)
open PropEq.≡-Reasoning
... |
{-# OPTIONS --cubical --no-import-sorts --safe #-}
module Cubical.Data.Nat.Order.Recursive where
open import Cubical.Foundations.Prelude
open import Cubical.Foundations.Function
open import Cubical.Data.Empty
open import Cubical.Data.Unit
open import Cubical.Data.Nat.Base
open import Cubical.Data.Nat.Properties
ope... |
{-# OPTIONS --show-irrelevant #-}
module Control.Category.Product where
open import Level using (suc; _⊔_)
open import Relation.Binary hiding (_⇒_)
open import Control.Category
open Category using () renaming (Obj to obj; _⇒_ to _▹_⇒_)
-- Pre-Product
-- Given a category C and two objects A, B in C we can define a ... |
-- Andreas, 2012-05-04
module PruningNonMillerPatternFail where
data _≡_ {A : Set}(a : A) : A -> Set where
refl : a ≡ a
data Nat : Set where
zero : Nat
suc : Nat -> Nat
-- bad variable y is not in head position under lambda, so do not prune
fail4 : let X : Nat -> Nat -> Nat
X = _ -- λ x y → suc x
... |
{-# OPTIONS --without-K --safe #-}
module Data.Binary.Operations.Unary where
open import Data.Binary.Definitions
open import Function
inc⁺⁺ : 𝔹⁺ → 𝔹⁺
inc⁺⁺ 1ᵇ = O ∷ 1ᵇ
inc⁺⁺ (O ∷ xs) = I ∷ xs
inc⁺⁺ (I ∷ xs) = O ∷ inc⁺⁺ xs
inc⁺ : 𝔹 → 𝔹⁺
inc⁺ 0ᵇ = 1ᵇ
inc⁺ (0< x) = inc⁺⁺ x
inc : 𝔹 → 𝔹
inc x = 0< inc⁺ x
dec⁺⁺ :... |
{-# OPTIONS --safe --experimental-lossy-unification #-}
module Cubical.Homotopy.Group.S3 where
{-
This file contains a summary of what remains for π₄S³≅ℤ/2 to be proved.
See the module π₄S³ at the end of this file.
-}
open import Cubical.Foundations.Prelude
open import Cubical.Foundations.Pointed
open import Cubical.... |
-- Andreas, 2021-05-06, issue #5365
-- Error message for incomplete binding in do-block.
postulate _>>=_ : Set
test = do
x ←
-- Expected: proper error like
--
-- Incomplete binding x ←
-- <EOF><ERROR>
-- ...
|
-- Andreas, 2017-10-19, issue #2808
-- The fix of #1077 was not general enough.
-- module _ where -- If this is added, we get the error about duplicate module
postulate A : Set -- Accepted if this is deleted
module Issue2808 where
record Issue2808 : Set where
-- Expected error: (at the postulate)
-- Illegal decl... |
------------------------------------------------------------------------
-- INCREMENTAL λ-CALCULUS
--
-- Standard evaluation for MTerm
------------------------------------------------------------------------
import Parametric.Syntax.Type as Type
import Parametric.Syntax.Term as Term
import Parametric.Denotation.Value ... |
{- Denotational semantics of the types in the category of temporal types. -}
module Semantics.Types where
open import Syntax.Types
open import CategoryTheory.Instances.Reactive hiding (_+_)
open import TemporalOps.Box
open import TemporalOps.Diamond
-- Denotation of types
⟦_⟧ₜ : Type -> τ
⟦ Unit ⟧ₜ = ⊤
⟦ A & B ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.