Questions tagged [agda]

Agda is a dependently typed, total functional programming language and a proof assistant.

Agda is a dependently typed functional programming language. It has inductive families, i.e., data types which depend on values, such as the type of vectors of a given length. It also has parametrised modules, mixfix operators, Unicode characters, and an interactive Emacs interface which can assist the programmer in writing the program.

Agda is a proof assistant. It is an interactive system for writing and checking proofs. Agda is based on intuitionistic type theory, a foundational system for constructive mathematics developed by the Swedish logician Per Martin-Löf. It has many similarities with other proof assistants based on dependent types, such as Coq, Epigram, Matita and NuPRL.

The current version is 2.6.1.1

Useful links

819 questions
0
votes
1 answer

agda: How do I tell the type system that two types are equal?

Say I have type dependent on Nat data MyType : (i : ℕ) → Set where cons : (i : ℕ) → MyType i and a function: combine : {i₁ i₂ : ℕ} → MyType i₁ → MyType i₂ → MyType (i₁ ⊔ i₂) Now I'm trying to write a function: create-combined : (i : ℕ) → MyType…
clahey
  • 4,795
  • 3
  • 27
  • 20
0
votes
1 answer

Termination checking failed

I was trying to train on this kata about longest common subsequences of a list which I slightly modified so that it worked with my versions of agda and the standard library (Agda 2.6.2, stdlib 1.7) which results in this code {-# OPTIONS --safe…
Junkyards
  • 25
  • 4
0
votes
1 answer

Configuration file for command-line options

I'd like all modules in my Agda library to be compiled with the --prop command-line option. Is there some configuration file where I can put default options for my library?
Jo Liss
  • 30,333
  • 19
  • 121
  • 170
0
votes
1 answer

Should I add src/MAlonzo to .gitignore?

Compiling my Agda code results in a src/MAlonzo directory being created. (Where src/MyProject is where my Agda code lives.) It contains a bunch of .hs (Haskell) and .o (object) files. Is there anything in this directory that I should commit, or do…
Jo Liss
  • 30,333
  • 19
  • 121
  • 170
0
votes
1 answer

Proving a type is a Functor - Inference error?

I have the following (simplified) data types, and I'm trying to prove a type is a functor. data T (a : Set) : Set where …
cstml
  • 350
  • 1
  • 12
0
votes
0 answers

Control-key combinations are not working when using emacs in Mac terminal

I'm trying to get started with Agda. In order to do that I'm using (as recommended here) emacs within the terminal on my MacBook (macOS Monterey Version 12.0.1), which I've installed via homebrew. The problem: Most of the key-combinations that…
beard
  • 21
  • 4
0
votes
1 answer

Decidable equality of data types in Agda

I am trying to prove decidable equality of a data type in Agda using the Agda stdlib. I have the following code, but I am unsure what to fill in the hole. The goal seems to make sense, but actually constructing it is challenging. Is this possible in…
Qurben
  • 1,276
  • 1
  • 10
  • 21
0
votes
1 answer

How to declare axioms in Agda?

I was reading the book "Algebra driven design" and in the second chapter it starts designing a simple algebra system like this: data Tile haskell :: Tile sandy :: Tile cw :: Tile -> Tile ∀ (t :: Tile). cw (cw (cw (cw t))) = t and it starts…
Farzad Bekran
  • 489
  • 1
  • 6
  • 13
0
votes
0 answers

Prove transformation between data types correctness

I have two data types and a transformation function to convert from one to another data TTerm : Set where TVar : Nat -> TTerm TPrim : TPrim' -> TTerm TDef : QName -> TTerm TCon : QName -> TTerm TLam : TTerm -> TTerm TApp : TTerm ->…
0
votes
1 answer

Looking for the Agda module that contains decidable equality for lists

Given two lists xs and ys, I would like to obtain a value of Dec(xs ≡ ys). Does any one know the name of the standard library module which contains such an operator?
user1023733
  • 805
  • 5
  • 14
0
votes
1 answer

Unbound variable on case split in AGDA

We've been trying out some AGDA by basically playing parts of the natural number from Lean in AGDA. However, for inequalities we came across an error that was not present in the Lean solution to this problem. This is the code: module minimalExample…
Emiel Lanckriet
  • 95
  • 2
  • 12
0
votes
1 answer

"Could not load module `Control.Monad.Trans.Maybe'" while trying to install Agda 2.6.1.2

I'm trying to install Agda 2.6.1.2 by following the instructions in the docs, but when running the command cabal install Agda I'm receiving the following error: src\full\Agda\Utils\Maybe.hs:13:1: error: Could not load module…
0
votes
2 answers

Stuck on unification problems during case splitting

Suppose we have the following code: open import Data.Fin open import Data.Nat data SType : ℕ → Set where variable ℓ : ℕ ι : Fin ℓ τ τ' : SType ℓ infixl 5 _,_ data Ctx : ℕ → Set where ⊘ : Ctx zero _,_ : Ctx ℓ → SType ℓ → Ctx (suc…
0xd34df00d
  • 1,496
  • 1
  • 8
  • 17
0
votes
1 answer

Agda: std-lib: List: pattern matching with snoc

I wrote a function to get everything but the last element of a List from std-lib: open import Data.List allButLast : ∀ {a} {A : Set a} → List A → List A allButLast [] = [] allButLast (x ∷ []) = [] allButLast (x ∷ xs) = x ∷ allButLast xs For…
fsuna064
  • 195
  • 1
  • 7
0
votes
1 answer

Agda list last of a generic list of naturals concatenated with a list of 1

I have the function: natListLast : List ℕ → ℕ natListLast [] = 0 natListLast nats@(x ∷ xs) = v.last (v.fromList nats) When I do _ : natListLast (2 l.∷ l.[] l.++ 1 l.∷ l.[]) ≡ 1 _ = refl I don't get any error. But when I try to…
fsuna064
  • 195
  • 1
  • 7