Class NodeReversal
java.lang.Object
software.amazon.smithy.rulesengine.logic.bdd.NodeReversal
- All Implemented Interfaces:
Function<EndpointBddTrait,
EndpointBddTrait>
public final class NodeReversal
extends Object
implements Function<EndpointBddTrait,EndpointBddTrait>
Reverses the node ordering in a BDD from bottom-up to top-down for better cache locality.
This transformation reverses the node array (except the terminal at index 0) and updates all references throughout the BDD to maintain correctness.
-
Constructor Details
-
NodeReversal
public NodeReversal()
-
-
Method Details
-
apply
- Specified by:
apply
in interfaceFunction<EndpointBddTrait,
EndpointBddTrait>
-
reverse
Reverses the node ordering in a BDD.- Parameters:
bdd
- the BDD to reverse- Returns:
- the reversed BDD, or the original if too small to reverse
-