New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Controlling typing flags with commands (no attribute) #10291
Conversation
Note that you based this PR on an outdated branch. |
b6c5dd0
to
b870df1
Compare
@Zimmi48 Thanks, this is corrected |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems OK barring the Print Assumptions related comment.
393d598
to
df9c390
Compare
Should be ok now. |
The test suite fails as the checker doesn't take into account the typing flags associated to a constant/inductive. |
Should be fixed :-) |
8276314
to
7c44c10
Compare
@ppedrot @SkySkimmer Can we merge this ? |
The checker using local typing flags means it also tries to use native compile / VM (and fails in native compile in the test suite) |
7c44c10
to
da200a7
Compare
Should be ok! |
Note that this PR is still missing a changelog entry (see https://github.com/coq/coq/tree/master/doc/changelog#unreleased-changelog for instructions). |
I added the changelog, thanks for your advice @Zimmi48 |
(* Locally set typing flags for further typechecking *) | ||
let orig_flags = env.env_typing_flags in | ||
let cb_flags = cb.const_typing_flags in | ||
let env = Environ.set_typing_flags {orig_flags with check_guarded = cb_flags.check_guarded; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be in the let env'
, such that you don't need to reset typing flags.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is still todo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed. Sorry for having missing that.
In fact I don't understand the lines 27-29:
let poly, env' =
match cb.const_universes with
| Monomorphic ctx -> false, env
Why is the env not enriched in the monomorphic case? Are the universes declared in the definition supposed to be yet here?
If so, why do we take env'
instead of env
in line 61?
let env =
if poly then add_constant kn cb env
else add_constant kn cb env'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be in the let env', such that you don't need to reset typing flags.
Actually never mind, we already do this resetting manipulation before the PR for the oracle so I'll clean it up in a follow up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs rebasing due to conflict
…ixpoints) and [check_positive] (for (co)inductive types).
type-in-type universes
Now all relevant typing_flags are taken in account by the checker. The different forms of assumptions are now printed by the checker.
ac7ec74
to
d6d8229
Compare
@SkySkimmer I'm back and I rebased! |
(* Locally set typing flags for further typechecking *) | ||
let orig_flags = env.env_typing_flags in | ||
let cb_flags = cb.const_typing_flags in | ||
let env = Environ.set_typing_flags {orig_flags with check_guarded = cb_flags.check_guarded; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is still todo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Considering this has been open for months and the changes don't look especially dangerous I'm going to assume other kernel/checker maintainers have nothing to say and merge without further delay.
(* Locally set typing flags for further typechecking *) | ||
let orig_flags = env.env_typing_flags in | ||
let cb_flags = cb.const_typing_flags in | ||
let env = Environ.set_typing_flags {orig_flags with check_guarded = cb_flags.check_guarded; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be in the let env', such that you don't need to reset typing flags.
Actually never mind, we already do this resetting manipulation before the PR for the oracle so I'll clean it up in a follow up.
…ute) Reviewed-by: SkySkimmer Reviewed-by: Zimmi48
…d sized_typing plugin that did the same thing.
…d sized_typing plugin that did the same thing.
…d sized_typing plugin that did the same thing.
…d sized_typing plugin that did the same thing.
This PR allows to enable and disable:
with some Set/Unset commands.
For this, the
check_guarded
typing flag is split intocheck_guarded
andcheck_positive
.The syntax of commands is:
Set Guard Checking
,Unset Guard Checking
,Set/Unset Positivity Checking
,Set/Unset Universe Checking
.This PR also adds a
Print Typing Flags
command which prints the status of those three flags, and improves a bit the output ofPrint Assumptions
.This PR is #9004 without the attributes part which is trickier.
Kind: feature