Interface ReExpression
-
- All Superinterfaces:
ArExpression
- All Known Subinterfaces:
BoolVar
- All Known Implementing Classes:
BiLoExpression
,BiReExpression
,BoolNotView
,BoolVarImpl
,EqView
,FixedBoolVarImpl
,IntBoolView
,LeqView
,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 class
ReExpression.Operator
List 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 ReExpression
and(ReExpression... y)
default boolean
beval(int[] values, Map<IntVar,Integer> map)
BoolVar
boolVar()
default Constraint
decompose()
default Constraint
extension()
void
extractVar(HashSet<IntVar> variables)
Extract the variables from this expressionModel
getModel()
Return the associated modeldefault int
ieval(int[] values, Map<IntVar,Integer> map)
default ReExpression
iff(ReExpression... y)
default ArExpression
ift(int y1, int y2)
default ArExpression
ift(int y1, ArExpression y2)
default ArExpression
ift(ArExpression y1, int y2)
default ArExpression
ift(ArExpression y1, ArExpression y2)
default ReExpression
imp(ReExpression y)
default IntVar
intVar()
default ReExpression
not()
default ReExpression
or(ReExpression... y)
default void
post()
Post the decomposition of this expression in the solverdefault ReExpression
xor(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:
getModel
in 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:
intVar
in 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:
extractVar
in 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:
ieval
in 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.
-
-