Skip to content

Instantly share code, notes, and snippets.

@dagit
Last active December 14, 2015 06:49
Show Gist options
  • Save dagit/5045599 to your computer and use it in GitHub Desktop.
Save dagit/5045599 to your computer and use it in GitHub Desktop.
Possible bug in Agda? This program gives me a stack overflow when I try to load it.
module Bug where
data ℕ : Set where
zero : ℕ
suc : ℕ → ℕ
data _≡_ {A : Set}(x : A) : A → Set where
refl : x ≡ x
cong : ∀ {A : Set} {B : Set}
(f : A → B) {x y} → x ≡ y → f x ≡ f y
cong f refl = refl
lem : (n : ℕ) → n ≡ n
lem zero = refl
lem (suc n) = cong (λ x → x) (lem (suc n))
@dagit
Copy link
Author

dagit commented Feb 27, 2013

In fact, it seems that the last line can be as simple as:
lem (suc n) = cong (λ x → x) (lem {! !})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment