text stringlengths 4 690k |
|---|
{-# OPTIONS --without-K --exact-split #-}
module 08-contractible-types where
import 07-equivalences
open 07-equivalences public
-- Section 6.1 Contractible types
is-contr :
{i : Level} → UU i → UU i
is-contr A = Σ A (λ a → (x : A) → Id a x)
abstract
center :
{i : Level} {A : UU i} → is-contr A → A
center... |
------------------------------------------------------------------------
-- The Agda standard library
--
-- A bunch of properties about natural number operations
------------------------------------------------------------------------
-- See README.Nat for some examples showing how this module can be
-- used.
module ... |
{-# OPTIONS --warning=error --safe --without-K #-}
open import LogicalFormulae
open import Lists.Lists
open import Numbers.Naturals.Semiring
open import Numbers.Naturals.Order
open import Semirings.Definition
open import Orders.Total.Definition
module Numbers.BinaryNaturals.Definition where
data Bit : Set where
ze... |
module Id where
{-
postulate x : Set
postulate y : Set
postulate _p_ : Set -> Set -> Set
e : Set
e = x p y
-}
{-
id2 : (A : Set0) -> (_ : A) -> A
id2 = \ (C : Set) (z : C) -> z
-}
{-
id : (A : Set) -> A -> A
id = \ A x -> x
-}
{-
idImp : {A : Set} -> A -> A
idImp = \ {A} x -> x
-}
id : {A : Set} -> A -> A
id x = ... |
module deriveUtil where
open import Level renaming ( suc to succ ; zero to Zero )
open import Data.Nat
open import Data.Fin
open import Data.List
open import regex
open import automaton
open import nfa
open import logic
open NAutomaton
open Automaton
open import Relation.Binary.PropositionalEquality hiding ( [_] )
o... |
{-# OPTIONS --without-K #-}
module higher.interval where
open import Relation.Binary.PropositionalEquality
open import equality-groupoid
postulate
I : Set
zero : I
one : I
path : zero ≡ one
module DepElim (B : I → Set)
(x : B zero)
(y : B one)
(p : subst B pat... |
-- Jesper, 2019-09-12: The fix of #3541 introduced a regression: the
-- index of the equality type is treated as a positive argument.
data _≡_ (A : Set) : Set → Set where
refl : A ≡ A
postulate X : Set
data D : Set where
c : X ≡ D → D
|
-- Andreas, 2017-07-26, issue #2331.
-- Andrea found a counterexample against the "usable decrease" feature:
open import Agda.Builtin.Size
data D (i : Size) : Set where
c : (j : Size< i) → D i
mutual
test : (i : Size) → D i → Set
test i (c j) = (k : Size< j) (l : Size< k) → helper i j k (c l)
helper : (i :... |
module ConstructorHeadedDivergenceIn2-2-10 where
data ⊤ : Set where
tt : ⊤
data ℕ : Set where
zero : ℕ
suc : ℕ → ℕ
data _×_ (A B : Set) : Set where
_,_ : A → B → A × B
{- Brandon Moore reports (July 2011)
In 2.2.10 the following code seems to cause typechecking
to diverge.
-}
f : ℕ → Set
f zero = ⊤
f (suc ... |
{-# OPTIONS --allow-unsolved-metas #-}
data _≡_ {a} {A : Set a} (x : A) : A → Set a where
refl : x ≡ x
infix 0 _≡_
{-# BUILTIN EQUALITY _≡_ #-}
data Sigma {l} (A : Set l) (B : A -> Set l) : Set l where
_**_ : (a : A) -> B a -> Sigma A B
sym : ∀ {a} {A : Set a} {x y : A} → x ≡ y → y ≡ x
sym refl = refl
trans : ... |
module plfa.part1.Naturals where
data ℕ : Set where
zero : ℕ
suc : ℕ → ℕ
seven = suc (suc (suc (suc (suc (suc (suc zero))))))
{-# BUILTIN NATURAL ℕ #-}
import Relation.Binary.PropositionalEquality as Eq
open Eq using (_≡_; refl)
open Eq.≡-Reasoning using (begin_; _≡⟨⟩_; _∎)
_+_ : ℕ → ℕ → ℕ
zero + n = n
(suc m... |
open import Categories
open import Monads
module Monads.Kleisli.Functors {a b}{C : Cat {a}{b}}(M : Monad C) where
open import Library
open import Functors
open import Monads.Kleisli M
open Cat C
open Fun
open Monad M
KlL : Fun C Kl
KlL = record{
OMap = id;
HMap = comp η;
fid = idr;
fcomp = λ{_}{_}{_}{f}... |
mutual
Loop : Set
Loop = {!!}
-- Should not solve ?0 := Loop → Loop
solve : Loop → Loop → Loop
solve x = x
|
{-# OPTIONS --prop --without-K --rewriting #-}
module Calf.Types.Unit where
open import Calf.Prelude
open import Calf.Metalanguage
open import Data.Unit public using (⊤) renaming (tt to triv)
unit : tp pos
unit = U (meta ⊤)
|
{-# OPTIONS --without-K --rewriting #-}
open import lib.Basics
open import lib.NType2
open import lib.types.Group
open import lib.types.List
open import lib.types.Pi
open import lib.types.SetQuotient
open import lib.types.Word
open import lib.groups.GeneratedGroup
open import lib.groups.Homomorphism
module lib.groups... |
{-# OPTIONS --cubical --safe #-}
module Cubical.Modalities.Everything where
open import Cubical.Modalities.Modality public
|
{-
This second-order signature was created from the following second-order syntax description:
syntax PCF
type
N : 0-ary
_↣_ : 2-ary | r30
B : 0-ary
term
app : α ↣ β α -> β | _$_ l20
lam : α.β -> α ↣ β | ƛ_ r10
tr : B
fl : B
ze : N
su : N -> N
pr : N -> N
iz : N -> B | 0?
... |
module ShouldBeEmpty where
data Zero : Set where
data One : Set where
one : One
ok : Zero -> One
ok ()
bad : One -> One
bad ()
|
{- 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 LibraBFT.Prelude
open import LibraBFT.Impl.NetworkMsg
open i... |
{-# OPTIONS --without-K #-}
module Transport where
open import GroupoidStructure
open import PathOperations
open import Types
tr-post : ∀ {a} {A : Set a} (a : A) {x y : A}
(p : x ≡ y) (q : a ≡ x) →
tr (λ x → a ≡ x) p q ≡ q · p
tr-post a = J
(λ x _ p → (q : a ≡ x) → tr (λ x → a ≡ x) p q ≡ q · p)
(λ _ q → p·id ... |
------------------------------------------------------------------------
-- The Agda standard library
--
-- Homogeneously-indexed binary relations
------------------------------------------------------------------------
-- The contents of this module should be accessed via
-- `Relation.Binary.Indexed.Homogeneous`.
{-... |
{-# OPTIONS --without-K --rewriting #-}
open import lib.Basics
open import lib.NConnected
open import lib.types.Empty
open import lib.types.Nat
open import lib.types.Paths
open import lib.types.Pi
open import lib.types.Pointed
open import lib.types.Sigma
open import lib.types.TLevel
open import lib.types.Truncation
m... |
-- Step-indexed logical relations based on relational big-step semantics
-- for ILC-based incremental computation.
-- Goal: prove the fundamental lemma for a ternary logical relation (change
-- validity) across t1, dt and t2. The fundamnetal lemma relates t, derive t and
-- t. That is, we relate a term evaluated relat... |
module PiFrac.Eval where
open import Data.Empty
open import Data.Unit hiding (_≟_)
open import Data.Sum
open import Data.Product
open import Data.List as L hiding (_∷_)
open import Data.Maybe
open import Relation.Binary.Core
open import Relation.Binary
open import Relation.Nullary
open import Relation.Binary.Propositio... |
{-# OPTIONS --no-termination-check --universe-polymorphism #-}
module PiF where
open import Level
open import Data.Empty
open import Data.Unit
open import Data.Bool
open import Data.Sum hiding (map)
open import Data.Product hiding (map)
open import Relation.Binary.PropositionalEquality hiding (sym; [_])
... |
-- Basic intuitionistic contextual modal logic, without ∨ or ⊥.
-- Gentzen-style formalisation of syntax with context pairs, after Nanevski-Pfenning-Pientka.
-- Simple terms.
module BasicICML.Syntax.DyadicGentzen where
open import BasicICML.Syntax.Common public
-- Derivations.
-- NOTE: Only var is an instance cons... |
{-# OPTIONS --without-K #-}
module AC {a b c} {A : Set a} {B : A → Set b} {C : (x : A) → B x → Set c} where
open import Equivalence
open import FunExt
open import Types
left : Set _
left = (x : A) → Σ (B x) λ y → C x y
right : Set _
right = Σ ((x : A) → B x) λ f → (x : A) → C x (f x)
to : left → right
to f = π₁ ∘ f... |
module Oscar.Data.Vec.Properties where
open import Oscar.Data.Vec
open import Data.Vec.Properties public
open import Data.Nat
open import Data.Product renaming (map to mapP)
open import Relation.Binary.PropositionalEquality
open import Data.Fin
map-∈ : ∀ {a b} {A : Set a} {B : Set b} {y : B} {f : A → B} {n} {xs : ... |
{-# OPTIONS --copatterns #-}
module IOExampleGraphicsDrawingProgram where
open import Data.Bool.Base
open import Data.Char.Base renaming (primCharEquality to charEquality)
open import Data.Nat.Base hiding (_≟_;_⊓_; _+_; _*_)
open import Data.List.Base hiding (_++_)
open import Data.Integer.Base hiding (suc)
open imp... |
------------------------------------------------------------------------------
-- Streams properties
------------------------------------------------------------------------------
{-# OPTIONS --exact-split #-}
{-# OPTIONS --no-sized-types #-}
{-# OPTIONS --no-universe-polymorphism #-}
{-# OPTION... |
{-# OPTIONS --sized-types #-}
module SizedTypesScopeExtrusion where
postulate
Size : Set
_^ : Size -> Size
∞ : Size
{-# BUILTIN SIZE Size #-}
{-# BUILTIN SIZESUC _^ #-}
{-# BUILTIN SIZEINF ∞ #-}
data Nat : {size : Size} -> Set where
zero : {size : Size} -> Nat {size ^}
suc : {size : Size} -> Nat {... |
module DifferentArities where
open import Common.Equality
open import Common.Prelude
f : Nat → Nat → Nat
f zero = λ x → x
f (suc n) m = f n (suc m)
testf1 : f zero ≡ λ x → x
testf1 = refl
testf2 : ∀ {n m} → f (suc n) m ≡ f n (suc m)
testf2 = refl
testf3 : f 4 5 ≡ 9
testf3 = refl
-- Andreas, 2015-01-21 prope... |
module safety where
open import Algebra
open import Data.List
open import Data.List.Relation.Unary.All using (All; []; _∷_)
open import Data.Rational
open import Data.Rational.Properties
open import Data.Nat using (z≤n; s≤s)
open import Data.Integer using (+≤+; +<+; +_)
open import Data.Vec using (_∷_)
open import L... |
------------------------------------------------------------------------
-- Finite maps, i.e. lookup tables (currently only some type
-- signatures)
------------------------------------------------------------------------
module Data.Map where
open import Relation.Nullary
open import Relation.Binary
open import Data.... |
module List.Permutation.Alternative (A : Set) where
open import Data.List
data _∼_ : List A → List A → Set where
∼refl : {xs : List A}
→ xs ∼ xs
∼trans : {xs ys zs : List A}
→ xs ∼ ys
→ ys ∼ zs
→ xs ∼ zs
∼head : {xs ys : List A}(x :... |
module Data.Binary.Tests.Semantics where
open import Data.Binary.Definitions
open import Data.Binary.Operations.Semantics
open import Data.Nat as ℕ using (ℕ; suc; zero)
open import Data.List as List using (List; _∷_; [])
open import Relation.Binary.PropositionalEquality
prop : ℕ → Set
prop n = let xs = List.upTo n in... |
module CTL.Modalities.AF where
open import FStream.Core
open import Library
-- Certainly sometime : s₀ ⊧ φ ⇔ ∀ s₀ R s₁ R ... ∃ i . sᵢ ⊧ φ
-- TODO Unclear whether this needs sizes
data AF' {ℓ₁ ℓ₂} {C : Container ℓ₁}
(props : FStream' C (Set ℓ₂)) : Set (ℓ₁ ⊔ ℓ₂) where
alreadyA : head props → AF' props
notYetA ... |
-- Andreas, 2011-04-26
{-# OPTIONS --universe-polymorphism #-}
module Issue411 where
import Common.Irrelevance
record A : Set₁ where
field
.foo : Set
-- this yielded a panic "-1 not a valid deBruijn index" due to old code for assignS |
{-# OPTIONS --without-K --safe #-}
open import Relation.Binary using (Rel)
open import Algebra.Structures.Bundles.Field
module Algebra.Linear.Morphism.Definitions
{k ℓᵏ} (K : Field k ℓᵏ)
{a} (A : Set a)
{b} (B : Set b)
{ℓ} (_≈_ : Rel B ℓ)
where
open import Algebra.Linear.Core
open import Function
import ... |
module SafeFlagPrimTrustMe where
open import Agda.Builtin.Equality
private
primitive
primTrustMe : ∀ {a} {A : Set a} {x y : A} → x ≡ y
|
-- statically checked sorted lists
-- see http://www2.tcs.ifi.lmu.de/~abel/DepTypes.pdf
module SortedList where
open import Data.Nat using (ℕ; zero; suc; _+_; _*_)
open import Data.Bool using (Bool; true; false)
----------------------------------------------------------------------
-- Curry-Howard stuff
Propositio... |
module 110-natural-model where
open import 010-false-true
open import 020-equivalence
open import 100-natural
-- We prove that there is a model of the naturals within Agda's lambda
-- calculus. This also shows that the Peano axioms are consistent.
data ℕ : Set where
zero : ℕ
suc : ℕ -> ℕ
thm-ℕ-is-natural : Natu... |
{-# OPTIONS --without-K --rewriting #-}
open import lib.Basics
open import lib.NType2
open import lib.types.Int
open import lib.types.Group
open import lib.types.List
open import lib.types.Word
open import lib.groups.Homomorphism
open import lib.groups.Isomorphism
open import lib.groups.FreeAbelianGroup
open import li... |
module _ where
open import Common.Prelude
print : Float → IO Unit
print x = putStrLn (primShowFloat x)
printB : Bool → IO Unit
printB true = putStrLn "true"
printB false = putStrLn "false"
_/_ = primFloatDiv
_==_ = primFloatEquality
_=N=_ = primFloatNumericalEquality
_<N_ = primFloatNumericalLess
_<_ = prim... |
{-# OPTIONS --without-K --safe #-}
open import Algebra.Structures.Bundles.Field
module Algebra.Linear.Morphism
{k ℓᵏ} (K : Field k ℓᵏ)
where
open import Algebra.Linear.Morphism.Definitions K public
open import Algebra.Linear.Morphism.Bundles K public
open import Algebra.Linear.Morphism.VectorSpace K public
|
{-# OPTIONS --cubical --no-import-sorts --safe #-}
module Cubical.Reflection.StrictEquiv where
open import Cubical.Foundations.Prelude
open import Cubical.Foundations.Function
open import Cubical.Foundations.Equiv.Base
open import Cubical.Foundations.Isomorphism
open import Cubical.Data.List.Base
open import Cubical.... |
{-# OPTIONS --without-K --safe #-}
open import Definition.Typed.EqualityRelation
module Definition.LogicalRelation.ShapeView {{eqrel : EqRelSet}} where
open EqRelSet {{...}}
open import Agda.Primitive
open import Definition.Untyped
open import Definition.Typed
open import Definition.Typed.Properties
open import Def... |
module IllTyped where
data Nat : Set where
zero : Nat
suc : Nat -> Nat
data Bool : Set where
false : Bool
true : Bool
F : Nat -> Set
F zero = Nat
F (suc x) = Bool
postulate
D : (x:Nat)(y:F x) -> Set
T : Nat -> Set
f : {x:Nat -> Nat}{y:F (x zero)} ->
(T (x zero) -> T (suc zero)) ->
(... |
------------------------------------------------------------------------
-- The Agda standard library
--
-- 1 dimensional pretty printing of rose trees
------------------------------------------------------------------------
{-# OPTIONS --without-K --safe --sized-types #-}
module Text.Tree.Linear where
open import L... |
{-# OPTIONS --type-in-type #-}
Ty% : Set
Ty% =
(Ty% : Set)
(nat top bot : Ty%)
(arr prod sum : Ty% → Ty% → Ty%)
→ Ty%
nat% : Ty%; nat% = λ _ nat% _ _ _ _ _ → nat%
top% : Ty%; top% = λ _ _ top% _ _ _ _ → top%
bot% : Ty%; bot% = λ _ _ _ bot% _ _ _ → bot%
arr% : Ty% → Ty% → Ty%; arr%
= λ A B Ty% na... |
-- Andreas, 2012-09-07
module DataParameterPolarity where
data Bool : Set where
true false : Bool
data ⊥ : Set where
record ⊤ : Set where
-- True uses its first argument.
True : Bool → Set
True true = ⊤
True false = ⊥
-- Hence, D also uses its first argument.
-- A buggy polarity analysis may consider D as consta... |
{-
This file contains:
- Id, refl and J (with definitional computation rule)
- Basic theory about Id, proved using J
- Lemmas for going back and forth between Path and Id
- Function extensionality for Id
- fiber, isContr, equiv all defined using Id
- The univalence axiom expressed using only Id ([EquivContr])
-... |
------------------------------------------------------------------------
-- The Agda standard library
--
-- This module is DEPRECATED. Please use
-- Data.Vec.Relation.Binary.Pointwise.Extensional directly.
------------------------------------------------------------------------
{-# OPTIONS --without-K --safe #-}
modu... |
{-# OPTIONS --allow-unsolved-metas #-}
open import Agda.Builtin.Nat
test : (n : Nat) → Nat
test n with zero
... | n = {!n!}
|
-- This file is imported by Issue1597.Main
module Issue1597 where
module A where
module M where -- needs to be module
postulate Nat : Set
|
------------------------------------------------------------------------------
-- The division specification
------------------------------------------------------------------------------
{-# OPTIONS --exact-split #-}
{-# OPTIONS --no-sized-types #-}
{-# OPTIONS --no-universe-polymorphism #-}
{-... |
module Categories.Ran where
open import Level
open import Categories.Category
open import Categories.Functor hiding (_≡_)
open import Categories.NaturalTransformation
record Ran {o₀ ℓ₀ e₀} {o₁ ℓ₁ e₁} {o₂ ℓ₂ e₂}
{A : Category o₀ ℓ₀ e₀} {B : Category o₁ ℓ₁ e₁} {C : Category o₂ ℓ₂ e₂}
(F : Functor... |
{- 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
-}
open import LibraBFT.Prelude
open import LibraBFT.Lemmas
open import LibraBFT.H... |
module Thesis.Syntax where
open import Thesis.Types public
open import Thesis.Contexts public
data Const : (τ : Type) → Set where
unit : Const unit
lit : ℤ → Const int
plus : Const (int ⇒ int ⇒ int)
minus : Const (int ⇒ int ⇒ int)
cons : ∀ {t1 t2} → Const (t1 ⇒ t2 ⇒ pair t1 t2)
fst : ∀ {t1 t2} → Con... |
open import Common.Reflection
macro
round-trip : Term → Tactic
round-trip v hole = unify v hole
module M (A : Set) where
data D : Set where
test : Set
test = round-trip D
|
module MissingWithClauses where
data D : Set where
c : D
f : D -> D
f c with c
|
module PiInSet where
Rel : Set -> Set1
Rel A = A -> A -> Set
Reflexive : {A : Set} -> Rel A -> Set
Reflexive {A} _R_ = forall x -> x R x
Symmetric : {A : Set} -> Rel A -> Set
Symmetric {A} _R_ = forall x y -> x R y -> y R x
data True : Set where
tt : True
data False : Set where
data Nat : Set where
zero : Na... |
{-# OPTIONS --without-K --allow-unsolved-metas --exact-split #-}
module 21-pushouts where
import 20-pullbacks
open 20-pullbacks public
-- Section 14.1
{- We define the type of cocones with vertex X on a span. Since we will use it
later on, we will also characterize the identity type of the type of cocones
wit... |
{-# OPTIONS --without-K --safe #-}
open import Categories.Category
open import Categories.Category.Monoidal
-- the definition used here is not very similar to what one usually sees in nLab or
-- any textbook. the difference is that usually closed monoidal category is defined
-- through a right adjoint of -⊗X, which ... |
{-# OPTIONS --universe-polymorphism #-}
module Categories.Bifunctor where
open import Level
open import Data.Product using (_,_; swap)
open import Categories.Category
open import Categories.Functor public
open import Categories.Product
Bifunctor : ∀ {o ℓ e} {o′ ℓ′ e′} {o′′ ℓ′′ e′′} → Category o ℓ e → Category o′ ℓ′... |
module Cats.Functor.Op where
open import Cats.Category.Base
open import Cats.Category.Op using (_ᵒᵖ)
open import Cats.Functor using (Functor)
open Functor
Op : ∀ {lo la l≈ lo′ la′ l≈′}
→ {C : Category lo la l≈} {D : Category lo′ la′ l≈′}
→ Functor C D
→ Functor (C ᵒᵖ) (D ᵒᵖ)
Op F = record
{ fobj = fobj F
... |
module Tactic.Deriving.Quotable where
open import Prelude
open import Container.Traversable
open import Tactic.Reflection
open import Tactic.Reflection.Quote.Class
open import Tactic.Deriving
private
-- Bootstrapping
qVis : Visibility → Term
qVis visible = con (quote visible) []
qVis hidden = con (quote hidd... |
open import Data.Product using ( _×_ )
open import FRP.LTL.ISet.Core using ( ISet ; ⌈_⌉ ; M⟦_⟧ )
open import FRP.LTL.Time using ( Time )
open import FRP.LTL.Time.Bound using ( fin ; _≺_ )
open import FRP.LTL.Time.Interval using ( [_⟩ ; sing )
module FRP.LTL.ISet.Until where
data _Until_ (A B : ISet) (t : Time) : Set ... |
module Sets.ExtensionalPredicateSet where
import Lvl
open import Data
open import Data.Boolean
open import Data.Either as Either using (_‖_)
open import Data.Tuple as Tuple using (_⨯_ ; _,_)
open import Functional
open import Function.Equals
open import Function.Equals.Proofs
open import Function.Inverse
open imp... |
open import MLib.Prelude
open import MLib.Algebra.PropertyCode
open import MLib.Algebra.PropertyCode.Structures
module MLib.Matrix.Plus {c ℓ} (struct : Struct bimonoidCode c ℓ) {m n : ℕ} where
open import MLib.Matrix.Core
open import MLib.Matrix.Equality struct
open FunctionProperties
-- Pointwise addition --
infi... |
{-
Practical Relational Algebra
Toon Nolten
based on
The Power Of Pi
-}
module relational-algebra where
open import Data.Empty
open import Data.Unit hiding (_≤_)
open import Data.Bool
open import Data.Nat
open import Data.Integer hiding (show)
open import Data.List
open import... |
{-# OPTIONS --without-K --safe #-}
open import Definition.Typed.EqualityRelation
module Definition.LogicalRelation {{eqrel : EqRelSet}} where
open EqRelSet {{...}}
open import Definition.Untyped as U
open import Definition.Typed
open import Definition.Typed.Weakening
open import Agda.Primitive
open import Tools.Pro... |
{-# OPTIONS --verbose=10 #-}
module leafsF where
open import Data.Nat
open import Data.Vec
open import Agda.Builtin.Sigma
open import Data.Product
open import Data.Fin using (fromℕ)
open import trees
open import optics
open import lemmas
leafsTreeF : {A : Set} -> (t : Tree A) -> Vec A (#leafs t)... |
{-# OPTIONS --no-sized-types #-}
postulate
Size : Set
_^ : Size -> Size
∞ : Size
{-# BUILTIN SIZE Size #-}
{-# BUILTIN SIZESUC _^ #-}
{-# BUILTIN SIZEINF ∞ #-}
data Nat : {size : Size} -> Set where
zero : {size : Size} -> Nat {size ^}
suc : {size : Size} -> Nat {size} -> Nat {size ^}
weak : {i : S... |
{-# OPTIONS --cubical #-}
module Properties where
open import Data.Fin renaming (zero to Fzero; suc to Fsuc) hiding (_+_; _≟_)
open import Data.Nat
open import Data.Nat.DivMod using (_mod_; _div_; m≡m%n+[m/n]*n)
open import Data.Nat.Properties using (+-comm)
open import Data.Product
open import Function using (_∘_)
o... |
open import Agda.Builtin.IO
open import Agda.Builtin.Nat
open import Agda.Builtin.Unit
private
n : Nat
n = 7
{-# COMPILE GHC n as n #-}
postulate
main : IO ⊤
{-# COMPILE GHC main = print n #-}
|
-- Also works for parts of operators.
module NotInScope where
postulate
X : Set
if_then_else_ : X -> X -> X -> X
x : X
bad = if x thenn x else x
-- The error message should /not/ claim that "if" is out of scope.
|
-- It would be nice if this worked. The constraint we can't solve is
-- P x y = ? (x, y)
-- Solution: extend the notion of Miller patterns to include record
-- constructions.
--
-- Andreas, 2012-02-27 works now! (see issues 376 and 456)
module UncurryMeta where
data Unit : Set where
unit : Unit
record R : Set whe... |
-- Category of indexed families
module SOAS.Families.Core {T : Set} where
open import SOAS.Common
open import SOAS.Context {T}
open import SOAS.Sorting {T}
-- | Unsorted
-- Sets indexed by a context
Family : Set₁
Family = Ctx → Set
-- Indexed functions between families
_⇾_ : Family → Family → Set
X ⇾ Y = ∀{Γ : Ct... |
{-
In this file we apply the cubical machinery to Martin Hötzel-Escardó's
structure identity principle:
https://www.cs.bham.ac.uk/~mhe/HoTT-UF-in-Agda-Lecture-Notes/HoTT-UF-Agda.html#sns
-}
{-# OPTIONS --cubical --safe #-}
module Cubical.Foundations.SIP where
open import Cubical.Foundations.Prelude
open import Cubi... |
module WrongHidingInApplication where
id : (A : Set) -> A -> A
id A x = x
foo : (A : Set) -> A -> A
foo A x = id {A} x
|
module GTFL where
open import Data.Nat hiding (_⊓_; erase; _≟_; _≤_)
open import Data.Bool hiding (_≟_)
open import Data.Fin using (Fin; zero; suc; toℕ)
open import Data.Vec
open import Relation.Binary.PropositionalEquality
open import Relation.Nullary
open import Data.Empty
open import Function using (_∘_)
-- | Type... |
------------------------------------------------------------------------------
-- Arithmetic properties
------------------------------------------------------------------------------
{-# OPTIONS --exact-split #-}
{-# OPTIONS --no-sized-types #-}
{-# OPTIONS --no-universe-polymorphism #-}
{-# OPT... |
module datatype-util where
open import constants
open import ctxt
open import syntax-util
open import general-util
open import type-util
open import cedille-types
open import subst
open import rename
open import free-vars
{-# TERMINATING #-}
decompose-arrows : ctxt → type → params × type
decompose-arrows Γ (TpAbs me x... |
{-# OPTIONS --safe #-}
module Cubical.Algebra.Ring.DirectProd where
open import Cubical.Foundations.Prelude
open import Cubical.Foundations.Equiv
open import Cubical.Foundations.Isomorphism
open import Cubical.Foundations.HLevels
open import Cubical.Data.Sigma
open import Cubical.Algebra.Ring.Base
private
variable
... |
module Issue213 where
postulate
Prod : Set → Set → Set
A : Set
Foo : Set
Foo = let infixr 3 _×_
_×_ : Set → Set → Set
_×_ = Prod
in A × A × A
|
module Categories.Functor.Construction.Product where
open import Categories.Category
open import Categories.Category.Cartesian
open import Categories.Category.BinaryProducts
open import Categories.Functor.Bifunctor
open import Data.Product using (_,_)
module _ {o ℓ e} (𝒞 : Category o ℓ e) (cartesian : Cartesian 𝒞)... |
{-# OPTIONS --allow-unsolved-metas #-} -- FIXME
open import Everything
module Test.Test3 where
module _
{𝔬₁ 𝔯₁ ℓ₁ 𝔬₂ 𝔯₂ ℓ₂}
where
postulate instance functor : Functor 𝔬₁ 𝔯₁ ℓ₁ 𝔬₂ 𝔯₂ ℓ₂
open Functor ⦃ … ⦄
test : asInstance `IsFunctor $ {!Transextensionality!.type _∼₁_ _∼̇₁_!}
test = ... |
{-# OPTIONS --type-in-type #-}
module Record where
open import Prelude
record Sigma (A : Set)(B : A -> Set) : Set
record Sigma A B where
constructor pair
field
fst : A
snd : B fst
open Sigma
data Unit : Set
data Unit where
tt : Unit
Cat : Set
Cat =
Sigma Set ... |
-- By Philipp Hausmann.
open import Agda.Builtin.Bool
open import Agda.Builtin.Equality
open import Agda.Builtin.Float
data ⊥ : Set where
_/_ = primFloatDiv
_<_ = primFloatNumericalLess
cong : {A B : Set} {x y : A} (f : A → B) → x ≡ y → f x ≡ f y
cong f refl = refl
0eq : 0.0 ≡ -0.0
0eq = refl
bug : ⊥
bug = f (co... |
module Data.BinaryTree.Properties where
import Lvl
open import Data hiding (empty)
open import Data.BinaryTree
open import Data.Boolean
open import Functional as Fn
open import Logic.Propositional
open import Numeral.Natural
open import Type
private variable ℓ ℓᵢ ℓₗ ℓₙ ℓₒ : Lvl.Level
private variable n : ℕ
priva... |
record Unit : Set where
constructor unit
module S {A : Set} where
id : {A : Set} → A → A
id a = a
module T {A : Set} = S
Sid : (A : Set) → A → A
Sid A = S.id {A = Unit} {A = A}
Tid : (A : Set) → A → A
Tid A = T.id {A = Unit} {A = Unit} {A = A}
|
module trie-thms where
open import bool
open import bool-thms
open import bool-thms2
open import char
open import eq
open import list
open import list-thms
open import maybe
open import product
open import product-thms
open import sum
open import string
open import trie
trie-lookup-empty-h : ∀ {A} x → trie-lookup-h{A... |
------------------------------------------------------------------------
-- The Agda standard library
--
-- Level polymorphic Empty type
------------------------------------------------------------------------
{-# OPTIONS --without-K --safe #-}
module Data.Empty.Polymorphic where
open import Level
data ⊥ {ℓ : Level... |
{-# OPTIONS --safe --warning=error --without-K #-}
open import Rings.Definition
open import Rings.Orders.Partial.Definition
open import Setoids.Setoids
open import Setoids.Orders.Partial.Definition
open import Functions.Definition
open import Fields.Fields
open import Agda.Primitive using (Level; lzero; lsuc; _⊔_)
m... |
{-# OPTIONS --cubical --safe #-}
open import Algebra
open import Relation.Binary
open import Algebra.Monus
module Data.MonoidalHeap {s} (monus : TMPOM s) where
open TMPOM monus
open import Prelude
open import Data.List using (List; _∷_; [])
import Data.Nat as ℕ
import Data.Nat.Properties as ℕ
𝒮 : Type s
𝒮 = 𝑆 ... |
{-# OPTIONS --without-K --rewriting #-}
open import lib.Basics
open import lib.types.Group
open import lib.types.List
open import lib.types.Pi
open import lib.types.Sigma
open import lib.types.Word
open import lib.groups.Homomorphism
open import lib.groups.GeneratedGroup
open import lib.groups.GeneratedAbelianGroup
op... |
{- 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
-}
{-# OPTIONS --allow-unsolved-metas #-}
open import LibraBFT.Base.Types... |
{-# OPTIONS --without-K #-}
module isos-examples where
open import Function
open import Function.Related.TypeIsomorphisms.NP
import Function.Inverse.NP as FI
open FI using (_↔_; inverses; module Inverse) renaming (_$₁_ to to; _$₂_ to from)
import Function.Related as FR
open import Type hiding (★)
open import Data.Prod... |
{-# OPTIONS --without-K #-}
open import container.core
module container.w.algebra
{li la lb}(c : Container li la lb) where
open import sum
open import equality
open import container.w.core
open import function.extensionality
open import function.isomorphism
open import hott.level.core
open Container c
Alg : ∀ ℓ →... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.