[numeral] [plugins] Remove Coq's Bigint module in favor of ZArith.#11742
[numeral] [plugins] Remove Coq's Bigint module in favor of ZArith.#11742coqbot-app[bot] merged 5 commits intorocq-prover:masterfrom
Bigint module in favor of ZArith.#11742Conversation
|
Two problems:
Bench : https://ci.inria.fr/coq/job/benchmark-part-of-the-branch/875/ |
|
@maximedenes can we install libgmp-dev on pendulum? [I'm afraid my network situation is bad as I'm on the road] |
4a72f50 to
dd6ee16
Compare
Done. |
|
I have a fear releated to this PR: since the porting of micromega failed, how do we know that this is correct? Aren't we just porting less well-tested parts ( Also, what is the motivation for this change if |
I'm not sure I understand what you mean about correctness; what is the particular concern you have in mind? I don't think porting of micromega "failed", it just needs more work as there is not a 1-1 mapping of the APIs in a few places.
What does
These are totally orthogonal components so I don't see any reason porting more stuff should increase the confidence on the current code. |
|
@ejgallego my worry is not about the correctness of ZArith/GMP, of course, it is precisely about the correctness of the API mapping.
I imagined you were replacing the uses of Big_int by ZArith because that's literally what the PR title says, but I must have misunderstood. Under that assumption, my point was that uses of |
This is replacing
Well that's hard to know, tho the API mapping performed this PR seems safe enough to me; I don't think the paths this PR modifies are not so well tested tho, they include omega and numeral notations, these are certainly used in quite a few places in the CI. |
Thanks, let's see the new bench here https://ci.inria.fr/coq/job/benchmark-part-of-the-branch/877 |
|
By the way micromega mostly works, I just don't have the time to fix it now, but it should not be hard. The problem is almost for sure in the particular spot where exponentation of rationals was used, but indeed there the old num API was allowing clients to do what seems like very weird things; so indeed we will have to improve code likely. Note also that micromega uses |
|
What's the status of this PR? |
|
Sorry, I didn't merge in time because of summer vacations. @ejgallego would you mind rebasing? |
We replace Coq's use of `Big_int` and `num` by the ZArith OCaml library which is a more modern version. We switch the core files and easy plugins only for now, more complex numerical plugins will be done in their own commit. We thus keep the num library linked for now until all plugins are ported. Co-authored-by: Vincent Laporte <Vincent.Laporte@fondation-inria.fr>
We could still optimize the functions in that file a bit more if there is need.
Suggested by Pierre Roux
Done. |
|
@coqbot merge now |
|
@maximedenes: Please take care of the following overlays:
|
|
Is it possible that this broke opam-based Coq builds? #12937 When dependencies change, would be good if the opam package was either fixed at the same time, or the opam maintainers were notified ahead of time. |
| - The [num](https://github.com/ocaml/num) library; note that it is | ||
| included in the OCaml distribution for OCaml versions < 4.06.0 | ||
|
|
||
| - The [ZArith library](https://github.com/ocaml/Zarith) >= 1.8 |
There was a problem hiding this comment.
The version given here is inconsistent with what it says in the opam file (1.9.1).
For windows, this branch might be interesting since the libtommath builds fine under windows. |
Not sure what the issue is on Windows. The Coq platform does build gmp on Windows. The opam package works fine. |
If one wants to use the msvc, one does not get to far with the gmp, mpir (the gmp fork with different license and build script for visual studio) gave up on releasing new versions. Of course gmp should normally work if you use mingw or cygwin. Edit: Also if one wants to vendor zarith packing libtommath additionally would avoid one system dependency. |
|
@bschommer vendoring |
We replace Coq's use of
Bigint,Big_intandnumby the ZArith OCamllibrary which is a more modern version.
We switch the core files and easy plugins only for now, the remaining
micromegaplugins will be done in their own commit.We thus keep the num library linked for now until micromega is ported.
Co-authored-by: Vincent Laporte Vincent.Laporte@fondation-inria.fr
Kind: feature / infrastructure.
Overlays: