Interface ReExpression
-
- All Superinterfaces:
ArExpression
- All Known Subinterfaces:
BoolVar
- All Known Implementing Classes:
BiLoExpression,BiReExpression,BoolNotView,BoolVarImpl,FixedBoolVarImpl,LoExpression,NaLoExpression,NaReExpression,UnLoExpression
public interface ReExpression extends ArExpression
relational expressionProject: choco-solver.
- Since:
- 28/04/2016.
- Author:
- Charles Prud'homme
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classReExpression.OperatorList of available operator for relational expression
-
Field Summary
-
Fields inherited from interface org.chocosolver.solver.expression.discrete.arithmetic.ArExpression
NO_CHILD
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default ReExpressionand(ReExpression... y)default booleanbeval(int[] values, Map<IntVar,Integer> map)BoolVarboolVar()default Constraintdecompose()default Constraintextension()voidextractVar(HashSet<IntVar> variables)Extract the variables from this expressionModelgetModel()Return the associated modeldefault intieval(int[] values, Map<IntVar,Integer> map)default ReExpressioniff(ReExpression... y)default ArExpressionift(int y1, int y2)default ArExpressionift(int y1, ArExpression y2)default ArExpressionift(ArExpression y1, int y2)default ArExpressionift(ArExpression y1, ArExpression y2)default ReExpressionimp(ReExpression y)default IntVarintVar()default ReExpressionnot()default ReExpressionor(ReExpression... y)default voidpost()Post the decomposition of this expression in the solverdefault ReExpressionxor(ReExpression... y)-
Methods inherited from interface org.chocosolver.solver.expression.discrete.arithmetic.ArExpression
abs, add, add, add, dist, dist, div, div, eq, eq, eq, ge, ge, getExpressionChild, getNoChild, gt, gt, isExpressionLeaf, le, le, lt, lt, max, max, max, min, min, min, mod, mod, mul, mul, mul, ne, ne, neg, pow, pow, sqr, sub, sub
-
-
-
-
Method Detail
-
getModel
Model getModel()
Return the associated model- Specified by:
getModelin interfaceArExpression- Returns:
- a Model object
-
boolVar
BoolVar boolVar()
- Returns:
- the relational expression as an
BoolVar. If necessary, it creates intermediary variable and posts intermediary constraints
-
intVar
default IntVar intVar()
- Specified by:
intVarin interfaceArExpression- Returns:
- the arithmetic expression as an
IntVar. If necessary, it creates intermediary variable and posts intermediary constraints
-
extractVar
void extractVar(HashSet<IntVar> variables)
Extract the variables from this expression- Specified by:
extractVarin interfaceArExpression- Parameters:
variables- set of variables
-
post
default void post()
Post the decomposition of this expression in the solver
-
decompose
default Constraint decompose()
- Returns:
- the topmost constraint representing the expression. If needed, a call to this method creates additional variables and posts additional constraints.
-
extension
default Constraint extension()
- Returns:
- a TABLE constraint that captures the expression
-
beval
default boolean beval(int[] values, Map<IntVar,Integer> map)- Parameters:
values- int values to evaluatemap- mapping between variables of the topmost expression and position in values- Returns:
- an evaluation of this relational expression based on a tuple
-
ieval
default int ieval(int[] values, Map<IntVar,Integer> map)- Specified by:
ievalin interfaceArExpression- Parameters:
values- int values to evaluatemap- mapping between variables of the topmost expression and position in values- Returns:
- an evaluation of this expression with a tuple
-
and
default ReExpression and(ReExpression... y)
- Parameters:
y- some relational expressions- Returns:
- return the expression "x ∧ y_1 ∧ y_2 ∧ ..." where this is "x"
-
or
default ReExpression or(ReExpression... y)
- Parameters:
y- some relational expressions- Returns:
- return the expression "x ∨ y_1 ∨ y_2 ∨ ..." where this is "x"
-
xor
default ReExpression xor(ReExpression... y)
- Parameters:
y- a relational expression- Returns:
- return the expression "x ⊕ y_1 ⊕ y_2 ⊕ ..." where this is "x"
-
imp
default ReExpression imp(ReExpression y)
- Parameters:
y- a relational expression- Returns:
- return the expression "x ⇒ y" where this is "x"
-
iff
default ReExpression iff(ReExpression... y)
- Parameters:
y- a relational expression- Returns:
- return the expression "x ⇔ y_1 ⇔ y_2 ⇔ ..." where this is "x"
-
not
default ReExpression not()
- Returns:
- return the expression "¬x" where this is "x"
-
ift
default ArExpression ift(ArExpression y1, ArExpression y2)
- Parameters:
y1- an arithmetic expressiony2- an arithmetic expression- Returns:
- return "if(b,y1,y2" where this is "b"
-
ift
default ArExpression ift(ArExpression y1, int y2)
- Parameters:
y1- an arithmetic expressiony2- an int- Returns:
- return a arithmetic expression that is equal to y1 if b is true, y2 otherwise.
-
ift
default ArExpression ift(int y1, ArExpression y2)
- Parameters:
y1- an inty2- an arithmetic expression- Returns:
- return a arithmetic expression that is equal to y1 if b is true, y2 otherwise.
-
ift
default ArExpression ift(int y1, int y2)
- Parameters:
y1- an inty2- an int- Returns:
- return a arithmetic expression that is equal to y1 if b is true, y2 otherwise.
-
-