Splitting tuple types into separate modules for each#3204
Splitting tuple types into separate modules for each#3204mtzguido wants to merge 5 commits intoFStarLang:masterfrom
Conversation
|
@nikswamy FYI before merging we should fix Pulse and possibly other projects. If they mention, say, |
|
I have a patch for Steel+Pulse ready. HACL* is failing since I think Vale relies on the concrete location of tuples, I'm taking a look. Maybe we wait until after the fork..? Meanwhile I added an |
No explicit mentions of Mktuple etc.
|
Updated on top of the new build and prelude. All tuples and all dtuples except for dtuple2 are now in standalone modules, with uniform naming, and are automatically loaded. Some projects will need a patch due to things moving modules. I wonder if we could introduce some kind of migration mechanism like a top-level |
|
We discussed about this today and thought that it would be preferable to:
However looks like this already needs some patches, including for vale which hard-codes the location of tuples: I'm not sure how to even update Vale, so I'm not gonna push for this PR for now. |
Discussed with @nikswamy today: always loading the definitions for all tuples (normal ones up to 14, dependent up to 5) is an unnecessary load on the typechecker and SMT solver.
This PR splits all tuples of arity >=3 into separate modules. The dependency analysis is modified to recognize tuple patterns and types and add the relevant dependencies (it is slightly conservative since it always treats
*and&as referring to tuples even if they are overloaded, but over-approximating is not terrible here). I measured a very slight improvement in FStar.ModifiesGen (63s -> 60s). Not sure if other files will have more significant gains, but this anyway looks desirable to me.It does mean that, in an interactive setting, if you try to use a tuple you have not yet used you will have to reload the module.
In a follow up, I think we should call the constructor for each tuple just
Mk, since they are already in different modules. Also, I changed the tuple detection logic into just a table that we look up. This actually removes a few incorrect snippets, and is not too bad to maintain IMO.