map
fun <T : Comparable<T>, E : Comparable<E>> BinaryDecisionDiagram<T>.map(mapper: (T) -> E): BinaryDecisionDiagram<E>
Returns a BinaryDecisionDiagram containing nodes of applying the given transform function to each element in the original BinaryDecisionDiagram. The internal structure of the diagram is maintained. Used e.g. by it.unibo.tuprolog.solve.problog.lib.knowledge.impl.BinaryDecisionDiagramExplanation.apply to rewrite the Prolog terms held by every variable of an explanation (e.g. after applying a substitution), as diagram.map { transformation(it) }.
Return
a new diagram with the same shape, whose variable values are the result of applying mapper to the original ones.
Parameters
Throws
if the construction fails, e.g. because mapper throws.