Class ConstraintUtils
- java.lang.Object
-
- ru.ispras.fortress.solver.constraint.ConstraintUtils
-
public final class ConstraintUtils extends java.lang.Object
TheConstraintUtils
class provides utility methods to deal with constraints.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Constraint
newConstraint(java.util.Collection<? extends Node> formulae)
Creates a constraint from the specified collection of formula expressions.static Constraint
newConstraint(Node expr)
Creates a constraint from the specified expression.static SolverResult
solve(Constraint constraint)
Solves the specified constraint with the solver specified as default for the given constraint kind.
-
-
-
Method Detail
-
newConstraint
public static Constraint newConstraint(Node expr)
Creates a constraint from the specified expression.- Parameters:
expr
- Expression to be used as a source for the constraint.- Returns:
- New formula-based constraint.
- Throws:
java.lang.IllegalArgumentException
- if the argument isnull
.
-
newConstraint
public static Constraint newConstraint(java.util.Collection<? extends Node> formulae)
Creates a constraint from the specified collection of formula expressions.- Parameters:
formulae
- Collection of formula expressions.- Returns:
- New formula-based constraint.
- Throws:
java.lang.IllegalArgumentException
- if the argument isnull
.
-
solve
public static SolverResult solve(Constraint constraint)
Solves the specified constraint with the solver specified as default for the given constraint kind.- Parameters:
constraint
- Constraint to be solved.- Returns:
- Result of solving the constraint.
- Throws:
java.lang.IllegalArgumentException
- if the argument isnull
.
-
-