-
Notifications
You must be signed in to change notification settings - Fork 84
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
Drastically speed up ByteCompareSpec #988
Drastically speed up ByteCompareSpec #988
Conversation
Old: ``` theories/ByteCompareSpec.vo (real: 113.67, user: 111.75, sys: 1.57, mem: 1287536 ko) ``` New: ``` COQC theories/ByteCompareSpec.v theories/ByteCompareSpec.vo (real: 9.46, user: 8.89, sys: 0.26, mem: 442460 ko) ``` The new file is also compatible with COQNATIVE, taking only seconds rather than dozens of minutes or more.
75214dc
to
00a4299
Compare
I think that this qualifies as a workaround to an algorithmic issue in Equations, though. Ideally the noconfusion generated there should be the one from your patch. |
I seen to recall @gares having written some elpi code to do this sort of thing (subquadratic Boolean equality reasoning) automatically, maybe the relevant code can be ported to Equations? Or maybe Equations can have a way of automatically proving that decidable equality implies NoConfusion? I can take a look at the relevant code if someone points me at it, but @mattam82 might know better how easy this approach is. |
Both the old and the new derive in Elpi prove no confusion by injecting to bool, IIRC, but they don't expose it as a lemma, they give you a view (a reflect), then do a discriminate over bool.
gives
But even if you run the legacy derive (which is quadratic):
you get
So in any case there is something fishy in equations. IMO you should just not use Equations for deriving stuff over large (i.e. more than 50 constructors) datatypes, see also the benchmark section in https://laas.hal.science/INRIA/hal-03800154 |
Old:
New:
The new file is also compatible with COQNATIVE, taking only seconds rather than dozens of minutes or more.