Closed dvcopae closed 5 months ago
If reordering to given variable levels, bdd.configure(reordering=False)
is needed, so that the variables are shifted to the given levels, without using automated reordering. The following works without errors:
bdd.configure(reordering=False)
_bdd.reorder(bdd, order=custom_order)
assert bdd.vars == custom_order, bdd.vars
bdd.configure(reordering=True)
Methods that may run automated reordering when it is active (with bdd.configure(reordering=True)
) are decorated with dd.bdd._try_to_reorder()
, which catches the exception _NeedsReordering
and then runs automated reordering. The function dd.bdd._sort_to_order()
called in this case does not have @_try_to_reorder
because levels there are swapped until the given variable levels are obtained.
Thanks so much for your quick response. I confirm that changing the reordering
parameter to False
works as expected.
Hello!
I'm encountering an issue when I'm trying to use the following variable ordering to reorder a bdd. I apologize that the exemple is not minimal but I can't pinpoint exactly what part causes the algorithm to break. Calling
_bdd.reorder(bdd)
instead of_bdd.reorder(bdd, order=custom_order)
works fine and doesn't cause any errors.The stack trace is as follows:
For reference, I'm using Python 3.12.3.
I can't figure it out if I'm doing something wrong, or this is a bug within the library.