Made it possible to turn off the occurrence analysis for functions #8295
+259
−6
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.
I added the option
--no-occurrence-analysis, which turns off the occurrence analysis for functions. I have a mutual block that is 1762 lines long, and before I enabled the option I did not see Agda succeed in checking that block.I also tried to enable the flag for the full development. I could type-check quite a lot of code before Agda complained. The speedup was something like 5%.
I placed the help text for the option in the section "Modalities". That is not a perfect fit. An alternative would be to add a new section. Any opinions?
In the documentation I connect the analysis to positivity checking and to the unused argument feature. Is the analysis used for something else that should be mentioned in the documentation?
Given that bugs in the positivity checker can lead to inconsistencies I suggest that someone checks that the implementation makes sense. The main change was to treat every function argument as "matched":
By the way, is the use of
__IMPOSSIBLE__above safe? The documentation of_funClausesdoes not state that a function must have at least one clause, but it seems as if functions without clauses are handled differently.It might make sense to have a pragma as well, but I do not currently plan to implement that feature.
@martinescardo, the flag
--no-occurrence-analysisturns off some Agda features that you might not want to rely on.