public static final class IntegerFormula.Builder<V>
extends java.lang.Object
IntegerFormula.Builder
is a IntegerFormula
builder.Constructor and Description |
---|
IntegerFormula.Builder()
Constructs a formula builder.
|
IntegerFormula.Builder(IntegerFormula.Builder<V> rhs)
Constructs a copy of the formula builder.
|
Modifier and Type | Method and Description |
---|---|
void |
addClause(IntegerClause<V> clause)
Adds the equation clause to the formula.
|
void |
addClauses(java.util.Collection<IntegerClause<V>> clauses)
Adds the clauses to the formula.
|
void |
addConstraint(IntegerConstraint<V> constraint)
Adds the constraint to the formula.
|
void |
addEquation(IntegerEquation<V> equation)
Adds the equation to the formula.
|
void |
addEquation(V var,
java.math.BigInteger val,
boolean equal)
Adds the equality
var == val or inequality var != val to the formula. |
void |
addEquation(V lhs,
V rhs,
boolean equal)
Adds the equality
lhs == rhs or inequality lhs != rhs to the formula. |
void |
addFormula(IntegerFormula<V> formula)
Adds the sub-formula to the formula.
|
IntegerFormula<V> |
build()
Builds a formula.
|
int |
size()
Returns the number of clauses in the formula.
|
public IntegerFormula.Builder()
public IntegerFormula.Builder(IntegerFormula.Builder<V> rhs)
rhs
- the formula builder to be copied.public int size()
public void addConstraint(IntegerConstraint<V> constraint)
constraint
- the constraint to be added.java.lang.IllegalArgumentException
- if constraint
is null.public void addFormula(IntegerFormula<V> formula)
formula
- the sub-formula to be added.java.lang.IllegalArgumentException
- if formula
is null.public void addClauses(java.util.Collection<IntegerClause<V>> clauses)
clauses
- the clauses to be added.java.lang.IllegalArgumentException
- if clauses
is null.public void addClause(IntegerClause<V> clause)
clause
- the equation clause to be added.java.lang.IllegalArgumentException
- if clause
is null.public void addEquation(IntegerEquation<V> equation)
equation
- the equation to be added.java.lang.IllegalArgumentException
- if equation
is null.public void addEquation(V lhs, V rhs, boolean equal)
lhs == rhs
or inequality lhs != rhs
to the formula.lhs
- the left-hand-side variable.rhs
- the right-hand-side variable.equal
- the equality/inequality flag.java.lang.IllegalArgumentException
- if lhs
or rhs
is null.public void addEquation(V var, java.math.BigInteger val, boolean equal)
var == val
or inequality var != val
to the formula.var
- the left-hand-side variable.val
- the right-hand-side value.equal
- the equality/inequality flag.java.lang.IllegalArgumentException
- if var
or val
is null.public IntegerFormula<V> build()