-
Notifications
You must be signed in to change notification settings - Fork 665
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
[econstr] Flag to make to_constr
fail if its output contains evars
#6454
Conversation
Why is the commit from #6422 appearing? |
I think |
vernac/himsg.ml
Outdated
@@ -632,7 +632,8 @@ let explain_refiner_cannot_generalize env sigma ty = | |||
pr_leconstr_env env sigma ty ++ str "." | |||
|
|||
let explain_no_occurrence_found env sigma c id = | |||
let c = EConstr.to_constr sigma c in | |||
(* XXX: Fixme *) | |||
let c = EConstr.to_constr ~abort:false sigma c in | |||
str "Found no subterm matching " ++ pr_lconstr_env env sigma c ++ |
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.
Why not use pr_leconstr here?
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, I was hesitating at first whether to make this PR "tagging-only" or to also fix some trivial ocurrences. I guess it makes sense to fix a few, so I'll update this + I will change the name of the flag.
Good point, I wanted a very scary name as the idea is for the flag to go away, I'll give it another try. |
bccdf47
to
5d79587
Compare
It seems the linter fails. |
Note that this PR implements a check that should be enabled in dev builds, but should be disabled in production IMO. So I dunno how to handle such stuff. |
a5b46ba
to
1d512bc
Compare
Resurrect configure time -debug? |
1d512bc
to
995bbf3
Compare
1c5f6f0
to
8ea3b93
Compare
c0543b5
to
ec46c61
Compare
Sorry, I probably read too quickly "Enrico's PRs"! Anyways, this is still waiting for benching, I'll launch one. |
Your job failed, relaunched: https://ci.inria.fr/coq/job/benchmark-part-of-the-branch/379/console |
As the previous bench showed this seems to have no effect:
|
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.
OK for me.
@mattam82 Do you agree with the PR as it is currently? The changes in Obligations ought to be deferred to another PR, right? @PierreCorbineau This PR is marginally related to Funind, do you want to make a particular comment on it anyways? |
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.
I'm ok with it.
@mattam82 ping! |
Yes, indeed, the changes should be deferred to antother PR. Green light on! |
Cool! The effects of this patch are likely to be observed in the wild, so keep an eye folks. |
Shouldn't this have had a dev/changes entry? It seems like something plugin developers should know about, and ocaml types won't tell them about it. |
@SkySkimmer Not sure if it really deserves it, we keep changing the semantics of the ML API without care and so far people haven't punched us in the face yet. If you're concerned you can open another PR though... |
@SkySkimmer I think you are right, I will push a PR. |
[coq] Adapt to coq/coq#6454 "forbid calling to_constr on open terms"
Revert "[coq] Adapt to coq/coq#6454 "forbid calling to_constr on open terms""
We forbid calling
EConstr.to_constr
on terms that are not evar-free,as to progress towards enforcing the invariant that
Constr.t
isevar-free. [c.f. #6308]
Due to compatibility constraints we provide an optional parameter to
to_constr
,abort
which can be used to overcome this restrictionuntil we fix all parts of the code.
Now, grepping for
~abort:false
should return the questionableparts of the system.
Not a lot of places had to be fixed, some comments:
Evd/Constr
[Evd.define
beingthe prime example] do seem real!
Constr/EConstr
.A notable user of this "feature" is
Obligations/Program
that seem tolike to generate kernel-level entries with free evars, then to scan
them and workaround this problem by generating constants.