-
Notifications
You must be signed in to change notification settings - Fork 10
Migrating to Monomorphised LLBC #275
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
base: main
Are you sure you want to change the base?
Conversation
|
Now the problem is the matching of certain functions using was used to match now we want it to match the monomorphised Since we are not familiar with |
|
@protz The table has been implemented as lid_full_generic in AstOfLlbc. We also implemented a function re_polymorphize right below the table. We can simply call this function to transform the expression before the pattern matching to be made. So that there seems to be no need to fix the cremepat here. Could you please have a look and comment on it? We have tested the function on a PreCleanup pass, where the re_polymorphize function works perfectly with the existing cremepat mechanism. But there is an issue of matching exact string in the same function that we are trying to fix tomorrow. |
|
We are now implementing the transition, but the transition is now based on the current version (not the one in the PR), and we have observed several issues with this transition:
|
|
I'm looking into these errors |
We could add the trait refs to the re-polymorphization side table. Or if not the trait refs themselves, the output of Alternatively you can safely assume that the generic parameter |
That's a maybe-weird design choice: |
|
Thanks for the discussion! For your points:
|
Yeah I agree actually. This and the other bugs reported above have been fixed in AeneasVerif/charon#810. |
|
Thank you so much for the quick fix! |
|
Hi @Nadrieril @msprotz , I'm trying to fix the rewriting of While the generated function definition for it is named as: The names are slightly different and eurydice refuses to compile cuz it can not find the implementation of this function. For reference, I'm using the test case: |
|
It seems a bit of name normalization is missing. The name that we pass to krml is a list of path elements, I don't think eurydice does any more manipulation of the name; so the difference is due to karamel. Looking through krml, the only place that inserts the special |
|
After quite a long debugging, the mono migration for built-in functions are now handled. The ultimate scheme turns out to be quite simple with some tricky points.
|
|
@protz Here's another point I want to discuss with you. First of all, I'm still not completely sure what is the third field of Then, here comes the key question. In
|
|
Besides, there still seems to be the |
|
Summary of current status: All C cases have been tested and fixed, except the following:
|
|
Note: AeneasVerif/charon#854 changes how we represent monomorphized names a tiny bit. For your purposes, you'll just have to add a few |
This PR is for #257. The current goal is to support monomorphised LLBC (add
--monomorphizefor charon in Makefile). Hopefully we can support both monomorphized and generic code.The first fix is to eliminate
core::option::Optionwhich was previouly removed byMonomorphization.datatypes. Now it's removed bydrop_unused_typefollowing the style ofdrop_unusedinkrml/Inlining.ml