cryptominisat icon indicating copy to clipboard operation
cryptominisat copied to clipboard

Python xor clauses with inverted literals disallowed

Open jasonfiammetta opened this issue 11 months ago • 2 comments

Is this intentional? I can't find an analogue for that limitation in the C++ code, and this regex seems to suggest it's expected. Even this old blog post uses a negative.

That parser code is quite old, perhaps the ability to use false vars was an issue that was resolved later?

jasonfiammetta avatar Jan 20 '25 02:01 jasonfiammetta

Hi,

It kind of is. You can edit the code, though, if you like, to count the negations, and change the RHS. Or you can just do it outside of the python module, and only add variables with RHS set to the value required. I'd accept a PR that fixes this of course! But I think it's not a big limitation, you just need to count the negations, and flip the RHS accordingly:

    static char const* kwlist[] = {"xor_clause", "rhs", NULL};

Let me know if you are up for writing a PR,

Mate

msoos avatar Jan 20 '25 19:01 msoos

Sure, I'll get started on a PR for that, thanks for the quick response!

jasonfiammetta avatar Jan 21 '25 18:01 jasonfiammetta

Closing, waiting for the PR :)

msoos avatar Jun 18 '25 18:06 msoos