text stringlengths 4 690k |
|---|
{-# OPTIONS --cubical --safe #-}
module Cubical.HITs.Truncation.Properties where
open import Cubical.HITs.Truncation.Base
open import Cubical.Data.Nat
open import Cubical.Data.NatMinusOne
open import Cubical.Foundations.Prelude
open import Cubical.Foundations.Equiv
open import Cubical.Foundations.Isomorphism
open impo... |
{-# OPTIONS --safe --warning=error --without-K #-}
open import Boolean.Definition
open import Sets.FinSet.Definition
open import LogicalFormulae
open import Groups.Abelian.Definition
open import Groups.Vector
open import Groups.Definition
open import Groups.Abelian.Definition
open import Numbers.Integers.Integers
open... |
module Data.Map
(Key : Set)
where
import Data.Bool
import Data.Maybe
open Data.Bool
infix 40 _<_ _>_
postulate
_<_ : Key -> Key -> Bool
_>_ : Key -> Key -> Bool
x > y = y < x
private
data Map' (a : Set) : Set where
leaf : Map' a
node : Key -> a -> Map' a -> Map' a -> Map' a
Map : Set -> Se... |
{-# OPTIONS --show-irrelevant #-}
open import Agda.Builtin.Bool
open import Agda.Builtin.Equality
postulate
A : Set
f : .(Bool → A) → Bool → A
mutual
X : .A → Bool → A
X = _
test : (x : Bool → A) → X (x true) ≡ f x
test x = refl
|
{-# OPTIONS --without-K --safe #-}
module Experiment.Transitive where
open import Level
open import Relation.Binary
open import Relation.Binary.Construct.Closure.Transitive
open import Relation.Binary.PropositionalEquality as ≡ using (_≡_)
insert-permutation : ∀ x xs → insert x xs ↭ x ∷ xs
insert-pres-Sorted : ∀ x {x... |
-- {-# OPTIONS -v tc.size.solve:60 #-}
module Issue300 where
open import Common.Size
data Nat : Size → Set where
zero : (i : Size) → Nat (↑ i)
suc : (i : Size) → Nat i → Nat (↑ i)
-- Size meta used in a different context than the one created in
A : Set₁
A = (Id : (i : Size) → Nat _ → Set)
(k : Size) (m : ... |
module Everything where
import Library
import NfCBPV
|
module Foreword where
open import Relation.Binary
--open Setoid ⦃ … ⦄
--open IsEquivalence ⦃ … ⦄
open import Level
record HasEquivalence (A : Set) ℓ : Set (suc ℓ) where
field
_≈_ : Rel A ℓ
⦃ isEquivalence ⦄ : IsEquivalence _≈_
setoid : Setoid _ _
Setoid.Carrier setoid = A
Setoid._≈_ setoid = _≈_
... |
-- Andreas, 2019-07-09, issue #3900
-- Regression introduced by the fix of #3434
-- {-# OPTIONS -v tc.inj:100 #-}
data Bool : Set where
true false : Bool
abstract
data Unit : Set where
unit : Unit
f : Unit
f with true
... | true = unit
... | false = unit
-- Error WAS:
-- Not in Scope: unit
-- Sh... |
open import Oscar.Prelude
open import Oscar.Class.IsPrecategory
open import Oscar.Class.IsCategory
open import Oscar.Class.Category
open import Oscar.Class.IsFunctor
open import Oscar.Class.Functor
open import Oscar.Class.Reflexivity
open import Oscar.Class.Transitivity
open import Oscar.Class.Surjection
open import ... |
open import Common.Prelude renaming (Nat to ℕ)
open import Common.Reflect
module StrangeRecursiveUnquote where
`ℕ : Term
`ℕ = def (quote ℕ) []
-- the term f n is stuck and so we cannot unquote (as expected)
f : ℕ → Term
f zero = `ℕ
f (suc n) = unquote (f n)
|
open import Agda.Builtin.Nat
open import Agda.Builtin.Equality
record R : Set where
field
r1 r2 : Nat
test : (x : R) → R.r1 x ≡ 0 → Nat
test x refl = 0
|
------------------------------------------------------------------------
-- Syntax of pure type systems (PTS)
------------------------------------------------------------------------
module Pts.Syntax where
open import Data.Fin using (Fin)
open import Data.Fin.Substitution
open import Data.Fin.Substitution.Lemmas
ope... |
module Structure.Setoid.Uniqueness where
import Lvl
open import Functional
open import Logic
open import Logic.Propositional
open import Logic.Predicate
open import Structure.Setoid
open import Type
private variable ℓₗ ℓₗ₁ ℓₗ₂ : Lvl.Level
module _ {ℓ₁}{ℓ₂} where
-- Definition of uniqueness of a property.
--... |
------------------------------------------------------------------------
-- Some χ program combinators
------------------------------------------------------------------------
module Combinators where
open import Equality.Propositional
open import Prelude hiding (id; if_then_else_; not; const)
open import Tactic.By.P... |
-- Various operations and proofs on morphisms between products
{-# OPTIONS --universe-polymorphism #-}
open import Categories.Category
module Categories.Object.Product.Morphisms {o ℓ e} (C : Category o ℓ e) where
import Categories.Object.Product
open Categories.Object.Product C
open Category C
open Equiv
open HomRea... |
open import Prelude
module Implicits.Substitutions.Lemmas where
open import Implicits.Syntax.Type
open import Implicits.Syntax.Term hiding (var)
open import Implicits.Syntax.Context
open import Implicits.WellTyped
open import Implicits.Substitutions
open import Data.Fin.Substitution
open import Data.Fin.Substitution.... |
module BasicIS4.Metatheory.DyadicGentzen-BasicKripkeBozicDosen where
open import BasicIS4.Syntax.DyadicGentzen public
open import BasicIS4.Semantics.BasicKripkeBozicDosen public hiding (_⊨_) -- TODO
-- Soundness with respect to all models, or evaluation.
eval : ∀ {A Γ Δ} → Γ ⁏ Δ ⊢ A → Γ ⁏ Δ ⊨ A
eval (var i) ... |
module Coirc.Network.Primitive where
{-# IMPORT Coirc.Network.FFI #-}
{-# IMPORT System.IO #-}
open import Data.String
open import IO.Primitive
open import Foreign.Haskell
postulate Handle : Set
{-# COMPILED_TYPE Handle System.IO.Handle #-}
postulate hConnect : String → IO Handle
{-# COMPILED hConnect Coirc.Network.F... |
module Algebra.Dioid.Bool.Theorems where
open import Algebra.Dioid
open import Algebra.Dioid.Bool
or-left-congruence : ∀ {b c d : Bool} -> b ≡ c -> (b or d) ≡ (c or d)
or-left-congruence {b} {.b} {d} reflexivity = reflexivity
or-left-congruence {b} {c} {d} (symmetry eq) = symmetry (or-left-congruence eq)
or-left-cong... |
{-# OPTIONS --without-K --exact-split #-}
module 11-function-extensionality where
import 10-truncation-levels
open 10-truncation-levels public
-- Section 9.1 Equivalent forms of Function Extensionality.
-- We first define the types Funext, Ind-htpy, and Weak-Funext.
htpy-eq :
{i j : Level} {A : UU i} {B : A → U... |
{-# OPTIONS --without-K --safe #-}
open import Categories.Category
-- the usual notion requires C to have finite limits.
-- this definition is a generalization by omitting that requirement as the definition
-- itself does not involve any limit.
module Categories.Diagram.SubobjectClassifier {o ℓ e} (C : Category o ℓ e... |
------------------------------------------------------------------------
-- The Agda standard library
--
-- Properties related to negation
------------------------------------------------------------------------
module Relation.Nullary.Negation where
open import Relation.Nullary
open import Relation.Unary
open import... |
{-# OPTIONS --without-K #-}
module hott where
open import hott.level public
open import hott.equivalence public
open import hott.univalence public
-- open import hott.truncation public
|
postulate
A : Set
data B (a : A) : Set where
conB : B a → B a
data C (a : A) : B a → Set where
conC : (b : B a) → C a (conB b)
goo : (a1 a2 a3 : A) (c : C a1 _) → Set
goo a1 a2 a3 (conC b) = {!!}
|
------------------------------------------------------------------------
-- The Agda standard library
--
-- Sublist-related properties
------------------------------------------------------------------------
{-# OPTIONS --without-K --safe #-}
module Data.List.Relation.Binary.Sublist.Propositional.Disjoint
{a} {A : ... |
{-# OPTIONS --safe #-}
open import Definition.Typed.EqualityRelation
module Definition.LogicalRelation.Substitution.MaybeEmbed {{eqrel : EqRelSet}} where
open EqRelSet {{...}}
open import Definition.Untyped
open import Definition.LogicalRelation
open import Definition.LogicalRelation.Irrelevance
open import Definiti... |
module WeakArrows where
open import Library
open import Categories
record Arrow {l m}(J : Cat {l}{m}) : Set (lsuc (l ⊔ m)) where
constructor arrow
open Cat J
field R : Obj → Obj → Set m
pure : ∀{X Y} -> Hom X Y -> R X Y
_<<<_ : ∀{X Y Z} → R Y Z -> R X Y -> R X Z
alaw1 : ∀{X Y Z}... |
{-# OPTIONS --without-K #-}
module PiLevel1 where
open import Data.Unit using (⊤; tt)
open import Relation.Binary.Core using (IsEquivalence)
open import Relation.Binary.PropositionalEquality using (_≡_; refl; subst; sym; [_])
open import PiU using (U; ZERO; ONE; PLUS; TIMES)
open import PiLevel0
-- hiding triv≡ ce... |
{-# OPTIONS --without-K #-}
{- *** Definition 5.3 and Lemma 5.5 are taken from the library ***
*** Corollary 6.8 is too trivial a consequence of -}
{- ConnectednessAlt and the last submodule of Connection are the
only modules importing real truncation types from the library.
Except for that, Univalence is th... |
module +-example where
import Relation.Binary.PropositionalEquality as Eq
open Eq using (_≡_)
open Eq.≡-Reasoning using (begin_; _≡⟨⟩_; _∎)
open import Naturals using (suc; _+_)
+-example : 3 + 4 ≡ 7
+-example =
begin
3 + 4
≡⟨⟩
suc (2 + 4)
≡⟨⟩
suc (suc (1 + 4))
≡⟨⟩
suc (suc (suc (0 + 4)))
≡⟨... |
------------------------------------------------------------------------
-- The Agda standard library
--
-- Vectors where all elements satisfy a given property
------------------------------------------------------------------------
{-# OPTIONS --without-K --safe #-}
module Data.Vec.Relation.Unary.All where
open imp... |
-- Andreas, 2015-07-22 Fixed bug in test for empty type of sizes
{-# OPTIONS --copatterns #-}
open import Common.Size
record U (i : Size) : Set where
coinductive
field out : (j : Size< i) → U j
open U
fixU : {A : Size → Set} (let C = λ i → A i → U i)
→ ∀ i (f : ∀ i → (∀ (j : Size< i) → C j) → C i) → C i
out ... |
{- Byzantine Fault Tolerant Consensus Verification in Agda, version 0.9.
Copyright (c) 2021, Oracle and/or its affiliates.
Licensed under the Universal Permissive License v 1.0 as shown at https://opensource.oracle.com/licenses/upl
-}
module Dijkstra.Syntax where
open import Dijkstra.EitherD
open import Dijkst... |
open import Agda.Builtin.Nat
foo : Nat → Nat
foo x = bar x
where
bar : Nat → Nat
bar y = {!x!}
-- WAS: Splitting on x produces the following garbage:
-- foo : Nat → Nat
-- foo x = bar x
-- where
-- bar : Nat → Nat
-- bar y = {!!}
-- bar y = {!!}
-- SHOULD: raise an error
|
module Numeral.Natural.Relation.Divisibility.Proofs where
import Lvl
open import Data
open import Data.Tuple as Tuple using (_⨯_ ; _,_)
open import Functional
open import Logic.Propositional
open import Logic.Propositional.Theorems
open import Logic.Predicate
open import Logic.Predicate.Theorems
open import Numeral.Fi... |
open import Nat
open import Prelude
open import List
open import contexts
open import judgemental-erase
open import lemmas-matching
open import moveerase
open import sensibility
open import statics-core
open import synth-unicity
module statics-checks where
-- these three judmgements lift the action semantics judgeme... |
module SubstantiveDischargeIsReflexive where
open import HasSubstantiveDischarge
record SubstantiveDischargeIsReflexive (A : Set) ⦃ _ : HasSubstantiveDischarge A A ⦄ : Set₁
where
field
≽-reflexive : (x : A) → x ≽ x
{-
record SubstantiveDischargeIsReflexive (A : Set) : Set₁
where
field
overlap ⦃ hasSub... |
-- Andreas, 2017-10-09, issue #2576
-- Duplicate definition should be reported as such,
-- not as "Missing type signature."
data ⊥ : Set where
data ⊥ where
-- Error was: Missing type signature for ⊥
-- Error was: Duplicate definition of module ⊥ (fixed 2019-07-07)
-- Expected error: Multiple definitions of ⊥
|
------------------------------------------------------------------------
-- The Agda standard library
--
-- Properties related to Fin, and operations making use of these
-- properties (or other properties not available in Data.Fin)
------------------------------------------------------------------------
{-# OPTIONS --... |
{-# OPTIONS --cubical #-}
open import Agda.Primitive.Cubical
open import Agda.Builtin.Cubical.Path
open import Agda.Builtin.Sigma
data S1 : Set where
base : S1
loop : base ≡ base
data Torus : Set where
point : Torus
line1 : point ≡ point
line2 : point ≡ point
square : PathP (λ i → line1 i ≡ line1 i) line2... |
------------------------------------------------------------------------------
-- Issue in the translation
------------------------------------------------------------------------------
{-# OPTIONS --exact-split #-}
{-# OPTIONS --no-sized-types #-}
{-# OPTIONS --no-universe-polymorphism #-}
{-# ... |
open import Agda.Primitive
open import Agda.Builtin.Nat
Type : (i : Level) -> Set (lsuc i)
Type i = Set i
postulate
P : (i : Level) (A : Type i) → A → Type i
postulate
lemma : (a : Nat) -> P _ _ a
|
{-# OPTIONS --cubical --no-import-sorts --safe #-}
module Cubical.HITs.ListedFiniteSet.Properties where
open import Cubical.Foundations.Prelude
open import Cubical.HITs.ListedFiniteSet.Base
private
variable
A : Type₀
_++_ : ∀ (xs ys : LFSet A) → LFSet A
[] ++ ys = ys
(x ∷ xs) ++ ys... |
module Data.QuadTree.Implementation.DataLenses where
open import Haskell.Prelude renaming (zero to Z; suc to S)
open import Data.Lens.Lens
open import Data.Logic
open import Data.QuadTree.Implementation.PropDepthRelation
open import Data.QuadTree.Implementation.Definition
open import Data.QuadTree.Implementation.Valid... |
{-# OPTIONS --cubical --no-import-sorts --safe #-}
module Cubical.Data.Unit.Base where
open import Cubical.Foundations.Prelude
-- Obtain Unit
open import Agda.Builtin.Unit public
renaming ( ⊤ to Unit )
-- Universe polymorphic version
Unit* : {ℓ : Level} → Type ℓ
Unit* = Lift Unit
pattern tt* = lift tt
-- Universe... |
{-# OPTIONS --without-K #-}
module PiLevel0 where
open import Relation.Binary.PropositionalEquality
using (_≡_; refl; cong₂; module ≡-Reasoning)
-- using (_≡_; refl; sym; trans; cong₂; proof-irrelevance; module ≡-Reasoning)
--open import Data.Nat.Properties.Simple
-- using (+-right-identity; +-suc; +-assoc; +-co... |
module Prelude.Alternative where
open import Agda.Primitive
open import Prelude.Bool
open import Prelude.Maybe
open import Prelude.List
open import Prelude.Sum
open import Prelude.Decidable
open import Prelude.Functor
open import Prelude.Applicative
open import Prelude.Function
open import Prelude.Monoid
module _ {a... |
{-# OPTIONS --allow-unsolved-metas #-}
open import Agda.Builtin.Nat
record R : Set where
field
r₁ : Nat
r₂ : Nat
open R
h : (n : Nat) → R
r₁ (h zero) = {!!}
r₂ (h zero) = {!!}
h (suc n) = {!!}
|
------------------------------------------------------------------------------
-- Agda-Prop Library.
-- Classical Propositional Logic.
------------------------------------------------------------------------------
open import Data.Nat using ( ℕ )
module Data.PropFormula.Theorems.Classical ( n : ℕ ) where
-----------... |
open import Coinduction using ( ♭ )
open import Relation.Binary.PropositionalEquality using ( _≡_ ; refl )
open import System.IO.Transducers.Lazy using ()
renaming ( done to doneL ; _⟫_ to _⟫L_ )
open import System.IO.Transducers.Strict using ()
renaming ( done to doneS ; _⟫_ to _⟫S_ )
open import System.IO.Transdu... |
{-# OPTIONS --cubical --no-import-sorts --safe #-}
module Cubical.HITs.Rationals.SigmaQ.Properties 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 impor... |
{-# OPTIONS --rewriting #-}
module Luau.RuntimeError.ToString where
open import Agda.Builtin.Float using (primShowFloat)
open import FFI.Data.String using (String; _++_)
open import Luau.RuntimeError using (RuntimeErrorᴮ; RuntimeErrorᴱ; local; return; FunctionMismatch; BinOpMismatch₁; BinOpMismatch₂; UnboundVariable;... |
module DeadCodePatSyn.Lib where
private
data Hidden : Set where
hidden : Hidden
pattern not-hidden = hidden
|
open import Data.Product using (∃; ∃-syntax; _×_; _,_)
open import DeBruijn
open import Parallel
open import Beta
open import Takahashi
par-triangle : ∀ {n} {M N : Term n}
→ M ⇉ N
-------
→ N ⇉ M *
par-triangle {M = # x} ⇉-c = ⇉-c
par-triangle {M = ƛ M} (⇉-ƛ M⇉N) = ⇉-ƛ (par-triangle M⇉N)
par-triangle {M = (ƛ... |
module Issue1258 where
data _==_ {A : Set}(x : A) : A -> Set where
refl : x == x
data Bool : Set where
true false : Bool
postulate f : (A : Set) -> A -> Bool
Foo : Bool -> Set
Foo true = Bool
Foo false = Bool
Alpha : Bool
Beta : Foo Alpha
test : f (Foo Alpha) Beta == f Bool false
Alpha = _
Beta = Alpha
test ... |
module non-regular where
open import Data.Nat
open import Data.Empty
open import Data.List
open import Data.Maybe hiding ( map )
open import Relation.Binary.PropositionalEquality hiding ( [_] )
open import logic
open import automaton
open import automaton-ex
open import finiteSetUtil
open import finiteSet
open import ... |
{-# OPTIONS --no-qualified-instances #-}
module CF.Transform.UnCo where
open import Data.Product
open import Data.List
open import Data.List.Relation.Unary.All
open import Data.List.Membership.Propositional
open import Relation.Unary hiding (_∈_)
open import Relation.Binary.PropositionalEquality hiding ([_])
open imp... |
-- Andreas, 2014-09-02
-- Up to today, there was no implementation of shadowing local variables
-- (e.g., λ-bound variables) by local imports.
-- {-# OPTIONS -v scope.locals:10 #-}
module _ where
module M where
A = Set1
test : (A : Set) → let open M in A
test A = Set
-- The A exported by M is in competition wit... |
import Imports.Issue5357-B
import Imports.Issue5357-C
|
{-# OPTIONS --universe-polymorphism #-}
module WrongMetaLeft where
open import Imports.Level
postulate
∃₂ : ∀ {a c : Level} {A : Set a} {B : Set}
(C : A → B → Set c) → Set (a ⊔ c)
proj₂ : ∀ {a c}{A : Set a}{B : Set}{C : A → B → Set c} → ∃₂ {a}{c}{A}{B} C → B
postulate
Position : Set
Result : Set
... |
{-# OPTIONS --universe-polymorphism #-}
module LLev where
--****************
-- Universe polymorphism
--****************
data Level : Set where
ze : Level
su : Level -> Level
{-# BUILTIN LEVEL Level #-}
{-# BUILTIN LEVELZERO ze #-}
{-# BUILTIN LEVELSUC su #-}
max : Level -> Level -> Level
max ... |
postulate
A : Set
a : A
data D : Set where
d : D
data E : Set where
e₀ : E
e₁ : E → E
e₂ : E → E → E
_[_] : E → E → E
e₀ [ y ] = y
e₁ x [ y ] = e₁ x
e₂ x₁ x₂ [ y ] = e₂ (x₁ [ y ]) (x₂ [ y ])
data P : E → Set where
p₁ : ∀ x₁ x₂ → P x₁ → P x₂ → P (e₂ x₁ x₂)
p₂ : ∀ x → P (x [ e₁ x ]) → P (e₁... |
------------------------------------------------------------------------
-- The Agda standard library
--
-- Semi-heterogeneous vector equality
------------------------------------------------------------------------
module Data.Vec.Equality where
open import Data.Vec
open import Data.Nat using (suc)
open import Funct... |
open import Agda.Builtin.Nat
open import Agda.Builtin.Strict
foo : Nat → Nat
foo n = primForce (n + n) (λ _ → 0)
-- Don't get rid of the seq!
|
module Lec6 where
open import CS410-Prelude
open import CS410-Functor
open import CS410-Monoid
open import CS410-Nat
data Maybe (X : Set) : Set where
yes : X -> Maybe X
no : Maybe X
maybeFunctor : Functor Maybe
maybeFunctor = record
{ map = \ { f (yes x) -> yes (f x)
; f no -> no
... |
module Issue4267.A0 where
record RA0 : Set₁ where
field
A : Set
|
{-# OPTIONS --cubical --no-import-sorts #-}
module Number.InclusionModules where
import Number.Postulates
import Number.Inclusions
-- NOTE: the following takes a very long time to typecheck
-- see https://lists.chalmers.se/pipermail/agda-dev/2015-September/000201.html
-- see https://github.com/agda/agda/issues/1646
... |
------------------------------------------------------------------------
-- The Agda standard library
--
-- Conversion of binary operators to binary relations via the right
-- natural order.
------------------------------------------------------------------------
{-# OPTIONS --without-K --safe #-}
open import Relatio... |
-- Andreas, 2011-10-06
module Issue483b where
data _≡_ {A : Set}(a : A) : A → Set where
refl : a ≡ a
postulate
A : Set
f : .A → A
test : let X : .A → A
X = _
in .(x : A) → X (f x) ≡ f x
test x = refl
-- this gave an internal error before because X _ = f x
-- was solved by X = λ _ → f __IMPOS... |
{-
USES WITH
-}
{-
A simple bidirectional type checker for simply typed lambda calculus which is
sound by construction.
-}
module SimpleTypes where
infix 10 _==_
data _==_ {A : Set}(x : A) : A -> Set where
refl : x == x
data Maybe (A : Set) : Set where
nothing : Maybe A
just : A -> Maybe A
data Nat... |
module Prelude.Applicative.Indexed {i} {I : Set i} where
open import Agda.Primitive
open import Prelude.Unit
open import Prelude.Functor
open import Prelude.Function
open import Prelude.Equality
open import Prelude.Number
open import Prelude.Semiring
open import Prelude.Fractional
record IApplicative {a b} (F : I → ... |
------------------------------------------------------------------------
-- A very brief treatment of different kinds of term equivalences,
-- including contextual equivalence and applicative bisimilarity
------------------------------------------------------------------------
module Lambda.Closure.Equivalences where
... |
open import Data.Product using ( _×_ ; _,_ )
open import Relation.Unary using ( _∈_ )
open import Web.Semantic.DL.Role using ( Role ; ⟨_⟩ ; ⟨_⟩⁻¹ )
open import Web.Semantic.DL.Signature using ( Signature )
open import Web.Semantic.DL.TBox.Interp using ( Interp ; Δ ; rol ; _⊨_≈_ ; rol-≈ ; ≈-refl ; ≈-sym )
open import We... |
-- Andreas, 2017-07-13, issue #2645
-- Agda accepted this definition:
record S : Set₁ where
postulate
field
f : Set -- Now: error raised here
s : Set → S
s A = record {f = A }
|
-- Σ type (also used as existential) and
-- cartesian product (also used as conjunction).
{-# OPTIONS --without-K --safe #-}
module Tools.Product where
open import Data.Product public using (Σ; ∃; ∃₂; _×_; _,_; proj₁; proj₂)
|
{-# OPTIONS --without-K --exact-split #-}
module 05-identity-types where
import 04-inductive-types
open 04-inductive-types public
-- Section 5.1
-- Definition 5.1.1
{- We introduce the identity type. -}
data Id {i : Level} {A : UU i} (x : A) : A → UU i where
refl : Id x x
{- In the following definition we give... |
-- There was a bug when postponing a type checking problem under
-- a non-empty context. Fixed now.
module PostponedTypeChecking where
data Unit : Set where
unit : Unit
record R : Set where
field f : Unit
data *_ (A : Set) : Set where
<_> : A -> * A
get : {A : Set} -> * A -> A
get < x > = x
mk : Unit -> Unit... |
{-# OPTIONS --without-K #-}
-- Lifting the dependent axiom of choice to sums and products
open import Type
open import Function.NP
open import Function.Extensionality
open import Data.Nat
open import Data.Product
open import Data.Fin using (Fin)
open import Explore.Core
open import Explore.Properties
open import Relat... |
module FFI.Data.ByteString where
{-# FOREIGN GHC import qualified Data.ByteString #-}
postulate ByteString : Set
{-# COMPILE GHC ByteString = type Data.ByteString.ByteString #-}
|
module BadRefl where
open import AgdaPrelude
plus =
natElim
( \ _ -> Nat -> Nat ) -- motive
( \ n -> n ) -- case for Zero
( \ p rec n -> Succ (rec n) ) -- case for Succ
-- the other direction requires induction on N:
postulate pNPlus0isN : (n : Nat) -> Eq Nat (plus n Zero... |
data ⊥ : Set where -- keep this on the first line!!
Type = Set -- This should not be gobbled up under the data declaration
-- Andreas, 2021-04-15, issue #1145
-- Allow stacking of layout keywords on the same line.
-- This files contains tests for the new layout rules
-- and also tests from debugging the original im... |
{-# OPTIONS --copatterns #-}
module examplesPaperJFP.ExampleDrawingProgram where
open import Size
open import Data.Bool.Base
open import Data.Char.Base
open import Data.Nat.Base hiding (_⊓_; _+_; _*_)
open import Data.List.Base hiding (_++_)
open import Data.Integer.Base hiding (suc)
open import Data.String.Base
open... |
-- Andreas, 2015-08-18 Test case for COMPILED_DATA on record
-- open import Common.String
open import Common.IO
infixr 4 _,_
infixr 2 _×_
record _×_ (A B : Set) : Set where
constructor _,_
field
proj₁ : A
proj₂ : B
open _×_ public
{-# COMPILED_DATA _×_ (,) (,) #-}
-- Note: could not get this to work f... |
module TooManyFields where
postulate X : Set
record D : Set where
field x : X
d : X -> D
d x = record {x = x; y = x}
|
module FRP.JS.Level where
infixl 6 _⊔_
postulate
Level : Set
zero : Level
suc : Level → Level
_⊔_ : Level → Level → Level
{-# COMPILED_JS zero 0 #-}
{-# COMPILED_JS suc function(x) { return x + 1; } #-}
{-# COMPILED_JS _⊔_ function(x) { return function(y) { return Math.max(x,y); }; } #-}
{-# BUILTIN ... |
module CoPatWith where
data Maybe (A : Set) : Set where
nothing : Maybe A
just : A -> Maybe A
data _×_ (A B : Set) : Set where
_,_ : A -> B -> A × B
record CoList (A : Set) : Set where
constructor inn
field
out : Maybe (A × CoList A)
open CoList
module With where
map : {A B : Set}(f : A -> B)(l... |
module _ where
open import Common.Prelude hiding (_>>=_)
open import Common.Reflection
infix -100 This:_ this:_
data This:_ {a} {A : Set a} : A → Set where
this:_ : ∀ x → This: x
macro
runT : Tactic → Tactic
runT m = m
evalT : ∀ {a} {A : Set a} → TC A → Tactic
evalT m hole = m >>= quoteTC >>= unify hole
... |
open import Prelude
open import Level using (_⊔_; Lift; lift) renaming (suc to ls; zero to lz)
open import Data.String using (String)
open import Data.Maybe using (Maybe; nothing; just)
open import Data.Nat using (_≤_)
open import RW.Data.RTrie.Decl
module RW.Data.RTrie.Lookup
where
postulate
trie-err : ... |
module _ where
open import Agda.Builtin.Bool
open import Agda.Builtin.Equality
postulate
A : Set
f : .A → A
g : A → A
mutual
X : Bool → .A → A
X = _
Y : .A → A → A
Y = _ -- should be solved!
foo : .(x : A) {y : A} → X true x ≡ g (Y x y)
foo _ = refl
-- this prunes both x and y from Y,
-- so ... |
------------------------------------------------------------------------
-- Some derivable properties
------------------------------------------------------------------------
open import Algebra
module Algebra.Props.Ring (r : Ring) where
open Ring r
import Relation.Binary.EqReasoning as EqR; open EqR setoid
open imp... |
module Container.Foldable where
open import Prelude
record Foldable {a b w} (F : Set a → Set b) : Set (lsuc w ⊔ lsuc a ⊔ b) where
field
foldMap : ∀ {A}{W : Set w} {{MonW : Monoid W}} → (A → W) → F A → W
overlap {{super}} : Functor F
open Foldable {{...}} public
fold : ∀ {a w} {W : Set w} {F : Set w → Set... |
module Bin where
open import Relation.Binary.PropositionalEquality using (_≡_; refl)
open import Naturals using (ℕ; zero; suc; _+_; _*_)
-- 2進数の表現
data Bin : Set where
⟨⟩ : Bin
_O : Bin → Bin
_I : Bin → Bin
-- 2進数のインクリメント
inc : Bin → Bin
inc ⟨⟩ = ⟨⟩ I
inc (b O) = b I
inc (b I) = inc b O
_ : inc (⟨⟩ I O I ... |
module TypeConstructorsWhichPreserveGuardedness3 where
record ⊤ : Set where
data _⊎_ (A B : Set) : Set where
inj₁ : A → A ⊎ B
inj₂ : B → A ⊎ B
-- This should not be allowed.
ℕ : Set
ℕ = ⊤ ⊎ ℕ
|
module plfa.Induction where
import Relation.Binary.PropositionalEquality as Eq
open Eq using (_≡_; refl; cong; sym)
open Eq.≡-Reasoning using (begin_; _≡⟨⟩_; _≡⟨_⟩_ ;_∎)
open import Data.Nat using (ℕ; zero; suc; _+_; _*_; _∸_; _^_)
-- @practice: exercise `operators` start
--
-- 1. _+_ _*_: Unit (Zero), Associativity... |
{-# OPTIONS --safe #-}
module Cubical.Algebra.Polynomials.UnivariateFun.Base where
open import Cubical.Algebra.CommRing.Instances.Polynomials.UnivariatePolyFun public
{-
The Univariate Functional Polynomials over a CommRing A is a CommRing.
The base type is define using almost null sequences ie functions.
This defin... |
{-
Part 2: Transport and composition
• Cubical transport
• Subst as a special case of cubical transport
• Path induction from subst
• Homogeneous composition (hcomp)
• Binary composition of paths as special case of hcomp
-}
{-# OPTIONS --cubical #-}
module Part2 where
open import Part1
-- While path types are gre... |
module GUIgeneric.loadAllRepository where
open import GUIgeneric.GUI
open import GUIgeneric.GUIDefinitions
open import GUIgeneric.GUIExample
open import GUIgeneric.GUIExampleBankAccount
open import GUIgeneric.GUIExampleLib
open import GUIgeneric.GUIFeatures
open import GUIgeneric.GUIFeaturesPart2
open import GUIgeneri... |
{-# OPTIONS --without-K --rewriting #-}
open import HoTT
module homotopy.SuspensionLoopSpaceInverse where
{- corollary about inversion in ⊙Trunc k (⊙Ω (⊙Susp (de⊙ X))) -}
private
custom-path-alg : ∀ {l} {A : Type l}
{n s : A} (p q : n == s)
→ ! (p ∙ ! q) == ! (! q) ∙ (! p ∙ q) ∙' ! q
custom-path-alg p q@... |
{-# OPTIONS --cubical --safe #-}
module Cubical.Structures.Monoid where
open import Cubical.Foundations.Prelude
open import Cubical.Foundations.Equiv
open import Cubical.Foundations.HLevels
open import Cubical.Data.Prod.Base hiding (_×_) renaming (_×Σ_ to _×_)
open import Cubical.Foundations.SIP renaming (SNS-PathP t... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.