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
Unguarded Fixpoint becomes guarded after section closes #14317
Comments
There is a trivial proof of False using this, so raising priority. |
The easiest fix would be to forbid changing consistency flags inside sections. |
How come the typing flags were not preserved during elaboration at section closing time? |
That would still feel a bit fragile maybe? |
We could also stop losing the typing flags in Line 1385 in c53190a
However there is also a hole if you do something like Section S.
Unset Guard Checking.
Let bad := fix bad (n:nat) : False := bad n.
Set Guard Checking.
Definition really_bad := bad 0.
End S.
Print Assumptions really_bad. since section variables don't have attached typing flags. |
IMHO the only sound way to store guardedness is to put it in the |
What about other flags? This doesn't save you from having to traverse everything anyways. I was thinking of this problem more in the line of "environment tainting", once an environment is tainted, it is not easy to have it back. Morally the sections should preserve tainting [as would typing rules if you add a tainted bit to \Gamma], so the above example once elaborated should be equivalent to:
|
Yes, but Print Assumption does that anyways.
It depends. Some of them would benefit from having an explicit representation in the term, notably type-in-type (with a dedicated sort). I belive that impredicative set should also be done that way. Positivity checking is better handled in the inductive block since they can't be unfolded. For the other ones it's a bit murky. |
Did everybody forget about this issue? I'm putting it in the 8.14+rc1 milestone (because otherwise the blocker label amounts to nothing). But IMHO this would deserve an 8.13.3 release (cc @gares). |
Thanks for the heads up. |
Description of the problem
Consider the following snippet:
I would expect the last
Print Assumptions
to say "loop
is assumed to be guarded".Coq Version
8.13.2 and somewhat recent
master
(b78e6cf).The text was updated successfully, but these errors were encountered: