Discharge on the fly in the kernel - #18065
Conversation
That means canonically relying on discharge functions for global references.
This means the following changes: - kernel names include a section path in their name (encoded using MPdot) - in safe_typing.ml: add all generalisations of a declaration at the time of the declaration rather than at the end of the section TODO: - double-check what really needs to be in Safe_typing.section_data
|
I think that this PR is already implementing too much, insofar as it's geared towards one specific instances of the extensions we discussed yesterday. Namely,
is already assuming we'll be accessing the various specializations at the same time. Since we don't have any equations on these yet I think it's a bad idea to include this in this PR. Especially if we have to revert it at some point (e.g. if we go for Georges' proposal for instance). Can we just get
to start with something consensual? |
|
I'm not fully sure I understand the difference that you are making. Do you mean that you'd prefer to have a kernel name (as it is now) pointing to the list of all generalizations rather than having one kernel name per generalization? Closing a section would then be dropping the more specific body in each list vs dropping the kernel name pointing to the more specific body? |
|
I don't want the Constant type to be changed (for now), and instead of relying on the environment to get the various constant bodies, we should have one single list of bodies per constant. |
|
So, to confirm, you mean changing to and the same for constants? |
|
I would put the discharged versions in the section data, not the environment if they're not meant to be accessed by most things |
Note that, if, up to know, only the vm is interested in the discharge data, it can directly access the API of cooking.ml without needing a PR. From my point of view, what justifies the PR is that it eventually comes with a user access to the data, so this suggests that listing our wishes is the priority (as far as I'm concerned, my idea was the one given in the header of #17888.) |
This is expensive, since we need to recook the terms. If we do it once in a centralized place this is much simpler and faster. |
Sure, but if it is about putting this data in the section_data, it might just be enough to add a field there with the result of So, before unravelling what I did, and maybe having to ununravel afterwards, I would prefer to have a better view of what model we want to eventually provide. For instance, regarding the vm, is it something of the form |
|
The "needs: rebase" label was set more than 30 days ago. If the PR is not rebased in 30 days, it will be automatically closed. |
|
This PR was not rebased after 30 days despite the warning, it is now closed. |
Since #14727, the kernel has all the information to support discharging of declarations at the time of declaration. This was experimented in #17888 and this PR is the internal kernel part of #17888.
It implements the following:
MPdot)safe_typing.ml: add all generalisations of a declaration at the time of the declaration rather than at the end of the sectionNo user-level changes if I'm not mistaken.
Depends on #18062.
TODO: double-check what really needs to be in Safe_typing.section_data