public final class NodeUtils
extends java.lang.Object
Node
objects.Node
Modifier and Type | Method and Description |
---|---|
static ru.ispras.fortress.expression.Node |
getConjunction(java.util.Collection<ru.ispras.fortress.expression.Node> nodes)
Returns a conjunction of non-empty collection of nodes.
|
static ru.ispras.fortress.expression.Node |
getConjunction(ru.ispras.fortress.expression.Node... nodes)
Returns a conjunction of the specified nodes.
|
static ru.ispras.fortress.expression.Node |
getDisjunction(java.util.Collection<ru.ispras.fortress.expression.Node> nodes)
Returns a disjunction of non-empty collection of nodes.
|
static ru.ispras.fortress.expression.Node |
getEquation(ru.ispras.fortress.expression.Node... nodes)
Returns an equation {@code (nodes[0] == ...
|
static java.util.Collection<java.lang.String> |
getVariableNames(java.util.Collection<? extends ru.ispras.fortress.expression.Node> nodes)
Returns a collection of names for variables from the specified collection.
|
static boolean |
hasBitVector(ru.ispras.fortress.expression.Node... nodes)
Checks whether any of the specified nodes is of bit vector type.
|
static boolean |
isOperation(ru.ispras.fortress.expression.Node node,
java.util.Collection<ru.ispras.fortress.expression.StandardOperation> group)
Checks rather the specified node is a
NodeOperation object with identifier
from the specified list. |
static ru.ispras.fortress.expression.NodeValue |
newBitVector(int value,
int size)
Creates bit vector of the specified size object from the specified value.
|
static org.apache.commons.lang3.tuple.Pair<ru.ispras.fortress.expression.Node,ru.ispras.fortress.expression.Node> |
splitByVar(ru.ispras.fortress.expression.Node node,
java.util.Collection<ru.ispras.fortress.expression.NodeVariable> variables)
Splits the specified node into two parts - one that depends exactly from the specified
variables and another that does not depend.
|
static ru.ispras.fortress.expression.Node |
substituteAllBindings(ru.ispras.fortress.expression.Node node,
java.util.List<ru.ispras.fortress.expression.NodeBinding.BoundVariable> boundVariables)
Substitutes variables that are used in the node by the specified bound variables.
|
public static ru.ispras.fortress.expression.Node getEquation(ru.ispras.fortress.expression.Node... nodes)
(nodes[0] == ... == nodes[n - 1])
expression
of the specified nodes.nodes
- Expressions to be combined.java.lang.IllegalArgumentException
- when argument is either null
or empty.public static ru.ispras.fortress.expression.Node getConjunction(ru.ispras.fortress.expression.Node... nodes)
nodes
- Nodes for conjunction.java.lang.IllegalArgumentException
- when argument is null
.public static ru.ispras.fortress.expression.Node getConjunction(java.util.Collection<ru.ispras.fortress.expression.Node> nodes)
Repeated nodes will not appear in the result.
nodes
- Nodes for conjunction.java.lang.IllegalArgumentException
- when argument is null
.java.lang.IllegalArgumentException
- when argument is empty.public static ru.ispras.fortress.expression.Node getDisjunction(java.util.Collection<ru.ispras.fortress.expression.Node> nodes)
nodes
- Nodes for disjunction.java.lang.IllegalArgumentException
- when argument is null
.java.lang.IllegalArgumentException
- when argument is empty.public static java.util.Collection<java.lang.String> getVariableNames(java.util.Collection<? extends ru.ispras.fortress.expression.Node> nodes)
nodes
- Collection of nodes.java.lang.IllegalArgumentException
- when argument is null
.public static org.apache.commons.lang3.tuple.Pair<ru.ispras.fortress.expression.Node,ru.ispras.fortress.expression.Node> splitByVar(ru.ispras.fortress.expression.Node node, java.util.Collection<ru.ispras.fortress.expression.NodeVariable> variables)
node
- Node to be split.variables
- Variables dependence to which is a splitting criterion.public static boolean isOperation(ru.ispras.fortress.expression.Node node, java.util.Collection<ru.ispras.fortress.expression.StandardOperation> group)
NodeOperation
object with identifier
from the specified list.node
- Node to be checked.group
- Group of identifiers.true
if node is a NodeOperation
object which identifier
is in the specified list, false
otherwise.public static boolean hasBitVector(ru.ispras.fortress.expression.Node... nodes)
nodes
- The nodes to be checked.true
when some of the specified nodes is of bit vector type,
false
otherwise.public static ru.ispras.fortress.expression.NodeValue newBitVector(int value, int size)
value
- The bit vector value.size
- The bit vector size.public static ru.ispras.fortress.expression.Node substituteAllBindings(ru.ispras.fortress.expression.Node node, java.util.List<ru.ispras.fortress.expression.NodeBinding.BoundVariable> boundVariables)
node
- The node to be performed.boundVariables
- The substitutions.