I am very new to BuDDy (http://buddy.sourceforge.net/manual/main.html), and I'm in a context where I have to evaluate a boolean expression based on its corresponding BDD.
Let's assume the expression looks like this: (!a && b). I want to be able to set the truth values for a and b and evaluate the entire formula using the BDD.
Is this possible by any means in BuDDy?
You can use
bdd_retrict(formula, valuation)where formula is the BDD representing the expression you want to evaluate, andvaluationis a BDD representing a conjunction of variables such asa & !b(if you want to setato true, and!bto false). This will return a new formula with all variables invaluationreplaced by their value. So ifvaluationcovers all variables informula, the result will be eitherbddtrueorbddfalse.