text stringlengths 4 690k |
|---|
module Oscar.Data.Vec.Injectivity where
open import Oscar.Data.Equality
open import Oscar.Data.Vec
Vec-head-inj : ∀ {a} {A : Set a} {x₁ x₂ : A} {N} {xs₁ xs₂ : Vec A N} → x₁ ∷ xs₁ ≡ x₂ ∷ xs₂ → x₁ ≡ x₂
Vec-head-inj refl = refl
Vec-tail-inj : ∀ {a} {A : Set a} {x₁ x₂ : A} {N} {xs₁ xs₂ : Vec A N} → x₁ ∷ xs₁ ≡ x₂ ∷ xs₂ ... |
{-# OPTIONS --without-K --rewriting #-}
module old.Sharp where
open import Basics
open import Flat
open import lib.Equivalence2
{- I want sthing like this
record ♯ {@♭ l : ULevel} (A : Type l) : Type l where
constructor _^♯
field
_/♯ :{♭} A
open ♯ publ
-}
-- Following Licata
postula... |
{-# OPTIONS --without-K --safe #-}
module Definition.Conversion.Decidable where
open import Definition.Untyped
open import Definition.Typed
open import Definition.Typed.Properties
open import Definition.Conversion
open import Definition.Conversion.Whnf
open import Definition.Conversion.Soundness
open import Definitio... |
module _ where
record R : Set₁ where
field
Type : Set
postulate
A : Set
module M (x : A) (r₁ : R) (y : A) where
open R r₁
r₂ : R
r₂ = record { Type = A }
foo : R.Type r₂
foo = {!!} -- R.Type r₂
bar : R.Type r₁
bar = {!!} -- Type
|
{-# OPTIONS --cubical --safe #-}
module Data.Tuple where
open import Data.Tuple.Base public
|
open import Relation.Binary using (Rel; Setoid; IsEquivalence)
module GGT.Structures
{a b ℓ₁ ℓ₂}
{G : Set a} -- The underlying group carrier
{Ω : Set b} -- The underlying set space
(_≈_ : Rel G ℓ₁) -- The underlying group equality
(_≋_ : Rel Ω ℓ₂) -- The underlying space equality
where
open impo... |
------------------------------------------------------------------------
-- Soundness and completeness
------------------------------------------------------------------------
module TotalParserCombinators.Derivative.SoundComplete where
open import Category.Monad
open import Codata.Musical.Notation
open import Data.L... |
module _ where
id : {A : Set} → A → A
id x = x
const : {A : Set₁} {B : Set} → A → (B → A)
const x = λ _ → x
{-# DISPLAY const x y = x #-}
infixr 4 _,_
infixr 2 _×_
record Σ (A : Set) (B : A → Set) : Set where
constructor _,_
field
proj₁ : A
proj₂ : B proj₁
open Σ public
_×_ : (A B : Set) → Set
A × B... |
{-# OPTIONS --safe #-}
module Cubical.Algebra.CommRing.Instances.UnivariatePoly where
open import Cubical.Foundations.Prelude
open import Cubical.Algebra.CommRing
open import Cubical.Algebra.Polynomials.Univariate.Base
open import Cubical.Algebra.Polynomials.Univariate.Properties
private
variable
ℓ : Level
U... |
{- This example used to fail but after the point-free evaluation fix
it seems to work #-}
module Issue259c where
postulate
A : Set
a : A
b : ({x : A} → A) → A
C : A → Set
d : {x : A} → A
d {x} = a
e : A
e = b (λ {x} → d {x})
F : C e → Set₁
F _ with Set
F _ | _ = Set
|
{-# OPTIONS --cubical --safe #-}
module Cubical.Data.Unit.Properties where
open import Cubical.Core.Everything
open import Cubical.Foundations.Prelude
open import Cubical.Foundations.HLevels
open import Cubical.Data.Nat
open import Cubical.Data.Unit.Base
isContrUnit : isContr Unit
isContrUnit = tt , λ {tt → refl}
... |
-- The NO_POSITIVITY_CHECK pragma is not allowed in safe mode.
module Issue1614a where
{-# NO_POSITIVITY_CHECK #-}
data D : Set where
lam : (D → D) → D
|
{-# OPTIONS --exact-split #-}
{-# OPTIONS --no-sized-types #-}
{-# OPTIONS --no-universe-polymorphism #-}
{-# OPTIONS --without-K #-}
module BottomBottom where
open import Common.FOL.FOL
postulate bot bot' : ⊥
{-# ATP prove bot bot' #-}
{-# ATP prove bot' bot #-}
-- $ apia-fot ... |
------------------------------------------------------------------------------
-- The gcd is a common divisor
------------------------------------------------------------------------------
{-# OPTIONS --exact-split #-}
{-# OPTIONS --no-sized-types #-}
{-# OPTIONS --no-universe-polymorphism #-}
{... |
-- A DSL example in the language Agda: "polynomial types"
module TypeDSL where
open import Data.Empty
open import Data.Unit
open import Data.Sum
open import Data.Product
open import Data.Nat
data E : Set1 where
Add : E -> E -> E
Mul : E -> E -> E
Zero : E
One : E
eval : E -> Set
eval (Add x y) = (eval... |
module _ where
open import Agda.Builtin.List
open import Agda.Builtin.Nat hiding (_==_)
open import Agda.Builtin.Equality
open import Agda.Builtin.Unit
open import Agda.Builtin.Bool
infix -1 _,_
record _×_ {a} (A B : Set a) : Set a where
constructor _,_
field fst : A
snd : B
open _×_
data Constraint : S... |
{-# OPTIONS --prop #-}
{-# TERMINATING #-}
makeloop : {P : Prop} → P → P
makeloop p = makeloop p
postulate
P : Prop
p : P
Q : P → Set
record X : Set where
field
f : Q (makeloop p)
data Y : Set where
f : Q (makeloop p) → Y
|
-- {-# OPTIONS -v reify:80 #-}
open import Common.Prelude
open import Common.Reflection
open import Common.Equality
module Issue1345 (A : Set) where
-- Andreas, 2016-07-17
-- Also test correct handling of abstract
abstract
unquoteDecl idNat = define (vArg idNat)
(funDef (pi (vArg (def (quote Nat) [])) (abs ""... |
open import Common.Prelude
open import TestHarness
open import TestBool using ( not; _∧_ ; _↔_ )
module TestNat where
_*_ : Nat → Nat → Nat
zero * n = zero
suc m * n = n + (m * n)
{-# COMPILED_JS _*_ function (x) { return function (y) { return x*y; }; } #-}
fact : Nat → Nat
fact zero = 1
fact (suc x) = suc x * ... |
------------------------------------------------------------------------
-- The Agda standard library
--
-- Some examples showing where the integers and some related
-- operations and properties are defined, and how they can be used
------------------------------------------------------------------------
module README... |
-- Issue #80.
-- The disjunction data type.
data _∨_ (A B : Set) : Set where
inj₁ : A → A ∨ B
inj₂ : B → A ∨ B
-- A different symbol for disjunction.
_⊕_ : Set → Set → Set
P ⊕ Q = P ∨ Q
{-# ATP definition _⊕_ #-}
postulate
P Q : Set
⊕-comm : P ⊕ Q → Q ⊕ P
{-# ATP prove ⊕-comm #-}
-- The previous error was:
... |
-- {-# OPTIONS -v tc.meta:20 #-}
module UnifyWithIrrelevantArgument where
data _≡_ {A : Set}(a : A) : A -> Set where
refl : a ≡ a
fail : (A : Set) ->
let X : .A -> A
X = _
in (x : A) -> X x ≡ x
fail A x = refl
-- error: X cannot depend on its first argument
|
{-# OPTIONS --safe --warning=error --without-K #-}
open import LogicalFormulae
open import Groups.Definition
open import Numbers.Naturals.Definition
open import Setoids.Setoids
open import Sets.EquivalenceRelations
open import Lists.Lists
open import Maybe
open import Agda.Primitive using (Level; lzero; lsuc; _⊔_)
m... |
------------------------------------------------------------------------
-- The Agda standard library
--
-- M-types (the dual of W-types)
------------------------------------------------------------------------
{-# OPTIONS --without-K --safe --sized-types #-}
module Codata.M where
open import Size
open import Level
... |
module builtin where
open import Agda.Builtin.IO
open import Agda.Builtin.Unit
open import Agda.Builtin.String
postulate putStrLn : String -> IO ⊤
{-# COMPILE GHC putStrLn = putStrLn . Data.Text.unpack #-}
main : IO ⊤
main = putStrLn "hallo"
|
import MJ.Classtable
import MJ.Syntax.Untyped as Syntax
import MJ.Classtable.Core as Core
module MJ.Semantics.Smallstep {c} (Ct : Core.Classtable c)(ℂ : Syntax.Classes Ct) where
open import Prelude
open import Data.Vec as V hiding (init; _>>=_; _∈_; _[_]=_)
open import Data.Vec.All.Properties.Extra as Vec∀++
open i... |
{-# OPTIONS -WnoMissingDefinitions #-}
postulate
A : Set
B : A → Set
variable
a : A
data D : B a → Set
-- Expected: Warning about missing definition
-- Not expected: Complaint about generalizable variable
|
-- Andreas, 2017-01-01, issue 2372, reported by m0davis
open import Issue2372Inst
f : r → Set₁
f _ = Set
-- WAS: No instance of type R was found in scope.
-- Should succeed
|
{-# OPTIONS --safe --experimental-lossy-unification #-}
module Cubical.Data.Vec.OperationsNat where
open import Cubical.Foundations.Prelude
open import Cubical.Data.Nat renaming(_+_ to _+n_; _·_ to _·n_)
open import Cubical.Data.Vec.Base
open import Cubical.Data.Sigma
private variable
ℓ : Level
_+n-vec_ : {m : ℕ}... |
module Type.Dependent.Functions where
import Lvl
open import Functional.Dependent
open import Type
open import Type.Dependent
open import Syntax.Function
module _ {ℓ₁ ℓ₂ ℓ₃}
{A : Type{ℓ₁}}
{B : A → Type{ℓ₂}}
{C : ∀{x} → B(x) → Type{ℓ₃}}
where
_[Π]-∘_ : (∀{x} → Π(B(x))(C)) → ... |
{-# OPTIONS --cubical --safe --no-import-sorts --postfix-projections #-}
module Cubical.Data.Fin.Recursive.Properties where
open import Cubical.Foundations.Equiv
open import Cubical.Foundations.Function
open import Cubical.Foundations.HLevels
open import Cubical.Foundations.Isomorphism
open import Cubical.Foundations... |
{-# OPTIONS --without-K --rewriting #-}
open import HoTT
module homotopy.EilenbergMacLane1 {i} (G : Group i) where
private
module G = Group G
comp-equiv : ∀ g → G.El ≃ G.El
comp-equiv g = equiv
(λ x → G.comp x g)
(λ x → G.comp x (G.inv g))
(λ x → G.assoc x (G.inv g) g ∙ ap (G.comp x) ... |
{-# OPTIONS --universe-polymorphism #-}
module Categories.Functor.Algebras where
open import Level hiding (lift)
open import Categories.Category
open import Categories.Functor hiding (_≡_; id; _∘_; equiv; assoc; identityˡ; identityʳ; ∘-resp-≡)
open import Categories.Functor.Algebra
record F-Algebra-Morphism {o ℓ e} ... |
module Agda.Builtin.TrustMe where
open import Agda.Builtin.Equality
primitive primTrustMe : ∀ {a} {A : Set a} {x y : A} → x ≡ y
|
module Issue2649-1 where
module MyModule (A : Set) (a : A) where
foo : A
foo = a
|
module Prelude.Semigroup where
open import Prelude.Function
open import Prelude.Maybe
open import Prelude.List
open import Prelude.Semiring
open import Prelude.Applicative
open import Prelude.Functor
open import Prelude.Equality
record Semigroup {a} (A : Set a) : Set a where
infixr 6 _<>_
field
_<>_ : A → ... |
------------------------------------------------------------------------
-- Comparisons of different kinds of lenses, focusing on the
-- definition of composable record setters and getters
------------------------------------------------------------------------
{-# OPTIONS --cubical --safe #-}
-- This module uses bot... |
module Type.Category.ExtensionalFunctionsCategory{ℓ} where
open import Data
open import Functional
open import Function.Equals
open import Function.Equals.Proofs
open import Logic.Propositional
import Relator.Equals as Eq
open import Relator.Equals.Proofs.Equiv
open import Structure.Category
open import Structure... |
module Oscar.Data.Vec where
open import Data.Vec public
open import Oscar.Data.Nat
open import Oscar.Data.Equality
open import Data.Nat
map₂ : ∀ {a b} {A : Set a} {B : Set b} {m n}
→ ∀ {c} {C : Set c} (f : A → B → C)
→ Vec A m → Vec B n → Vec C (m * n)
map₂ f xs ys = map f xs ⊛* ys
open impor... |
{-# OPTIONS --without-K #-}
module PiG where
import Level as L
open import Data.Empty
open import Data.Unit
open import Data.Sum
open import Data.Product
open import Data.Nat
open import Function
open import Relation.Binary.PropositionalEquality
open import Relation.Binary
-----------------------------... |
module free-vars where
open import cedille-types
open import syntax-util
open import general-util
open import type-util
infixr 7 _++ₛ_
_++ₛ_ : stringset → stringset → stringset
s₁ ++ₛ s₂ = stringset-insert* s₂ (stringset-strings s₁)
stringset-single : string → stringset
stringset-single = flip trie-single triv
{-# T... |
-- Reported and fixed by Andrea Vezzosi.
module Issue902 where
module M (A : Set) where
postulate
A : Set
F : Set -> Set
test : A
test = {! let module m = M (F A) in ? !}
-- C-c C-r gives let module m = M F A in ?
-- instead of let module m = M (F A) in ?
|
-- Andreas, 2013-06-15 reported by Guillaume Brunerie
-- {-# OPTIONS -v malonzo.definition:100 #-}
module Issue867 where
{- The program below gives the following error when trying to compile it (using MAlonzo)
$ agda -c Test.agda
Checking Test (/tmp/Test.agda).
Finished Test.
Compiling Test in /tmp/Test.agdai to /tmp... |
{-# OPTIONS --safe #-}
module Cubical.Categories.Limits.Pullback where
open import Cubical.Foundations.Prelude
open import Cubical.Foundations.HLevels
open import Cubical.HITs.PropositionalTruncation.Base
open import Cubical.Data.Sigma
open import Cubical.Categories.Category
open import Cubical.Categories.Functor
op... |
module Issue1839.B where
open import Issue1839.A
postulate
DontPrintThis : Set
{-# DISPLAY DontPrintThis = PrintThis #-}
|
-- Andreas, 2019-04-12, issue #3684
-- Report also available record fields in case user gives spurious fields.
-- {-# OPTIONS -v tc.record:30 #-}
record R : Set₁ where
field
foo {boo} moo : Set
test : (A : Set) → R
test A = record
{ moo = A
; bar = A
; far = A
}
-- The record type R does not have the ... |
{-# OPTIONS --cubical --safe #-}
module Data.List.Relation.Unary where
open import Prelude
open import Data.List.Base
open import Data.Fin
open import Relation.Nullary
open import Data.Sum
private
variable p : Level
module Inductive◇ where
data ◇ {A : Type a} (P : A → Type p) : List A → Type (a ℓ⊔ p) where
he... |
module Issue332 where
id : {A : Set} → A → A
id x = x
syntax id x = id x -- This makes parsing id x ambiguous
|
{-# 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.BinaryNaturals.Definition
open import Numbers.BinaryNaturals.Addition
open import Semirings.Definition
module Numbers.B... |
{-# OPTIONS --warning=error --safe --without-K #-}
open import LogicalFormulae
open import Lists.Lists
open import Numbers.BinaryNaturals.Definition
open import Maybe
module Numbers.BinaryNaturals.SubtractionGo where
go : Bit → BinNat → BinNat → Maybe BinNat
go zero [] [] = yes []
go one [] [] = no
go zero [] (zero ... |
-- Agda program using the Iowa Agda library
open import bool
module PROOF-sortPreservesLength
(Choice : Set)
(choose : Choice → 𝔹)
(lchoice : Choice → Choice)
(rchoice : Choice → Choice)
where
open import eq
open import nat
open import list
open import maybe
----------------------------------------------... |
{-# OPTIONS --cubical --no-import-sorts --safe #-}
module Cubical.Algebra.Group.Properties where
open import Cubical.Foundations.Prelude
open import Cubical.Foundations.HLevels
open import Cubical.Data.Sigma
open import Cubical.Algebra.Semigroup
open import Cubical.Algebra.Monoid
open import Cubical.Algebra.Group.Bas... |
open import Data.Nat.Base
open import Relation.Binary.PropositionalEquality
open ≡-Reasoning
test : 0 ≡ 0
test = begin
0 ≡⟨ {!!} ⟩
0
∎
-- WAS: Goal is garbled:
--
-- ?0 : (.Relation.Binary.Setoid.preorder (setoid ℕ)
-- .Relation.Binary.Preorder.∼ 0)
-- 0
-- EXPECTED: Nice goal:
--
-- ?0 : 0 ≡ 0
|
{-# OPTIONS --type-in-type #-}
-- {-# OPTIONS --guardedness-preserving-type-constructors #-}
module PatternSynonymsErrorLocation where
data _≡_ {A : Set}(a : A) : A -> Set where
refl : a ≡ a
infixr 2 _,_
record Unit : Set where
data Sigma (A : Set)(B : A -> Set) : Set where
_,_ : (fst : A) -> B fst -> Sigma A ... |
record Unit : Set where
data Bool : Set where true false : Bool
F : Bool -> Set
F true = Bool
F false = Unit
f : (b : Bool) -> F b
f true = true
f false = record {}
-- this should give an error, but only gives yellow
test : Bool
test = f _ false
|
{-# OPTIONS --cubical --no-import-sorts --safe #-}
module Cubical.Algebra.Group.Morphism where
open import Cubical.Foundations.Prelude
open import Cubical.Foundations.Equiv
open import Cubical.Algebra.Group.Base
open import Cubical.HITs.PropositionalTruncation hiding (map)
open import Cubical.Data.Sigma
private
va... |
-- Andreas, 2019-03-28, issue #3248, reported by guillaumebrunerie
{-# OPTIONS --sized-types --show-implicit #-}
-- {-# OPTIONS -v tc:10 #-}
-- {-# OPTIONS -v tc.term:20 #-}
-- {-# OPTIONS -v tc.conv.size:45 #-}
-- {-# OPTIONS -v tc.conv.coerce:45 #-}
-- {-# OPTIONS -v tc.term.args.target:45 #-}
{-# BUILTIN SIZEUNIV... |
open import Formalization.PredicateLogic.Signature
module Formalization.PredicateLogic.Classical.Semantics (𝔏 : Signature) {ℓₘ} where
open Signature(𝔏)
import Lvl
open import Data.Boolean
open import Data.ListSized
open import Numeral.Natural
open import Type
private variable args : ℕ
-- Model.
-- A model de... |
{-# OPTIONS --safe #-}
module Cubical.Categories.Instances.Cospan where
open import Cubical.Foundations.Prelude
open import Cubical.Categories.Category
open import Cubical.Data.Unit
open import Cubical.Data.Empty
open Category
data 𝟛 : Type ℓ-zero where
⓪ : 𝟛
① : 𝟛
② : 𝟛
CospanCat : Category ℓ-zero ℓ-zero... |
import Lvl
open import Structure.Operator.Vector
open import Structure.Setoid
open import Type
module Structure.Operator.Vector.InfiniteDimensional
{ℓᵥ ℓₛ ℓᵥₑ ℓₛₑ}
{V : Type{ℓᵥ}} ⦃ equiv-V : Equiv{ℓᵥₑ}(V) ⦄
{S : Type{ℓₛ}} ⦃ equiv-S : Equiv{ℓₛₑ}(S) ⦄
{_+ᵥ_ : V → V → V}
{_⋅ₛᵥ_ : S → V → V}
{_+ₛ_ _⋅ₛ_ : ... |
-- Copyright: (c) 2016 Ertugrul Söylemez
-- License: BSD3
-- Maintainer: Ertugrul Söylemez <esz@posteo.de>
module Algebra.Category.Semigroupoid where
open import Core
-- A semigroupoid is a set of objects and morphisms between objects
-- together with an associative binary function that combines morphisms.
rec... |
module par-swap.union-confluent where
open import par-swap
open import par-swap.properties
open import par-swap.confluent
open import par-swap.dpg
open import Data.Nat using (_+_ ; _≤′_ ; _<′_ ; suc ; zero ; ≤′-refl ; ℕ)
open import Data.Nat.Properties.Simple using ( +-comm ; +-assoc)
open import Data.Nat.Properties... |
{-# OPTIONS --without-K --safe #-}
module Definition.Conversion.EqRelInstance where
open import Definition.Untyped
open import Definition.Typed
open import Definition.Typed.Properties
open import Definition.Typed.Weakening using (_∷_⊆_; wkEq)
open import Definition.Conversion
open import Definition.Conversion.Reducti... |
{-# OPTIONS --safe #-}
module Cubical.Categories.DistLatticeSheaf where
open import Cubical.Foundations.Prelude
open import Cubical.Foundations.Structure
open import Cubical.Foundations.Powerset
open import Cubical.Data.Sigma
open import Cubical.Relation.Binary.Poset
open import Cubical.Algebra.Ring
open import Cubi... |
open import Prelude
module Implicits.Resolution.Scala.Type where
open import Implicits.Syntax
open import Implicits.Substitutions
open import Implicits.Substitutions.Lemmas.Type
open import Implicits.Substitutions.Type as TS using ()
-- predicate on types to limit them to non-rule types
-- (as those don't exist in... |
{-
This file contains:
- The inductive family 𝕁 can be constructed by iteratively applying pushouts;
- The special cases of 𝕁 n for n = 0, 1 and 2;
- Connectivity of inclusion maps.
Easy, almost direct consequences of the very definition.
-}
{-# OPTIONS --safe #-}
module Cubical.HITs.James.Inductive.Pushou... |
module InstanceArgumentsBraces where
record T' : Set where
record T'' : Set where
field a : T'
testT'' : T''
testT'' = record { a = record {}}
|
module Prelude where
-- Booleans
data Bool : Set where
tt : Bool
ff : Bool
_||_ : Bool -> Bool -> Bool
tt || y = tt
ff || y = y
_&&_ : Bool -> Bool -> Bool
tt && y = y
ff && y = ff
if_then_else : {A : Set} -> Bool -> A -> A -> A
if tt then x else _ = x
if ff then _ else y = y
-- Eq "type cla... |
open import OutsideIn.Prelude
open import OutsideIn.X
module OutsideIn.Inference(x : X) where
import OutsideIn.TopLevel as TL
import OutsideIn.TypeSchema as TS
import OutsideIn.Expressions as E
import OutsideIn.Environments as V
import OutsideIn.Constraints as C
import OutsideIn.Inference.Solver as S
impo... |
postulate
T : Set
pre : (T → T) → T
pre!_ : (T → T) → T
_post : T → Set
_+_ : T → T → T
_>>=_ : T → (T → T) → T
infix 5 pre!_ _>>=_
infix 4 _post
infixl 3 _+_
-- add parens
test-1a : Set
test-1a = {!pre λ x → x!} post
-- no parens
test-1b : Set
test-1b = {!pre (λ x → x)!} post
-- add parens
tes... |
{-# OPTIONS --without-K #-}
module sets where
import sets.bool
import sets.empty
import sets.fin
import sets.nat
import sets.int
import sets.unit
import sets.vec
import sets.list
open import sets.properties
open import sets.finite
|
------------------------------------------------------------------------
-- Truncation, defined using a kind of Church encoding
------------------------------------------------------------------------
{-# OPTIONS --without-K --safe #-}
-- Partly following the HoTT book.
open import Equality
module H-level.Truncatio... |
{-# OPTIONS --without-K --rewriting #-}
open import lib.Basics
open import lib.types.Truncation
open import lib.types.Groupoid
open import lib.types.PathSet
module lib.groupoids.FundamentalPreGroupoid {i} (A : Type i) where
fundamental-pregroupoid : PreGroupoid i i
fundamental-pregroupoid = record
{ El = A
... |
------------------------------------------------------------------------
-- Properties satisfied by total orders
------------------------------------------------------------------------
open import Relation.Binary
module Relation.Binary.Props.TotalOrder (t : TotalOrder) where
open Relation.Binary.TotalOrder t
open i... |
module Slides where
import Background
import OpenTheory
import OpenTheory2
import ClosedTheory
import ClosedTheory2
import ClosedTheory3
import ClosedTheory4
|
{-# OPTIONS --without-K --safe #-}
open import Data.Nat using (ℕ)
module Categories.Category.Construction.Fin (n : ℕ) where
open import Level
open import Data.Fin.Properties
open import Categories.Category
open import Categories.Category.Construction.Thin 0ℓ (≤-poset n)
Fin : Category 0ℓ 0ℓ 0ℓ
Fin = Thin
|
-- Andreas, 2016-12-09, issue #2331
-- Testcase from Nisse's application
open import Common.Size
data D (i : Size) : Set where
c : (j : Size< i) → D i
postulate
f : (i : Size) → ((j : Size< i) → D j → Set) → Set
module Mutual where
mutual
test : (i : Size) → D i → Set
test i (c j) = f j (helper i j)
... |
------------------------------------------------------------------------
-- The torus, defined as a HIT
------------------------------------------------------------------------
{-# OPTIONS --erased-cubical --safe #-}
-- This module is based on the discussion of the torus in the HoTT
-- book.
-- The module is paramet... |
module Builtin.Float where
open import Prelude
open import Prelude.Equality.Unsafe
open import Agda.Builtin.Float
open Agda.Builtin.Float public using (Float)
natToFloat : Nat → Float
natToFloat = primNatToFloat
intToFloat : Int → Float
intToFloat (pos x) = natToFloat x
intToFloat (negsuc x) = primFloatMinus -1... |
module Tactic.Monoid.Proofs where
open import Prelude
open import Structure.Monoid.Laws
open import Tactic.Monoid.Exp
⟦_⟧_ : ∀ {a} {A : Set a} {{_ : Monoid A}} → Exp → (Nat → A) → A
⟦ var x ⟧ ρ = ρ x
⟦ ε ⟧ ρ = mempty
⟦ e ⊕ e₁ ⟧ ρ = ⟦ e ⟧ ρ <> ⟦ e₁ ⟧ ρ
⟦_⟧n_ : ∀ {a} {A : Set a} {{_ : Monoid A}} → List Nat → (... |
------------------------------------------------------------------------------
-- Example of a partial function using the Bove-Capretta method
------------------------------------------------------------------------------
{-# OPTIONS --exact-split #-}
{-# OPTIONS --no-sized-types #-}
{-# OPTIONS... |
open import Logic
open import Logic.Classical
open import Structure.Setoid
open import Structure.OrderedField
open import Type
module Structure.Function.Metric
{ℓF ℓₑF ℓ≤}
{F : Type{ℓF}}
⦃ equiv-F : Equiv{ℓₑF}(F) ⦄
{_+_}{_⋅_}
{_≤_ : _ → _ → Type{ℓ≤}}
⦃ orderedField-F : OrderedField{F = F}(_+_)(_⋅_)(_≤_) ⦄
... |
module Positivity where
data Nat : Set where
zero : Nat
suc : Nat -> Nat
data List (A : Set) : Set where
[] : List A
_::_ : A -> List A -> List A
data Tree : Set where
node : List Tree -> Tree
data Loop (A : Set) : Set where
loop : Loop (Loop A) -> Loop A
data _×_ (A B : Set) : Set where
_,_ : A ... |
module Section10 where
open import Section9 public
-- 10. Conclusions
-- ===============
--
-- We have defined a calculus of proof trees for simply typed λ-calculus with explicit substitutions
-- and we have proved that this calculus is sound and complete with respect to Kripke
-- models. A decision algorithm for c... |
{-# OPTIONS --cubical-compatible #-}
module _ where
infix 4 _≡_
data _≡_ {a} {A : Set a} (x : A) : A → Set a where
instance refl : x ≡ x
{-# BUILTIN EQUALITY _≡_ #-}
{-# BUILTIN REFL refl #-} -- This should trigger a warning!
|
open import Agda.Primitive
open import Agda.Builtin.List
open import Agda.Builtin.Equality
private
variable
a p : Level
A : Set a
P Q : A → Set p
data Any {a p} {A : Set a} (P : A → Set p) : List A → Set (a ⊔ p) where
here : ∀ {x xs} (px : P x) → Any P (x ∷ xs)
there : ∀ {x xs} (pxs : Any P x... |
module Avionics.SafetyEnvelopes where
open import Data.Bool using (Bool; true; false; _∧_; _∨_)
open import Data.List using (List; []; _∷_; any; map; foldl; length)
open import Data.List.Relation.Unary.Any as Any using (Any)
open import Data.List.Relation.Unary.All as All using (All)
open import Data.Maybe using (Mayb... |
{-# OPTIONS --without-K #-}
open import Base
open import Coinduction
module CoindEquiv where
-- Coinductive equivalences
record _∼_ {i j} (A : Set i) (B : Set j) : Set (max i j) where
constructor _,_,_
field
to : A → B
from : B → A
eq : ∞ ((a : A) (b : B) → ((to a ≡ b) ∼ (a ≡ from b)))
-- Identity
i... |
{-# OPTIONS --safe #-}
module Definition.Typed.Consequences.Substitution where
open import Definition.Untyped
open import Definition.Untyped.Properties
open import Definition.Typed
open import Definition.Typed.Properties
open import Definition.Typed.EqRelInstance
open import Definition.Typed.Weakening
open import Def... |
{-# OPTIONS --without-K --safe #-}
module Categories.Category.Construction.Kleisli where
open import Level
open import Categories.Category
open import Categories.Functor using (Functor; module Functor)
open import Categories.NaturalTransformation hiding (id)
open import Categories.Monad
import Categories.Morphism.Rea... |
{-# OPTIONS --rewriting #-}
module Examples.Run where
open import Agda.Builtin.Equality using (_≡_; refl)
open import Agda.Builtin.Bool using (true; false)
open import Luau.Syntax using (nil; var; _$_; function_is_end; return; _∙_; done; _⟨_⟩; number; binexp; +; <; val; bool; ~=; string)
open import Luau.Run using (r... |
------------------------------------------------------------------------------
-- Properties for the bisimilarity relation
------------------------------------------------------------------------------
{-# OPTIONS --exact-split #-}
{-# OPTIONS --no-sized-types #-}
{-# OPTIONS --no-universe-polym... |
open import Data.Nat hiding ( _+_; _*_; _⊔_; zero )
open import Algebra hiding (Zero)
open import Level using (Level; _⊔_)
open import Data.Product
module quad { c ℓ } ( ring : Ring c ℓ ) where
open Ring ring
data Nat4 : Set where
One : Nat4
Suc : Nat4 -> Nat4
variable
a b d : Level
A : Set a
B : Se... |
-- Andreas, 2016-09-20, issue #2196 reported by mechvel
-- Test case by Ulf
-- {-# OPTIONS -v tc.lhs.dot:40 #-}
data _≡_ {a} {A : Set a} (x : A) : A → Set a where
refl : x ≡ x
record _×_ (A B : Set) : Set where
constructor _,_
field fst : A
snd : B
open _×_
EqP₁ : ∀ {A B} (p q : A × B) → Set
EqP₁ (x ,... |
{-
This file contains:
- The first Eilenberg–Mac Lane type as a HIT
-}
{-# OPTIONS --cubical --no-import-sorts --safe #-}
module Cubical.HITs.EilenbergMacLane1.Base where
open import Cubical.Foundations.Prelude
open import Cubical.Algebra.Group.Base
private
variable ℓ : Level
module _ (G : Group {ℓ}) where
op... |
{-# OPTIONS --safe #-}
module Cubical.Algebra.CommAlgebra.FGIdeal where
open import Cubical.Foundations.Prelude
open import Cubical.Foundations.Structure
open import Cubical.Foundations.Powerset
open import Cubical.Data.FinData
open import Cubical.Data.Nat
open import Cubical.Data.Vec
open import Cubical.Algebra.Comm... |
{-# OPTIONS --without-K #-}
module algebra.monoid.morphism where
open import level
open import algebra.monoid.core
open import algebra.semigroup.morphism
open import equality.core
open import function.isomorphism
open import hott.level
open import sum
module _ {i}{j}
{X : Set i}⦃ sX : IsMonoid X ⦄
... |
{-
DUARel for the constant unit family
-}
{-# OPTIONS --no-exact-split --safe #-}
module Cubical.Displayed.Unit where
open import Cubical.Foundations.Prelude
open import Cubical.Foundations.Equiv
open import Cubical.Foundations.HLevels
open import Cubical.Data.Unit
open import Cubical.Displayed.Base
open import ... |
------------------------------------------------------------------------
-- Compiler correctness
------------------------------------------------------------------------
{-# OPTIONS --erased-cubical --sized-types #-}
module Lambda.Simplified.Delay-monad.Compiler-correctness where
import Equality.Propositional as E
o... |
module omega-automaton where
open import Level renaming ( suc to succ ; zero to Zero )
open import Data.Nat
open import Data.List
open import Data.Maybe
-- open import Data.Bool using ( Bool ; true ; false ; _∧_ ) renaming ( not to negate )
open import Relation.Binary.PropositionalEquality hiding ( [_] )
open import ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.