fix: enable more optimizations on inductives with computed fields in the new compiler #8754
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR changes the implementation of computed fields in the new compiler, which should enable more optimizations (and remove a questionable hack in
toLCNFthat was only suitable for bringup). We convertcasesOntocaseslike we do for other inductive types, all constructors get replaced by their real implementations late in the base phase, and then thecasesexpression is rewritten to use the real constructors intoMono.In the future, it might be better to move to a model where the
casesexpression gets rewritten earlier or the constructors get replaced later, so that both are done at the same time.