On pon, 2017-06-12 at 11:08 +0200, Alexis Ballier wrote: > On Sun, 11 Jun 2017 18:05:18 +0200 > Alexis Ballier <[email protected]> wrote: > > > I think this handles all the cases. I'll try to update the repo with > > that algo. > > I've updated my fork. It'd be good to merge it and rebase solve() on > top of the output of to_impl.convert_to_implications if you're happy > with it. > > $ time python3 classify.py requsel > Stats: > Parse error: 0 > Good: 8334 > Need topo sort: 152 > Cyclic: 43 > > real 0m1.874s > user 0m1.869s > sys 0m0.005s > > > > It works better, no more parse error, and only 43 problematic cases.
Thanks for doing it. It's certainly an interesting case study. I've merged it and pushed the result. However, I personally think it's only going to work against your case. You can clearly see now how complex the code has become. Even in the pseudo-ocaml you presented it already is complex. Now imagine having to retype it in cleartext suitable for the PMS. I've actually started typing the initial specification yesterday [1]. As you can see, banning the extra constraints has made the algorithms much simpler. In particular: 1. You do not have to define 'falsify' for anything other than pure flags -- which makes it easy to inline it. 2. ||, ??, ^^ groups are only flat lists of flags -- which makes reordering and processing them trivial. 3. The algorithm is recursive only on USE-conditional groups. This makes it trivial to make it iterative. Optimizations become trivially possible. Nevertheless, feel free to play with the full implementation. If you're interested, you can play with the complex cases more. In particular, I'm wondering whether nsolve will actually consider most of them solvable. As for the results, I think it is the point where we start preparing pull requests with REQUIRED_USE changes to see whether the developers agree with such changes. [1]:https://wiki.gentoo.org/wiki/User:MGorny/GLEP:ReqUse -- Best regards, Michał Górny
signature.asc
Description: This is a digitally signed message part
