-
Notifications
You must be signed in to change notification settings - Fork 632
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
Derive Plugin gives "Error: Anomaly "more than one statement."" on Admitted
#13816
Comments
Thanks for cc-ing me. I can't do anything about it at the moment, though. So if someone wants to take this up, please do. |
The last one that touched the piece of code raising the error is @ejgallego , I don't know if it ever worked. Lines 1924 to 1934 in 8615aac
|
This example already raised the anomaly in 8.6. |
IMO we should error when admitting Derive, because you can do something like Derive f SuchThat (f = f). which leaves the type of |
@SkySkimmer This example should error out with an unsolved evar error. But does it mean that raising an error is always the appropriate behaviour? It wouldn't be my intuition. |
Indeed for the versions I'm familiar with I have confirmed that this concrete case never worked after looking at the original code.
Seems the most reasonable for now. |
Would that mean using AdmitAxiom+Qed? That was broken in 8.12 ( It would be nice to support this: Require Import Coq.derive.Derive.
Derive f SuchThat (f + 1 = 2) As pr.
Proof.
subst f; instantiate (1 := 42).
admit.
Fail Qed.
Admitted. |
I wouldn't keep my hopes very high w.r.t. In the best case it should be subsumed , externally, by equations, and internally, by an evolution of an API to better handle proofs with multiple holes where the 3 obligations / equations / and derive do rely on. |
Interesting, how does equations replace Derive? |
Internally the implementations are very similar, and it has similar needs w.r.t. opaque / transparent stuff, obligations, etc... I was planning to discuss with @mattam82 about this in person in the CUDW but the postponement / cancellation means it didn't happen [also that's quite a bit of work] So I'm talking out of my *** here, but you could imagine even the same deriving syntax to be send to the plugin. Note that in general in equations the second part of the pair would be handled as an obligation. Anyways, my point was that sadly, I think there is very little dev effort for derive itself, and I'd rather at some point add similar functionality to Equations and deprecate it than keep this simple but far from fully functional plugin, but of course someone could volunteer to improve it tho. |
Is it equivalent to |
The |
Thanks for the example @mattam82 , indeed The Program Definition example is interesting, and uses a custom mechanism vs the start_dependent proof API, however that API as witnessed by equations is still not powerful enough to operate without hacks [such as the ref to accumulate] |
Yes and no. We do use this pattern, but we do it with regular definitions usually, as Program Definition tends to infer too much.
( |
I think it's "derive" as in "program derivation", which comes more readily to mind than Haskell's "deriving" |
Yep, that's unfortunate, Program is supposed to not try to automatically solve goals that are not in Prop. |
Try |
Derive Plugin gives "Error: Anomaly "more than one statement."" on
Yes, or use |
I was wondering if something like |
It is most likely trivial to implement in MetaCoq using the obligations support (keeping a similar interface as the one of today). I doubt Ltac2 would work as you need to trigger vernacular commands like declaring new constants. |
A student I'm advising just ran into this issue. It would be nice if this just worked: Require Coq.derive.Derive.
Derive x SuchThat (x + x = 2) As x_ok. Admitted. Currently (Coq 8.16), it says |
Description of the problem
This is related to #6631 (cc @aspiwack):
Coq Version
8.13.0
The text was updated successfully, but these errors were encountered: