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

Is there an associative list in the standard library?

I am not confident enough to try proving properties about the AVL tree that is there, so I want to try something simpler. I could implement it on my own, but do not want to spend time doing that if it is already hiding in the library somewhere.
Marko Grdinić
  • 3,798
  • 3
  • 18
  • 21
0
votes
1 answer

How to deal with conflicting module definitions?

open import Data.Vec open import Data.Nat open import Data.Fin open import Data.Integer open import Data.Rational open import Data.Product open import Relation.Binary.PropositionalEquality using (_≡_; refl) Infoset = ℕ Size = ℕ Player = ℤ data…
Marko Grdinić
  • 3,798
  • 3
  • 18
  • 21
0
votes
1 answer

Auto implicit not solved, even though it should be straightforward function application on closed terms

I have the following Agda code: open import Data.Maybe open import Data.Product data Addressing : Set where PC++ SP++ SP-- : Addressing combine : Maybe Addressing → Maybe Addressing → Maybe Addressing combine nothing y = y combine (just x)…
Cactus
  • 27,075
  • 9
  • 69
  • 149
0
votes
1 answer

What are the definitions for `isoToEquiv` and `iso`?

This is from the 2019 Cubical Agda intro paper. They are not in Cubical.Core.Everything and even file content search for the Cubical v0.1 library is not turning up anything for me. {-# OPTIONS --cubical #-} open import Cubical.Core.Everything open…
Marko Grdinić
  • 3,798
  • 3
  • 18
  • 21
0
votes
1 answer

How to import the `∃-syntax`?

open import Data.Product using (_×_; ∃; ∃-syntax) open import Data.List Any-∃ : ∀ {A : Set} {P : A → Set} {xs : List A} → ∃[ x ∈ xs ] P x Could not parse the application ∃[ x ∈ xs ] P x Operators used in the grammar: ∃[_] (prefix notation, level…
Marko Grdinić
  • 3,798
  • 3
  • 18
  • 21
0
votes
1 answer

What is the right way to use the `do` notation with Agda-stdlib's IO?

I'm trying to use the do-notation together with IO from agda-stdlib, but, strangely, the type of _>>_ uses ∞: {B : Set a} (m₁ : ∞ (IO B)) (m₂ : ∞ (IO A)) → IO A. Because of that, I need to interleave ♯s between applications, but this makes the usage…
MaiaVictor
  • 51,090
  • 44
  • 144
  • 286
0
votes
3 answers

Pushing a path along a pair of paths originating from its endpoints

Suppose I have, using the cubical-demo library, the following things in scope: i : I p0 : x ≡ y p1 : x' ≡ y' q0 : x ≡ x' q1 : y ≡ y' How do I then construct q' : p0 i ≡ p1 i ?
Cactus
  • 27,075
  • 9
  • 69
  • 149
0
votes
1 answer

How exactly can cong be well-typed?

I was looking at the definition of cong: cong : ∀ {a b} {A : Set a} {B : Set b} (f : A → B) {x y} → x ≡ y → f x ≡ f y cong f refl = refl And I couldn't understand why it is well-typed. In particular, it seems like the implicit argument of refl must…
MaiaVictor
  • 51,090
  • 44
  • 144
  • 286
0
votes
1 answer

What is the right way to perform 64-bit arithmetic?

I've found primitives for 64-bit floating point and 32-bit signed integer operations. I've not found primitives for 64-bit unsigned integer operations. Without those, what is the correct way to deal with 64-bit uint arithmetic on Agda?
MaiaVictor
  • 51,090
  • 44
  • 144
  • 286
0
votes
1 answer

How does agda compiler figure out what to compile?

In Coq, it is explicit what is from the logical world (Prop) and what is from the computationnal world (Set). The proof world provides guarantees about the computationnal world, and is the only one that needs to be compiled. In Agda, there is no…
MrO
  • 1,291
  • 7
  • 14
0
votes
2 answers

Rewrite and keep pattern matching?

I have the following definition: ren-refl′ : ∀ {Γ i t} (ts′ : List Ty) → (e : Tm {i} (Γ <>< ts′) t) → ren (keep* ts′ reflᵣ) e ≡ e ren-refl′ {Γ} ts′ (var v) rewrite keep*-refl {Γ} ts′ | ren-var-refl v = refl ren-refl′ {Γ} ts′ (con e) rewrite…
Cactus
  • 27,075
  • 9
  • 69
  • 149
0
votes
1 answer

How to complete this proof of commutativity with `replace`?

On this documentation, it is mentioned how replace could be used to complete the proof, but it ends up using rewrite, which seems to be a syntax sugar that writes replace for you. I'm interested in understanding how to use it explicitly. If I…
MaiaVictor
  • 51,090
  • 44
  • 144
  • 286
0
votes
1 answer

How can I store a function inside record/data type in Agda?

I've read the doc. It says: The strict positivity condition rules out declarations such as data Bad : Set where bad : (Bad → Bad) → Bad -- A B C -- A is in a negative position, B and C are OK since there is a negative…
ice1000
  • 6,406
  • 4
  • 39
  • 85
0
votes
0 answers

Parse error on comments in Agda for Emacs?

I've tried type checking modules programs that import modules from Builtin or the standard library, it always brings me to some module in the particular library that I'm importing from and says there's a parse error on a comment. When it does this…
Eben Cowley
  • 175
  • 4
0
votes
1 answer

Yellow highlight in Agda

I write the below code in Agda. open import Relation.Binary.PropositionalEquality open import Data.Unit data : Set where tt : ff : test_a : tt ≡ tt test_a = refl test_b : ff ≡ ff test_b = refl When I load the above code, I get yellow…
mmsss
  • 263
  • 1
  • 2
  • 7