Make Nativecode.string_of_kn really injective for good. - #22399
Conversation
|
Is this actually injective? seems like both |
|
What about mapping |
You're right. I think that for this kind of property I can only trust formal proofs... |
|
Note that there is also a potential issue with the encoding of bound module paths, we prefix them with |
If we follow my suggestion of having all escapes be |
|
I'll do something along those lines, it's indeed safer. |
This is critical for soundness of native compilation, as otherwise a definition may overwrite another one. This was not the first time such a problem arised, see 244d7a9. We go for a belt-and-braces approach and try to make all subcomponents injective, including the modpath printer. Fixes rocq-prover#22364: string_of_kn is non-injective.
755b784 to
b2e9d86
Compare
|
This should be ok now. (There is still something potentially fishy with the bound module names unique identifiers, but it's not clear to me how we can be in a situation where both are accessible to the native compiler. Any idea to break that?) |
This comment was marked as low quality.
This comment was marked as low quality.
Is it not possible to trigger native compute inside a functor? |
|
AFAIU the only way to have two reachable bound module names with different ids is via module substitution, and at this point we don't care anymore about toplevel compilation of constants in native. (Rocq prevents you to syntactically declare twice the same name for module parameters.) |
This is critical for soundness of native compilation, as otherwise a definition may overwrite another one. This was not the first time such a problem arised, see 244d7a9.
Fixes #22364: string_of_kn is non-injective.