text stringlengths 4 690k |
|---|
{-# OPTIONS --prop --rewriting #-}
module Examples.Gcd.Clocked where
open import Calf.CostMonoid
import Calf.CostMonoids as CM
open import Calf CM.ℕ-CostMonoid
open import Calf.Types.Nat
open import Data.Nat using (_≤_; z≤n)
open import Calf.Types.Unit
open import Calf.Types.Bounded CM.ℕ-CostMonoid
open import Calf.... |
{-# OPTIONS --exact-split #-}
{-# OPTIONS --no-sized-types #-}
{-# OPTIONS --no-universe-polymorphism #-}
{-# OPTIONS --without-K #-}
module LeibnizEquality where
------------------------------------------------------------------------------
-- The identity type.
data _≡_ {A : Se... |
{-# OPTIONS --without-K --safe #-}
-- Definition of Pi with fractionals
module PiFrac where
-- From the standard library:
open import Data.Empty using (⊥)
open import Data.Unit using (⊤; tt)
open import Data.Sum using (_⊎_; inj₁; inj₂)
open import Data.Product using (_×_; _,_; proj₁; proj₂)
open import Relation.Bina... |
open import Web.Semantic.DL.Signature using ( Signature )
open import Web.Semantic.DL.TBox using ( TBox )
import Web.Semantic.DL.Category.Composition
import Web.Semantic.DL.Category.Morphism
import Web.Semantic.DL.Category.Object
import Web.Semantic.DL.Category.Properties
import Web.Semantic.DL.Category.Tensor
import ... |
------------------------------------------------------------------------
-- The Agda standard library
--
-- Explaining how to use the inspect idiom and elaborating on the way
-- it is implemented in the standard library.
------------------------------------------------------------------------
{-# OPTIONS --without-K -... |
-- named arguments should be allowed in module applications
module Issue420 where
module M {A : Set₁} where
open M {A = Set}
|
{-# OPTIONS --without-K --safe #-}
module Data.Bool.Base where
open import Level
open import Agda.Builtin.Bool using (Bool; true; false) public
open import Data.Unit
bool : ∀ {ℓ} {P : Bool → Type ℓ} (f : P false) (t : P true) → (x : Bool) → P x
bool f t false = f
bool f t true = t
{-# INLINE bool #-}
bool′ : A → A ... |
module sn-calculus-compatconf.in-lift where
open import sn-calculus-compatconf.base
open import sn-calculus
open import utility renaming (_U̬_ to _∪_)
open import context-properties
using (get-view ; wrap-rho ; unwrap-rho
; ->E-view ; E-view-main-bind ; _a~_
; ->E-view-term ; ->E-view-inner-term ; don... |
-- Modified: Andreas, 2011-04-11 freezing metas, removed unused uni.poly
{-# OPTIONS --guardedness-preserving-type-constructors #-}
module UnusedArgsInPositivity where
open import Common.Coinduction
module Ex₁ where
data Unit : Set where
unit : Unit
unused : Set → Unit → Set → Set
unused X unit Y = Y
... |
{-# OPTIONS --without-K #-}
module M-types.Base.Axiom where
open import M-types.Base.Core public
open import M-types.Base.Sum public
open import M-types.Base.Prod public
open import M-types.Base.Eq public
open import M-types.Base.Equi public
postulate
funext-axiom : {X : Ty ℓ₀} {Y : ... |
{-# OPTIONS --without-K --safe #-}
module Dodo.Binary.Product where
-- Stdlib imports
open import Level using (Level; _⊔_)
open import Function using (flip)
open import Data.Product using (_×_; _,_; map₁; map₂)
open import Relation.Unary using (Pred; _∈_)
open import Relation.Binary using (REL; Rel)
-- Local imports
... |
------------------------------------------------------------------------
-- A memoising backend
------------------------------------------------------------------------
-- This code has bitrotted.
-- Following Frost/Szydlowski and Frost/Hafiz/Callaghan (but without
-- the left recursion fix). An improvement has been ... |
{-# OPTIONS --cubical-compatible --rewriting --confluence-check #-}
postulate
_↦_ : {A : Set} → A → A → Set
{-# BUILTIN REWRITE _↦_ #-}
data _==_ {A : Set} (a : A) : A → Set where
idp : a == a
PathOver : {A : Set} (B : A → Set)
{x y : A} (p : x == y) (u : B x) (v : B y) → Set
PathOver B idp u v = (u == v)
inf... |
------------------------------------------------------------------------
-- The Agda standard library
--
-- Some derivable properties
------------------------------------------------------------------------
open import Algebra
module Algebra.Properties.Ring {r₁ r₂} (R : Ring r₁ r₂) where
import Algebra.Properties.Ab... |
{-# OPTIONS --safe --experimental-lossy-unification #-}
module Cubical.Algebra.Polynomials.Multivariate.EquivCarac.An[X]X-A where
open import Cubical.Foundations.Prelude
open import Cubical.Foundations.Function
open import Cubical.Foundations.Equiv
open import Cubical.Foundations.Isomorphism
open import Cubical.Data.... |
open import Categories
open import Functors
open import RMonads
module RMonads.CatofRAdj.TermRAdjHom {a b c d}{C : Cat {a}{b}}{D : Cat {c}{d}}
{J : Fun C D}(M : RMonad J) where
open import Library
open import RAdjunctions
open import RMonads.CatofRAdj M
open import Categories.Term... |
{-# OPTIONS --cubical --no-import-sorts --no-exact-split --safe #-}
module Cubical.Data.NatMinusOne.Base where
open import Cubical.Core.Primitives
open import Cubical.Data.Nat
open import Cubical.Data.Empty
record ℕ₋₁ : Type₀ where
constructor -1+_
field
n : ℕ
pattern neg1 = -1+ zero
pattern ℕ→ℕ₋₁ n = -1+ (s... |
{-# OPTIONS --without-K --rewriting #-}
open import HoTT
open import cohomology.ChainComplex
open import cohomology.Theory
open import groups.KernelImage
open import cw.CW
module cw.cohomology.ReconstructedCohomologyGroups {i : ULevel} (OT : OrdinaryTheory i) where
open OrdinaryTheory OT
open import cw.cohomolog... |
module Qsort where
open import Sec4 -- The module with definition of propositions
import Sec2
-- postulate needed for ≤ on A
postulate leq : {A : Set} → A → A → Prop
postulate geq : {A : Set} → A → A → Prop
postulate tot-list : {A : Set} → (a b : A) → (leq a b) ∨ (leq b a)
postulate trans-list : {A : ... |
-- Andreas, 2021-07-25, issue #5478 reported by mrohman
{-# OPTIONS --allow-unsolved-metas #-}
{-# OPTIONS --double-check #-}
-- {-# OPTIONS -v impossible:70 #-}
-- {-# OPTIONS -v tc:20 #-}
-- {-# OPTIONS -v tc.interaction:30 #-}
-- {-# OPTIONS -v tc.meta:25 #-}
-- {-# OPTIONS -v tc.rec:20 #-}
-- {-# OPTIONS -v tc.cc... |
-- Scenario:
-- * start with B only
-- * write 'f B = B'
-- * add constructor A
-- * want to deal with it first to preserve alphabetical ordering of clauses
-- * add 'f t = ?' *above* 'f B = B'
-- WAS: split t, get A and B
-- WANT: split t, get A only
data Type : Set where
A B : Type
f : Type → Type
f t = {!!... |
{-# OPTIONS --without-K --rewriting #-}
open import HoTT
open import cohomology.Theory
open import groups.ExactSequence
open import groups.HomSequence
open import homotopy.CofiberSequence
module cohomology.LongExactSequence {i} (CT : CohomologyTheory i)
{X Y : Ptd i} (n : ℤ) (f : X ⊙→ Y) where
open CohomologyTheor... |
{-# OPTIONS --erased-cubical #-}
open import Agda.Builtin.Bool
open import Agda.Builtin.Cubical.Path
open import Agda.Primitive
open import Agda.Primitive.Cubical
private
variable
a p : Level
A : Set a
P : A → Set p
x y : A
refl : x ≡ x
refl {x = x} = λ _ → x
subst : (P : A → Set p) → x ≡ y → ... |
module Issue3879.Fin where
open import Agda.Builtin.Nat
data Fin : Nat → Set where
zero : ∀ {n} → Fin (suc n)
suc : ∀ {n} → Fin n → Fin (suc n)
pattern 0F = zero
|
module UnifyTerm where
open import Data.Fin using (Fin; suc; zero)
open import Data.Nat using (ℕ; suc; zero)
open import Relation.Binary.PropositionalEquality using (_≡_; refl; cong₂; cong; sym; trans)
open import Function using (_∘_)
open import Relation.Nullary using (¬_; Dec; yes; no)
open import Data.Product usin... |
open import Function.Equivalence as FE using ()
open import Relation.Nullary using (yes; no)
open import Relation.Nullary.Negation using (contradiction)
open import Relation.Nullary.Product using (_×-dec_)
open import Relation.Nullary.Decidable using (False; map)
open import Relation.Binary using (Decidable)
open impor... |
-- Andreas, 2017-12-04, issue #2862, reported by m0davis, case for records
-- Regression in development version 2.5.4
-- Scope checker allowed definition in different module than signature
module _ where
module N where
record R : Set where
open N hiding (module R)
module M where
record R where -- should be re... |
{-# OPTIONS --universe-polymorphism #-}
module NoPanic where
postulate
Level : Set
lzero : Level
lsuc : Level → Level
{-# BUILTIN LEVEL Level #-}
{-# BUILTIN LEVELZERO lzero #-}
{-# BUILTIN LEVELSUC lsuc #-}
module M {A : Set} where
postulate
I : A → ∀ a → Set a
i : ∀ (x : A) {a} → I x a
... |
module Ual.Ord where
open import Agda.Primitive
open import Ual.Void
open import Ual.Eq
open import Ual.Either
open import Ual.Both
record Ord {a} (A : Set a) : Set (lsuc a) where
infix 30 _<_
infix 30 _>_
infix 30 _≤_
infix 30 _≥_
field
⦃ eqA ⦄ : Eq A
_<_ : A → A → Set
_>_ : A → A → Se... |
record R : Set₁ where
field
⟨_+_⟩ : Set
open R
-- Name parts coming from projections can not be used as part of
-- variables.
F : Set → Set
F + = +
|
------------------------------------------------------------------------
-- IO
------------------------------------------------------------------------
{-# OPTIONS --without-K #-}
module IO-monad where
open import Monad.Raw
open import Prelude
open import String
-----------------------------------------------------... |
{-# OPTIONS --cubical-compatible #-}
{-# OPTIONS --allow-unsolved-metas #-}
-- This issue demonstrates that a failing termination check,
-- subsequently blocking reductions, makes some `impossible'
-- cases possible in the conversion checker.
module Issue921 where
infix 3 _==_
postulate
_==_ : {A : Set} → A → A → ... |
open import Relation.Binary.Core
module InsertSort.Impl2.Correctness.Permutation.Base {A : Set}
(_≤_ : A → A → Set)
(tot≤ : Total _≤_) where
open import Bound.Lower A
open import Bound.Lower.Order _≤_
open import Data.List
open import Data.Sum
open import InsertSort.Impl2 _≤_ tot≤
... |
module Issue731 where
data empty : Set where
foo : empty → _
foo ()
bar : empty → Set
bar = foo
{- But when I want to know what are the constraints (C-c C-= in
emacs), I get the following error instead:
No binding for builtin thing LEVELZERO, use {-# BUILTIN LEVELZERO
name #-} to bind it to 'name'
when checking th... |
record R : Set₁ where
field
A : Set
open R ⦃ … ⦄
-- The inferred type of A is ⦃ r : R ⦄ → Set. However, the following
-- code is rejected:
X : R → Set
X r = A ⦃ r = r ⦄
-- WAS: Function does not accept argument ⦃ r = r ⦄
-- when checking that ⦃ r = r ⦄ is a valid argument to a function of
-- type ⦃ r = r₁ : ... |
-- 2017-11-01, issue #2668 reported by brprice
--
-- This seems to have been fixed in 2.5.3 (specifically, commit
-- 8518b8e seems to have solved this, along with #2727 and #2726)
-- {-# OPTIONS -v tc.mod.apply:20 #-}
-- {-# OPTIONS -v tc.proj.like:40 #-}
-- {-# OPTIONS -v tc.signature:60 #-}
-- {-# OPTIONS -... |
{-# OPTIONS --without-K --rewriting #-}
open import HoTT
open import cohomology.Theory
open import groups.Exactness
open import groups.HomSequence
open import groups.ExactSequence
open import cw.CW
module cw.cohomology.Descending {i} (OT : OrdinaryTheory i) where
open OrdinaryTheory OT
open import cw.cohomology.Tip... |
module Issue558 where
data Nat : Set where
Z : Nat
S : Nat → Nat
data _≡_ {A : Set} (a : A) : A → Set where
Refl : a ≡ a
plus : Nat → Nat → Nat
plus Z n = n
plus (S n) m = S (plus n m)
record Addable (τ : Set) : Set where
constructor addable
field
_+_ : τ → τ → τ
open module AddableIFS {t : Set} {{r : Ad... |
{-# OPTIONS --rewriting #-}
data Nat : Set where
zero : Nat
suc : Nat → Nat
{-# BUILTIN NATURAL Nat #-}
_+_ : Nat → Nat → Nat
zero + m = m
suc n + m = suc (n + m)
{-# BUILTIN NATPLUS _+_ #-} -- Without this, the internal error disappears.
postulate
_≡_ : Nat → Nat → Set
{-# BUILTIN REWRITE _≡_ #-}
postulate
... |
{-# OPTIONS --safe #-}
module Cubical.Algebra.Ring.Base where
open import Cubical.Foundations.Prelude
open import Cubical.Foundations.Function
open import Cubical.Foundations.Isomorphism
open import Cubical.Foundations.Equiv
open import Cubical.Foundations.HLevels
open import Cubical.Foundations.SIP
open import Cubic... |
module Data.Tree where
open import Data.Tree.Base public
|
{-# OPTIONS --without-K #-}
module sets.nat.ordering.leq where
open import sets.nat.ordering.leq.core public
open import sets.nat.ordering.leq.level public
open import sets.nat.ordering.leq.decide public
|
module InfConj where
open import Data.Bool
open import Data.Sum
open import Relation.Binary.PropositionalEquality
record Stream (A : Set) : Set where
coinductive
constructor _∷_
field
hd : A
tl : Stream A
open Stream public
-- | Partial elements
record D (A : Set) : Set where
coinductive
field step... |
------------------------------------------------------------------------
-- List membership and some related definitions
open import Level using (Level; _⊔_)
open import Relation.Binary
open import Relation.Binary.List.Pointwise as ListEq using ([]; _∷_)
open import Relation.Nullary
open import Data.List
open import Da... |
data ⊤ : Set where tt : ⊤
record R : Set where
constructor r
field .x : ⊤
f : R → R
R.x (f (r x)) = {!x!}
|
-- {-# OPTIONS -v tc.with:40 #-}
id : (A : Set) → A → A
id A = {!id′!}
-- C-c C-h produces: id′ : ∀ {A} → A
-- when it should produce: id′ : ∀ {A} → A → A
f : (A : Set) (B : A → Set) (a : A) → B a
f A B a = {!g A a!}
-- Before: ∀ {A} {B : A → Set} A₁ (a : A₁) → B a
-- After: ∀ A (a : A) {B : A → Set} → B... |
{-# OPTIONS --without-K #-}
open import Base
open import Homotopy.PushoutDef
module Homotopy.PushoutIsPushout {i} (d : pushout-diag i) where
import Homotopy.PushoutUP as PushoutUP
open PushoutUP d (λ _ → unit) -- A B C f g (λ _ → unit)
pushout-cocone : cocone (pushout d)
pushout-cocone = (left , right , glue)
fac... |
{-# OPTIONS -v tc.force:60 #-}
open import Agda.Builtin.Nat
open import Agda.Builtin.List
module _ {a} {A : Set a} where
[_] : A → List A
[ x ] = x ∷ []
data FSet : List A → Set a where
sg : (x : A) → FSet [ x ]
-- ^ should be forced
HOLE : Set
HOLE = {!!} -- just to force make bugs to look... |
module Numeral.Natural.Function.FlooredLogarithm where
open import Data
open import Data.Boolean.Stmt
open import Numeral.Natural
open import Numeral.Natural.Inductions
open import Numeral.Natural.Oper
open import Numeral.Natural.Oper.Comparisons
open import Numeral.Natural.Oper.FlooredDivision
open import Numeral.Nat... |
------------------------------------------------------------------------
-- The Agda standard library
--
-- Natural Literals
------------------------------------------------------------------------
{-# OPTIONS --without-K --safe #-}
module Data.Nat.Literals where
open import Agda.Builtin.FromNat
open import Agda.Bui... |
{-# OPTIONS --without-K --exact-split --safe #-}
module Fragment.Setoid.Morphism.Base where
open import Level using (Level; _⊔_)
open import Function using (_∘_; Congruent)
import Relation.Binary.PropositionalEquality as PE
open import Relation.Binary using (Setoid)
private
variable
a b c ℓ₁ ℓ₂ ℓ₃ : Level
mo... |
{-# OPTIONS --cubical --safe #-}
module Data.Unit.Properties where
open import Data.Unit
open import Prelude
isProp⊤ : isProp ⊤
isProp⊤ _ _ = refl
|
postulate
R : Set → Set1
r : {X : Set} {{ _ : R X }} → X → Set
A : Set
a : A
instance
RI : R A
-- RI = {!!} -- uncommenting lets instance resolution succeed
foo : r a
|
module Numeral.Natural.Relation.Divisibility.Proofs.Product where
open import Data.Tuple
open import Functional
open import Logic
open import Logic.Predicate
open import Logic.Propositional
import Lvl
open import Numeral.Integer
import Numeral.Integer.Oper as ℤ
open import Numeral.Integer.Proofs
import ... |
open import Agda.Primitive
variable
@0 ℓ : Level
A : Set ℓ
levelOf : A → Level
levelOf {a} _ = a
|
module Selective.Examples.Bookstore where
open import Selective.ActorMonad
open import Selective.Libraries.Call using (UniqueTag ; call)
open import Prelude
open import Data.Nat
using ( _≟_ ; pred ; ⌈_/2⌉ ; _≤?_ ; _∸_ ; _≤_ ; z≤n ; s≤s ; _<_ ; _≰_ )
open import Data.Nat.Properties
using (≤-antisym ; ≰⇒>)
open im... |
open import Mockingbird.Forest using (Forest)
-- Is There a Sage Bird?
module Mockingbird.Problems.Chapter10 {b ℓ} (forest : Forest {b} {ℓ}) where
open import Data.Product using (_,_; proj₁; proj₂; ∃-syntax)
open import Function using (_$_)
open import Mockingbird.Forest.Birds forest
open Forest forest
module _ ⦃ ... |
_ : Set
|
module eq-reas-nouni {A : Set} where
open import eq
infix 1 begin_
infixr 2 _equiv[]_ _equiv[_]_
infix 3 _qed
begin_ : ∀ {x y : A}
→ x ≡ y
-----
→ x ≡ y
begin x≡y = x≡y
_equiv[]_ : ∀ (x : A) {y : A}
→ x ≡ y
-----
→ x ≡ y
x equiv[] x≡y = x≡y
_equiv[_]_ : ∀ (x : A) {... |
{- 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
-}
module Haskell.Modules.FunctorApplicativeMonad where
open import Haske... |
module Issue279-4 where
module M (X : Set) where
data R : Set where
r : X → R
postulate
P Q : Set
open M P using (r)
shouldn't-check : M.R Q → Q
shouldn't-check (r q) = q
|
------------------------------------------------------------------------
-- The Agda standard library
--
-- Bisimilarity for Colists
------------------------------------------------------------------------
{-# OPTIONS --without-K --safe --sized-types #-}
module Codata.Colist.Bisimilarity where
open import Level usin... |
module LC.Example where
open import LC.Base
open import LC.Subst
open import LC.Reduction
open import LC.Reasoning
test-1 : ((ƛ var 0) ∙ var 0) β→* ((var 0) [ var 0 ])
test-1 =
begin
(ƛ var 0) ∙ var 0
→⟨ β-ƛ-∙ ⟩
(var 0) [ var 0 ]
∎
test-0 : ƛ (ƛ var 0 ∙ var 1) ∙ (ƛ var 0 ∙ var 1) β→* ƛ var 0 ∙ v... |
module Data.Num.Digit where
open import Data.Nat
open import Data.Nat.Properties
open import Data.Nat.Properties.Simple
open import Data.Nat.Properties.Extra
open import Data.Fin as Fin
using (Fin; fromℕ≤; inject≤; toℕ; zero; suc)
open import Data.Fin.Properties as FinProps using (bounded; toℕ-fromℕ≤)
open import... |
module IID-Proof-Setup where
open import LF
open import Identity
open import IID
open import IIDr
open import DefinitionalEquality
OPg : Set -> Set1
OPg I = OP I I
-- Encoding indexed inductive types as non-indexed types.
ε : {I : Set}(γ : OPg I) -> OPr I
ε (ι i) j = σ (i == j) (\_ -> ι ★)
ε (σ A γ) j = σ A (... |
module Data.Boolean.Stmt where
import Lvl
open import Data.Boolean
import Data.Boolean.Operators
open Data.Boolean.Operators.Programming
open import Functional
open import Logic.Propositional
open import Type
IsTrue : Bool → Type
IsTrue = if_then ⊤ else ⊥
IsFalse : Bool → Type
IsFalse = IsTrue ∘ !
|
{-# OPTIONS --without-K #-}
module PathStructure.Coproduct {a b} {A : Set a} {B : Set b} where
open import Equivalence
open import PathOperations
open import Types
-- We need to use Lift here, because Agda doesn't have
-- cumulative universes.
F : A ⊎ B → A ⊎ B → Set (a ⊔ b)
F = case (λ _ → A ⊎ B → Set _)
(λ a₁ → c... |
module Lvl.Decidable where
open import Data.Boolean.Stmt
open import Logic.Propositional
open import Logic.Propositional.Theorems
import Lvl
open import Type.Properties.Decidable
open import Type.Properties.Decidable.Proofs
open import Type
private variable ℓ ℓ₁ : Lvl.Level
-- Changing classical propositions' u... |
module Formalization.LambdaCalculus.Semantics where
open import Data
open import Formalization.LambdaCalculus
open import Syntax.Number
open import Type
-- A value in the language of lambda calculus is a irreducible term by a standard reduction definition.
-- It can also be defined as terms that are lambda abstractio... |
module Cutting where
open import Basics
open import Ix
open import All
record _|>_ (I O : Set) : Set1 where
field
Cuts : O -> Set
inners : {o : O} -> Cuts o -> List I
NatCut : Nat |> Nat
NatCut = record
{ Cuts = \ mn -> Sg Nat \ m -> Sg Nat \ n -> (m +N n) == mn
; inners = \ { (m , n , _) -> m ,- n... |
{-# OPTIONS --without-K --safe #-}
open import Categories.Category
-- You can transform functions out of discrete
-- categories into functors.
module Categories.Functor.Construction.FromDiscrete {o ℓ e} (𝒞 : Category o ℓ e) where
open import Relation.Binary.PropositionalEquality as ≡ using (_≡_)
open import Categor... |
module Dimension.PartialWeakening.Soundness where
open import Exception -- using (Except; left; right; _<$>_; _>>=_)
open import Injective
-- Semantics given by application to a name in Fin n
apply : ∀ {n m} (f : PWeak n m) (i : Fin n) → Except E (Fin m)
apply [] ()
apply (e ∷ f) zero = left e... |
{-# OPTIONS --prop --rewriting #-}
module Examples.Exp2 where
open import Calf.CostMonoid
open import Calf.CostMonoids using (ℕ²-ParCostMonoid)
parCostMonoid = ℕ²-ParCostMonoid
open ParCostMonoid parCostMonoid
open import Calf costMonoid
open import Calf.ParMetalanguage parCostMonoid
open import Calf.Types.Bool
ope... |
------------------------------------------------------------------------
-- Semantics of the parsers
------------------------------------------------------------------------
module TotalParserCombinators.Semantics where
open import Codata.Musical.Notation
open import Data.List hiding (drop)
open import Data.List.Rela... |
-- Agda should warn if a coinductive record is declared but neither
-- --guardedness nor --sized-types is enabled.
record R : Set where
coinductive
field
r : R
|
{-# OPTIONS --safe --no-qualified-instances #-}
{- Noop removal transformation on bytecode -}
module JVM.Transform.Noooops where
open import Data.Product
open import Data.Sum
open import Function using (case_of_)
open import Data.List
open import Relation.Unary hiding (Empty)
open import Relation.Binary.Structures
ope... |
{-# OPTIONS --without-K --safe #-}
module Definition.Typed.Consequences.Equality where
open import Definition.Untyped
open import Definition.Typed
open import Definition.Typed.Properties
open import Definition.Typed.EqRelInstance
open import Definition.LogicalRelation
open import Definition.LogicalRelation.Irrelevanc... |
{-# OPTIONS --rewriting #-}
module Issue5470.Import where
open import Agda.Builtin.Nat
open import Agda.Builtin.Equality
open import Agda.Builtin.Equality.Rewrite
private
postulate
foo : Nat → Nat
bar : Nat → Nat
bar n = foo n
private
postulate
lemma : ∀ n → foo n ≡ n
{-# REWRITE lemma #-}
|
module ProposedSemantics where
open import Syntax public
-- Vindicative Kripke models.
record Model : Set₁ where
infix 3 _⊩ᵅ_
field
World : Set
_≤_ : World → World → Set
refl≤ : ∀ {w} → w ≤ w
trans≤ : ∀ {w w′ w″} → w ≤ w′ → w′ ≤ w″ → w ≤ w″
_R_ : World → World → Set
reflR ... |
{-# OPTIONS --safe #-}
module Cubical.Algebra.CommMonoid.Properties where
open import Cubical.Foundations.Prelude
open import Cubical.Foundations.HLevels
open import Cubical.Foundations.SIP
open import Cubical.Data.Sigma
open import Cubical.Algebra.Monoid
open import Cubical.Algebra.CommMonoid.Base
private
variab... |
-- Andreas, Ulf, AIM XXIX, 2019-03-18, issue #3597
-- Eta-expansion of record metas disregards freezing.
-- Meta occurs check is then insufficient, leading to cyclic assignment.
{-# OPTIONS --allow-unsolved-metas #-}
-- {-# OPTIONS -v tc.meta:40 #-}
-- {-# OPTIONS -v tc.meta.assign:100 #-}
-- {-# OPTIONS -v tc.meta.... |
module Generic.Lib.Data.Sum where
open import Data.Sum hiding (swap) renaming (map to smap) hiding (map₁; map₂; assocʳ; assocˡ; reduce) public
|
module Lectures.Four where
open import Lectures.One public
open import Lectures.Two public
open import Lectures.Three public
_∘_ : {A B C : Set} → (B → C) → (A → B) → (A → C)
(f ∘ g) x = f (g x)
record _↔_ (A B : Set) : Set where
constructor Isomorphism
field
to : A → B
from : B → A
from∘to : ∀ x → (... |
module Issue2447.M where
|
------------------------------------------------------------------------
-- Data and codata can sometimes be "unified"
------------------------------------------------------------------------
-- In Haskell one can define the partial list type once, and define
-- map once and for all for this type. In Agda one typicall... |
{-# OPTIONS --universe-polymorphism --allow-unsolved-metas #-}
module Issue253 where
open import Common.Level
data Id l (X : Set l)(x : X) : X → Set where
refl : Id l X x x
resp : (A B : Set _) → Id _ (Set _) A B → Set
resp _ _ eq with eq
resp ._ _ eq | refl = Level
{-
An internal error has occurred. Please repo... |
-- Record projections should be positive in their argument
module Issue602-2 where
record A : Set₁ where
constructor mkA
field
f : Set
unA : A → Set
unA (mkA x) = x
data B (a : A) : Set where
mkB : unA a → B a
data D : Set where
d : B (mkA D) → D
|
module Luau.RuntimeError.ToString where
open import FFI.Data.String using (String; _++_)
open import Luau.RuntimeError using (RuntimeErrorᴮ; RuntimeErrorᴱ; local; return; NilIsNotAFunction; UnboundVariable; SEGV; app; block)
open import Luau.Addr.ToString using (addrToString)
open import Luau.Var.ToString using (varTo... |
------------------------------------------------------------------------
-- Colists
------------------------------------------------------------------------
{-# OPTIONS --without-K --sized-types #-}
open import Equality
module Colist {c⁺} (eq : ∀ {a p} → Equality-with-J a p c⁺) where
private
open module E = Deriv... |
{-# OPTIONS --without-K --safe #-}
module Dodo.Binary.Transitive where
-- Stdlib imports
import Relation.Binary.PropositionalEquality as Eq
open Eq using (_≡_; _≢_; refl)
open import Level using (Level; _⊔_)
open import Function using (flip; _∘_)
open import Data.Sum using (_⊎_; inj₁; inj₂)
open import Data.Product u... |
{-# OPTIONS --cubical --safe #-}
module Data.List.Filter where
open import Prelude
open import Data.List
open import Data.List.Membership
open import Data.Sigma.Properties
open import Data.Bool.Properties
open import Data.Fin
module _ {p} {P : A → Type p} where
filter : (P? : ∀ x → Dec (P x)) → List A → List (∃ P)... |
open import FRP.JS.Nat using ( ℕ ; float ) renaming
( _+_ to _+n_ ; _∸_ to _∸n_ ; _*_ to _*n_ ; _≟_ to _≟n_ ; _≠_ to _≠n_
; _/_ to _/n_ ; _/?_ to _/?n_ ; _≤_ to _≤n_ ; _<_ to _<n_ )
open import FRP.JS.Float using ( ℝ )
open import FRP.JS.Bool using ( Bool )
open import FRP.JS.True using ( True )
open import FRP.JS... |
-- This variant of the code is due to Ulf Norell.
open import Agda.Builtin.Size
data ⊥ : Set where
mutual
data Unit (i : Size) : Set where
c : Unit′ i → Unit i
data Unit₁ (i : Size) : Set where
c₁ : ⊥ → Unit i → Unit₁ i
record Unit′ (i : Size) : Set where
coinductive
field
force : {j :... |
{-# OPTIONS --without-K --safe #-}
open import Relation.Binary.Core
module Definitions
{a ℓ} {A : Set a} -- The underlying set
(_≈_ : Rel A ℓ) -- The underlying equality
where
open import Algebra.Core
open import Data.Product
open import Algebra.Definitions
Alternativeˡ : Op₂ A → Set _
Alternativeˡ _∙_ ... |
-- Andreas, 2014-06-16
data D A : Set where
c : {x : A} → A → D A
f : ∀(A : Set) → D A → Set
f A (c a b) = D A
-- Expected error:
-- The constructor c expects 2 arguments (including hidden ones), but
-- has been given 3 (including hidden ones)
-- when checking that the pattern c a b has type D A
|
{-# OPTIONS --without-K #-}
open import HoTT.Base using (𝒰 ; Level ; module variables)
module HoTT.Exercises.Chapter1 where
open variables
module Exercise1 where
open HoTT.Base hiding (_∘_)
_∘_ : {A B C : 𝒰 i} (g : B → C) (f : A → B) → A → C
g ∘ f = λ x → g (f x)
_ : {A B C D : 𝒰 i} {f : A → B} {g : B →... |
{-# OPTIONS --without-K #-}
module decidable where
open import level using (Level)
open import sets.empty using (⊥; ¬_)
open import sets.unit using (⊤; tt)
-- Decidable relations.
data Dec {i} (P : Set i) : Set i where
yes : ( p : P) → Dec P
no : (¬p : ¬ P) → Dec P
True : ∀ {i}{P : Set i} → Dec P → Set
Tru... |
{-
This file contains a summary of the proofs that π₄(S³) ≡ ℤ/2ℤ
- The first proof "π₄S³≃ℤ/2ℤ" closely follows Brunerie's thesis.
- The second proof "π₄S³≃ℤ/2ℤ-direct" is much more direct and avoids
all of the more advanced constructions in chapters 4-6 in Brunerie's
thesis.
- The third proof "π₄S³≃ℤ/2ℤ-computa... |
-- 2010-10-02
-- termination checker now recognizes projections
module Issue334 where
data Functor : Set₁ where
|Id| : Functor
_|x|_ : Functor → Functor → Functor
record _×_ (A B : Set) : Set where
constructor _,_
field
proj₁ : A
proj₂ : B
[_] : Functor → Set → Set
[ |Id| ] X = X
[ F |x| G ] X =... |
{-
Computer Aided Formal Reasoning (G53CFR, G54CFR)
Thorsten Altenkirch
Lecture 2: A first taste of Agda
In this lecture we start to explore the Agda system, a functional
programming language based on Type Theory. We start with some
ordinary examples which we could have developed in Haskell as well.
-}
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.