-
Notifications
You must be signed in to change notification settings - Fork 2
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
Port to Hierarchy Builder #71
Conversation
d03c12d
to
1a4efa1
Compare
So, here is a version that is compatible with both MathComp 1 and 2, that should avoid having to manage multiple versions and means, provided CI is green, we could merge this without waiting for MathComp 2. |
So, CI almost green. I removed mathcomp:1.15.0-coq-dev because 1.15 doesn't compile anymore on Coq master. But, with the coq-master branch of elpi, we have a
on that line algebra-tactics/examples/zmodule.v Lines 246 to 247 in d4de5a2
even if I replace the body of the ltac tactic above with idtac .This is not specific to that PR and also happens on master. @gares, does that ring a bell? |
no idea |
Here is a reduced example: From elpi Require Export elpi.
From mathcomp Require Import ssreflect ssrfun ssrbool eqtype.
Ltac ltac_foo := idtac.
Elpi Tactic fail_foo.
Elpi Accumulate lp:{{
pred solve i:goal, o:list sealed-goal.
solve (goal _ _ _ _ [_] as G) GS :-
coq.ltac.call "ltac_foo" [] G GS.
}}.
Elpi Typecheck.
Goal True.
Proof.
elpi fail_foo ([the Equality.type of unit : Type]).
Qed. According to the backtrace:
pointing to https://github.com/LPCIC/coq-elpi/blob/c245284c3bc5ffa6fba6935253b4110c8b9360c6/src/coq_elpi_HOAS.ml#L1183 it could be a missing evar, but no idea why. |
I see, I guess it is the same here: https://coq.zulipchat.com/#narrow/stream/253928-Elpi-users-.26-devs/topic/Error.20.60Not.20a.20variable.20after.20goal.60 |
I guess first I'll move coq-master to point to a recent coq-elpi, and then I'll re run the job |
@pi8027 thanks! This might take me a few days, being pretty busy currently. |
cf6369f
to
7323a12
Compare
7323a12
to
fc1ebd5
Compare
I'm recompiling it, there is a zmodType in lra.elpi which needs to be replaced with the new name |
fc1ebd5
to
723b06c
Compare
@gares Sorry for the mess. Fixed. |
I did the fix myself here and uploaded a new jscoq yesterday night, lesson8 works |
@pi8027 thanks for the rebase! Looks to me like this works with the HB branch of MathComp and is backward compatible (the issue with coq-dev seems unrelated) so this can probably be merged whenever you want. |
@proux01 For the above reason, I cannot merge this PR for the moment. Since the issue is independent of Algebra Tactics, I will produce a smaller example explaining the issue. |
@pi8027 should this be merged now? |
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.
Sorry for the late response. I'm still hesitating to merge this PR for the following reasons. But, I can propose a "compromise plan".
723b06c
to
132fd79
Compare
Also, I don't think we want to merge the workaround specific to jsCoq in the master branch. In theory, it has to be fixed in somewhere else. |
algebra-tactics/theories/common.elpi Lines 425 to 433 in 90979f3
(x + y)^-1 , we should not reify x and y because we do not have the multiplicative inverse in the reified syntax for the lra tactic. This rule should apply only when Inv = ff , as it is the case in the master branch:algebra-tactics/theories/lra.elpi Lines 195 to 199 in eeea906
Again, I'm working on it. |
I agree, and that's exactly what the code does thanks to the |
I don't understand why you needed |
To be able to share the reification procedure between all tactics (that's why it is in
I haven't really considered the case of expressions containing
|
I thought you implemented what I suggested, but that was not true. So never mind. I pushed my fix. |
|
No, sorry, I didn't catch all the details of what you wanted to do. Thanks for the code! I had a careful look and it looks good to me. I still feel there is a massive amount of duplication in all this code though. But fixing that would probably require some major refactoring and definitely doesn't belong to the current PR.
Thanks for the explanation. |
Regarding the "duplication" between the reification procedures for |
I'm not sure I understand what you mean by "automatically generating the reification procedure"? I wonder whether we shouldn't completely change the parsing model with more intermediate languages, a reification procedure that would perform less work and could be shared, then a first simplification pass to a simpler intermediate language, finally the normalization procedures specific to each tactic (that would have to modify the variable map VM). But that's not a very precise idea and I agree about the "long-term goal" part. |
The functionality I need would be similar to the |
Apparently, |
Since MC 2.0.0 supports 8.16, it would probably be nice to keep supporting it. Considering the number of clauses, the performance impact of using |
If you are not accumulating thousands of clauses, the new API provides no gain. In HB we accumulate like 60k clauses, grouping them changes the perf. If you are accumulating 100, you don't need the new API. |
Ok.
Also, the accumulation happens only when compiling Algebra Tactics. So I would say it is irrelevant to the performance from the user's perspective. |
To be precise, it's also about the |
1c20aef
to
1bb41b4
Compare
Shall we merge? Feel free to squash a bit but I'm not going to do that by myself. |
Co-authored-by: Kazuhiko Sakaguchi <[email protected]>
35141c0
to
611f106
Compare
Sure 🎉
done |
@pi8027 do you plan to do a release? (I can handle the OPAM and Nix packages) |
@proux01 I'm waiting for the green light here: coq-community/apery#16. Meanwhile, I drafted the release (I think you have access). |
C.f. math-comp/math-comp#733