-
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
Regression in 2.6.2: primEraseEquality
fails to compute (lack of normalization)
#5784
Comments
Such terms come from a stuck |
So it is stuck when rewriting with |
I tried to print that term with primEraseEquality {LEVEL} {TYPE}
{TERM1} {TERM2} refl Then I copy-pasted these two terms, and let Agda typecheck _ : TERM1 ≡ TERM2
_ = refl And it checks as expected. Then why couldn't |
Are the values equal up to eta or on the nose? Or are they equal up to whnf or just nf? agda/src/full/Agda/TypeChecking/Primitive.hs Lines 555 to 566 in 7028350
|
They are plain |
@Trebor-Huang could you try if you still have the same problem if you use this erasure function instead of {-# OPTIONS --rewriting #-}
open import Agda.Builtin.Equality
open import Agda.Builtin.Equality.Rewrite
postulate
eraseEquality : ∀ {ℓ} {A : Set ℓ} {x y : A} → x ≡ y → x ≡ y
eraseEquality-comp : ∀ {ℓ} {A : Set ℓ} {x : A} {eq : x ≡ x} → eraseEquality eq ≡ refl
{-# REWRITE eraseEquality-comp #-} This one does use type-directed conversion, while I believe |
Yes, I was going to do that. The problem does go away with the ^ ^ var (𝕤 𝕫) ∙ (var (𝕤 𝕫) ∙ var 𝕫) which is a plain lambda term using the well-scoped de Bruijn syntax. |
Perhaps the reason is that |
That seems like a bug, no? Here's a small test case open import Agda.Builtin.Nat
open import Agda.Builtin.Equality
open import Agda.Builtin.Equality.Erase
data Wrap : Set where
wrap : Nat → Wrap
test : wrap (1 + 1) ≡ wrap 2
test = primEraseEquality refl
thm : test ≡ refl
thm = refl -- Fails: primEraseEquality refl != refl |
agda-bisect says:
|
It seems to me that we should revert f728537 because it confuses the users. However, @jespercockx seems to suggest that the REWRITE version works better. If we go for the REWRITE version, we should place it somewhere canonical and deprecate the old |
The way I see it each of them has their own use cases:
So IMO the only thing that should really change is the documentation which should point users towards the version they need. |
Also works for |
Is it possible to internally use |
The easiest way to do that is just to change the implementation of |
Why not keep both versions? This means
|
The discussion has died down. So I went ahead and proposed the easiest fix by reverting the commit that introduced the regression: #5811. |
primEraseEquality
fails to computeprimEraseEquality
fails to compute (lack of normalization)
I'm implementing NbE for STLC. I found out that if I wrap some of my substitution lemmas with
primEraseEquality
, it blocks the computation of concrete terms when I hitC-c C-n
.How should I start debugging the source of the problem? I have no idea how to produce a MWE. I don't know how to read terms like this:
Does this mean that
primEraseEquality
blocks even onrefl
? I'm not sure I understand how it works, but in the docs it saysBut since the normalization result is
Agda.Builtin.Equality.Erase.primEraseEquality refl
(I enabled--prop --safe
flags), shouldn'tx
andy
already be definitionally equal?My Agda version is
v2.6.2.1-af5bfc0
, running on OS X.The text was updated successfully, but these errors were encountered: