applyThenExpansion
Applies the "Apply" construction algorithm over BinaryDecisionDiagrams using a given unary boolean operator, and computes a value using the Shannon Expansion over the result. The result is an instance of Pair of which Pair.first is the Reduced Ordered Binary Decision Diagram (ROBDD) produced by the operation, and Pair.second is the value of type E computed with the Shannon Expansion.
By definition, invoking apply and then expansion should produce the same result as calling this function directly, but in one bottom-up pass instead of two. This is what the *ThenExpansion family of operators (e.g. andThenExpansion, notThenExpansion) is built on, and is used e.g. by it.unibo.tuprolog.solve.problog.lib.knowledge.impl.BinaryDecisionDiagramExplanation to combine probabilistic explanations while incrementally caching their probability.
Return
a Pair of the resulting ROBDD and the Shannon-Expansion result.
Parameters
the unary boolean operator applied to Terminal values.
the E value associated to a false Terminal.
the E value associated to a true Terminal.
combines a BinaryDecisionDiagram.Variable's value with the already computed E values of its low and high sub-diagrams.
Throws
if construction fails, e.g. because unaryOp or expansionOperator throws.
Applies the "Apply" construction algorithm over two BinaryDecisionDiagrams using a given binary boolean operator, and computes a value using the Shannon Expansion over the result. The result is an instance of Pair of which Pair.first is the Reduced Ordered Binary Decision Diagram (ROBDD) produced by the operation, and Pair.second is the value of type E computed with the Shannon Expansion.
By definition, invoking apply and then expansion should produce the same result as calling this function directly, but in one bottom-up pass instead of two. See andThenExpansion/orThenExpansion for concrete instantiations, and it.unibo.tuprolog.solve.problog.lib.knowledge.impl.BinaryDecisionDiagramExplanation for their usage to combine probabilistic explanations.
Return
a Pair of the resulting ROBDD and the Shannon-Expansion result.
Parameters
the other diagram to combine this one with.
the binary boolean operator combining Terminal values from this diagram and that.
the E value associated to a false Terminal.
the E value associated to a true Terminal.
combines a BinaryDecisionDiagram.Variable's value with the already computed E values of its low and high sub-diagrams.
Throws
if construction fails, e.g. because binaryOp or expansionOperator throws.