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
Int63.eqb_correct doesn't compute #14514
Comments
I can think of two ways to resolve this issue.
|
Please let us not replace a trivial opcode with a costly memory-allocating one. That said, having an additional opcode of type |
The reduction could be provided by going through a sprop equality (using the uip flag). |
That is elegant. But wouldn't that still block due to the use of |
FTR I've been advocating for replacing all primitive Prop-living axioms by an SProp variant, so that we recover canonicity in a systematic way. |
Yes |
Sorry if this is a naive question, but why should we use uip or go to sprop ? I think reducing |
@vblot this would need adding new primitive reductions to the various machines, including potential opcodes to the VM. |
Yes, that is what I had in mind. Is this complicated? |
It's fragile and ad-hoc, and increases the TCB. |
I see. OTOH there are already many operations on |
Just to be clear, there is no other equality proof. And in the forsaken times of retro-knowledge, you could even prove it in Coq. Just because retro-knowledge was removed from Coq does not mean that |
I think it depends on the semantics of "equality proof". If by that you mean a term (without axioms) of type equality then I agree, but if I'm not mistaken, when you do not have uip you have a sound system with:
while with uip you can prove |
|
Actually, I meant your point 1. At the time of retro-knowledge, |
Thanks! I had forgotten about that one... But then it seems counter-intuitive to require the uip flag, since |
OK, I am being confusing, sorry about that. There are two meanings for UIP over a type
Colloquially we also refer as Definitional UIP the kernel flag that unconditionally allows the second thing, making the global assumption that all types are strict sets. Third, In order to prove the first point you need to be able to eliminate from the considered equality. So, in practice that means that there is a loop in the reasoning that you must untie by explicitly allowing Definitional UIP for this type, otherwise you won't be able to do anything with the axiomatic SProp equality. So you have to be careful about how you express the boolean equality test and the fact it reflects the actual propositional equality of the theory. |
This should be sufficient for defining the wrappers, yes. |
Thanks for the explanation, I think I'll have to read stuff about this. |
And this would reduce to |
Yes, and it would reduce to |
One option would be to actually replace the current primitive |
That is exactly the option I am vetoing. Opcode |
Right, so there is indeed a performance issue. Sorry for my misunderstanding and thanks for the explanation. |
If I understand how the VM works correctly, we could allocate a global |
Actually, we don't have to introduce an opcode for this. We could write an untyped program in the VM using the low-level equality and returning refl when the two arguments coincide. It's safer to write code in lambda than in C... |
I dispute this statement. When I had to debug a memory corruption due to cofixpoints in the VM, I would have much preferred if the code had been written in C. (As the idiom goes, writing code is the easy part, debugging it is the hard part.)
That would work, yes. Obviously, we would still have to pay for destructuring this value ( |
I don't remember what caused this problem, but cofixpoints rely on mutable memory which is very hard to get right. Here, I simply propose to write the lambda term |
Also, even if we add a gazillion of opcodes to the VM to handle all the specification primitives, it's not going to solve the canonicity issue for the other reductions, and we'll have to do something there as well. I believe that the SProp solution is cleaner conceptually, but an alternative in this precise case would simply be to allow to define a priori untyped terms for CIC definitions. Indeed, there is a clear program that does what we want, which is the Gallina equivalent of the lambda program above. If you can do this you get everything for free, including Cclosure, VM reduction, cbv, cbn, etc. |
This is exactly what I was about to write. I wonder what it would cost to be able to write something like |
@silene In any case I don't think it should be exposed to the user, at least not in the Gallina syntax because everything goes through the pretyper, and only typed terms make sense. Also, you have to be careful with these special axioms, because you don't want the untyped definition to unfold unconditionally otherwise you'll break SR. |
That is a good point. And it also means that the lambda expression has to be much more complicated than just |
I also encountered this limitation while wanting to perform a cast on primitive integers. |
Hello, I am still interested in having an |
Hello, two years later, I am still interesting in having this. Any news? |
Description of the problem
Computation gets stuck on
eqb_correct
for native integers. This is a problem in particular when usingInt63.cast
, which blocks reduction.Indeed, eqb_correct is an axiom, while it had an associated reduction rule in original native-coq.
Coq Version
at least on 8.10.2 and 8.13.2
The text was updated successfully, but these errors were encountered: