-
Notifications
You must be signed in to change notification settings - Fork 339
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"Panic: uncaught pattern violation" involving holes and with
#5805
Comments
This correctly reports unsolved metas with Agda 2.6.1. {-# OPTIONS --allow-unsolved-metas #-}
open import Agda.Primitive
open import Agda.Builtin.Equality
cong : ∀{a b} {A : Set a} {B : Set b} (f : A → B) {x y : A} (eq : x ≡ y) → f x ≡ f y
cong f refl = refl
record Category (o m : Level) : Set (lsuc (o ⊔ m)) where
infixr 40 _∘_
infixr 10 _⇒_
field
Ob : Set o
_⇒_ : Ob → Ob → Set m
_∘_ : ∀ {x y z} → y ⇒ z → x ⇒ y → x ⇒ z
mono : {X Y : Ob} → X ⇒ Y → Set _
mono {X} {Y} f = ∀ {Z : Ob} {g : Z ⇒ X} → f ∘ g ≡ f ∘ g → Set
Sets : (ℓ : Level) → Category (lsuc ℓ) ℓ
Sets ℓ = record
{ Ob = Set ℓ
; _⇒_ = ?
; _∘_ = λ f g x → f (g x)
}
module SetCat {o} where
open Category (Sets o)
postulate
X Y : Ob
f : X ⇒ Y
mono-f : mono f
mono-f fg≡ with fgz≡ ← cong ? fg≡ = ? |
Bisection blames commit d1a9d7d (ping @jespercockx).
Debug printing with
So it seems that erasure-stuff is leaking into type-checking code that does not use erasure. I wonder whether this calls for an option |
We can shrink away the universe levels: open import Agda.Builtin.Equality
cong : ∀{a b} {A : Set a} {B : Set b} (f : A → B) {x y : A} (eq : x ≡ y) → f x ≡ f y
cong f refl = refl
record Category : Set₂ where
field
Ob : Set₁
_⇒_ : Ob → Ob → Set
_∘_ : ∀ {O P Q} → P ⇒ Q → O ⇒ P → O ⇒ Q
-- Moving this out of the record fixes the problem.
idem : {X : Ob} → X ⇒ X → Set₁
idem {X} f = f ∘ f ≡ f → Set
Sets : Category
Sets = record
{ Ob = Set
; _⇒_ = {!!}
; _∘_ = λ f g x → f (g x)
}
open Category Sets
postulate
Y : Ob
f : Y ⇒ Y
idem-f : idem {X = _} f -- Solving the _ fixes the problem
idem-f ff≡f
with ffx≡fx ← cong {!!} ff≡f
= Y |
We have discussed |
Yes, the problem with |
If you were to go down that route, would you also fork the standard library? That does not sound like a good idea to me. |
Would this be necessary? As long as the standard library does not use |
Let's say that we start using erasure in some standard library modules. Consider the following scenario:
This does not sound very nice to me. |
Well, I would think that |
If we start to use |
I see, I get your point. So a just project-wide flag would not work for the standard library once it starts using erasure. We need to retain the possibility to apply it module-wise. The flag would be coinfective. |
@jespercockx : Do you think you can look into this issue for a soonish release of 2.6.2.2 (#5831). |
I'm taking a look now, if it doesn't take too much time I'll try to fix it. So far, I found that the actual problem seems to be not in the part of the occurs check that I changed, but in |
I found the cause of the problem: the call to The problem here is that |
Continue discussion at #5832. |
This fixes the issue when I load Issue5805.agda in Emacs, but when I run `make test` it somehow throws a pattern violation again.
This fixes the issue when I load Issue5805.agda in Emacs, but when I run `make test` it somehow throws a pattern violation again.
This fixes the issue when I load Issue5805.agda in Emacs, but when I run `make test` it somehow throws a pattern violation again.
I have encountered a
Panic: uncaught pattern violation
error when refactoring my development. This is the furthest I could minimize it:Notably, moving the definition of
mono
intomodule SetCat
stops reproducing, as does this variation that avoidswith
:I am using Agda 2.6.2.1.
The text was updated successfully, but these errors were encountered: