-
Notifications
You must be signed in to change notification settings - Fork 345
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
Adding fields to a record can cause Agda to reject previous definitions #2500
Comments
CONGRATS, YOU FILED ISSUE 2500! YOU WON 50 HOURS OF FREE AGDA BUG FIXING! START NOW! IT IS COMPLETELY FREE!! |
This is just good old #434. I had heroic plans to fix it at the last AIM. For various reasons I lacked the concentration to attack it. But the next AIM is coming up soon. |
Did you ever hear the tragedy of Darth Abel the Wise? I thought not. It’s not a story the Haskellers would tell you. It’s an Agda legend. Darth Abel was a Dark Lord of the Types, so powerful and so wise he could use the Types to influence the terms to create... types. He had such a knowledge of the types that he could even keep the ones he cared about from bugs. He became so powerful that the only thing he was afraid of was losing his types, which eventually, of course, he did. Ironic. Agda could save others from bugs, but not itself. |
Alas, we are still far from being able to bootstrap Agda in Agda. For one, Agda is not efficient enough for feasible development of a 300 module piece of software. For two, we probably would need 60 very active developers instead of the 6 we have. Even developing a verified kernel would be a heroic effort. While this would prevent bugs like proving false, it would not weed out all the usability bugs (which are the great majority). |
Oh I'm under no delusion that it's going to happen any time soon. But to the latter point, I think there's lots of untapped potential in formalizing (or at least stating basic properties of) "non-mathy" stuff: things like quote compose unquote should form the identity, case splitting should generate only valid syntax, etc.. An example I encountered: I wrote a JSONEncoding typeclass which entails So while sure, it's not feasible to write Agda in Agda (for now!), I think you underestimate just how much benefit could be there. Even very simple guarantees can go a long way. |
I am totally on your side. Even doing a pen and paper proof for a significant fragment of Agda would be a revolution. Just documenting invariants of the code does make a huge difference. I think in the beginning, @nad put some effort into writing quick-check properties. I try to document invariants where I can. But of course, yes, trying to prove them would bring many issues to light. I think in an open source project without formal responsibilities it is very difficult to retrofit correctness properties. Say I add some asserts to code I have not written myself and expose sleeping bugs in Agda, then I have to fix them myself, since I cannot force the author to fix them. And I cannot just add these assertions that let Agda crash with an internal error where it did not before. |
Closing this as duplicate of #434. |
Actually it's a combo of #434 and #1079. Here's the failing example without the record: data ⊤ : Set where
tt : ⊤
flip : ∀ {t₁ t₂ t₃ : Set} → (t₁ → t₂ → t₃) → t₂ → t₁ → t₃
flip f x y = f y x
R : Set₁
R = (f : ∀ {a b c : Set} → {{_ : ⊤}} → (a → b) → (b → c) → ⊤)
(let g : ∀ {a b c : Set} → (b → c) → (a → b) → ⊤
g = flip (f {{tt}})) →
Set |
Agda accepts the above code, but rejects it if you uncomment the final
top : ⊤
field. Strangely, changing the definition ofg
to the following (adding a single{_}
pattern) causes it to be accepted again:The text was updated successfully, but these errors were encountered: