Closed brossignol closed 5 months ago
Thanks for reporting. It is certainly meant to be supported. And it worked the last time I checked. I will investigate why this is happening now.
I made a pull request https://github.com/pysathq/pysat/pull/166 with a fix. I propose to make oset an "ordered set" by using a dict with None values.
In all simplified
methods the list operands
is incremented during the loop on subformulas
.
But in XOr.simplified
the loop also requires to remove elements from the list (not very efficient in python).
The previous solution was to use oset
(a set, easy to add/remove) and use sorted
to restore an order. But Atom
cannot really be ordered (they don't always have name, etc).
Thank you. The proposal to use a dictionary makes sense. Can you fix the indentation issue in the PR though (when you create the dictionary)? I will merge it afterwards.
There was a typo in the previous pull request, I made a new one that should pass the test.
Thanks!
Thank you, @brossignol. I've merged it now.
This minimal example
returns an error:
Even if XOr is not supported by simplified, it should not crash.