Closed johnyf closed 7 years ago
Implemented as of df83480d08bc71bdde174f426fed40a24549e0f7. Changes:
full
care_bits=None
result in care_bits=support(u)
(reasonable default)set()
result in minimal partial assignmentscare_bits
as a lower bound, not as an upper boundcare_bits < support(u)
(intermediate cases, why the extremes only?)
dd
enumeration APIIn
dd.bdd.BDD.sat_iter
anddd.cudd.BDD.sat_iter
the meaning is:not full
, then return assignments as they result from traversing the BDD. Depending on the variable order, this can yield varying resultsfull
, then:care_bits is None
, then return assignments to all the variables of the BDD manager (usually this isn't what we want)assert care_bits \subseteq support
So,
full
says whether full assignments are desired.care_bits
matters only iffull
is given, and is explicit, in that it specifies exactly over which variables to enumerate.However, there is little point in providing fewer
care_bits
than support, because that is guaranteed to raise anAssertionError
about missing variables.In particular,
care_bits = set()
is useless, because why would you enumerate a non-constant BDD over no variables?Another point is whether
care_bits
should be used as an upper or lower bound. Upper bound means "at most these bits". Lower bound means "at least these bits".Perhaps a more reasonable alternative would be to enumerate over the union
support \cup care_bits
, and so avoid both checking whethersupport \subseteq care_bits
, as well as the need to raise any exceptions. (We could consider allowing even variables that are not in the symbol table, though that would work only in BDDs, not for variables that take integer values.)The exception case leaves that case free for a new meaning to be chosen. It may be worth considering letting
full=False, care_bits={...}
mean thatcare_bits
should be assigned always, and any missing vars insupport
assigned only along BDD paths that they appear on.Another problem is that
support \subseteq care_bits
is checked whenevercare_vars is not None
. Even whenfull = False
. Consider changing this behavior indd
.