Introduce an efficient typing rule for let-bindings in Typeops.#21678
Open
ppedrot wants to merge 1 commit intorocq-prover:masterfrom
Open
Introduce an efficient typing rule for let-bindings in Typeops.#21678ppedrot wants to merge 1 commit intorocq-prover:masterfrom
ppedrot wants to merge 1 commit intorocq-prover:masterfrom
Conversation
When the expand_let typing flag is set in the environment, we change
the kernel typing rule for let-bindings from
let x := t in u : T{x := t}
to
let x := t in u : let x := t in T.
We cannot do this by default since it may change the inferred type for
some expressions, which is returned when the expected type is not
provided. To work around this, we statically set the flag in expressions
for which the precise inferred type is not relevant. For now there is
no user-facing flag that would allow setting this option in a more
fine-grained way though, but it is easy to fix.
This is a revival of rocq-prover#13606 and a partial fix of rocq-prover#11838. The latter still
suffers from superlinear blowups in unrelated parts of the kernel, namely
VM and native compilation.
Member
Author
|
@coqbot bench |
Member
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
When the expand_let typing flag is set in the environment, we change the kernel typing rule for let-bindings from
to
We cannot do this by default since it may change the inferred type for some expressions, which is returned when the expected type is not provided. To work around this, we statically set the flag in expressions for which the precise inferred type is not relevant. For now there is no user-facing flag that would allow setting this option in a more fine-grained way though, but it is easy to fix.
This is a revival of #13606 and a partial fix of #11838. The latter still suffers from superlinear blowups in unrelated parts of the kernel, namely VM and native compilation.