choco.global
Class Lex

java.lang.Object
  extended by choco.AbstractEntity
      extended by choco.AbstractConstraint
          extended by choco.integer.constraints.AbstractIntConstraint
              extended by choco.integer.constraints.AbstractLargeIntConstraint
                  extended by choco.global.Lex
All Implemented Interfaces:
Constraint, Entity, IntConstraint, IntVarEventListener, VarEventListener, Propagator, java.lang.Cloneable, java.util.EventListener

public class Lex
extends AbstractLargeIntConstraint

Enforce a lexicographic ordering on two vectors of integer variables x <_lex y with x = , and y = . ref : Global Constraints for Lexicographic Orderings (Frisch and al)


Field Summary
 IStateInt alpha
           
 IStateInt beta
           
 IStateBool entailed
           
 int n
           
 boolean strict
           
 IntDomainVar[] x
           
 IntDomainVar[] y
           
 
Fields inherited from class choco.integer.constraints.AbstractLargeIntConstraint
cIndices, cste, vars
 
Fields inherited from class choco.integer.constraints.AbstractIntConstraint
logger
 
Fields inherited from class choco.AbstractConstraint
active, constAwakeEvent, hook, priority
 
Fields inherited from class choco.AbstractEntity
problem
 
Constructor Summary
Lex(IntDomainVar[] vars, int n, boolean strict)
           
 
Method Summary
 void ACleq(int i)
           
 void ACless(int i)
           
 void awake()
          Default initial propagation: full constraint re-propagation.
 void awakeOnInf(int idx)
          Default propagation on improved lower bound: propagation on domain revision.
 void awakeOnInst(int idx)
          Default propagation on instantiation: full constraint re-propagation.
 void awakeOnRem(int idx, int x)
          Default propagation on one value removal: propagation on domain revision.
 void awakeOnSup(int idx)
          Default propagation on improved upper bound: propagation on domain revision.
 boolean checkLex(int i)
           
 void filter(int i)
           
 boolean greater(IntDomainVar x1, IntDomainVar y1)
           
 boolean groundEq(IntDomainVar x1, IntDomainVar y1)
           
 void initialize()
           
 java.lang.Boolean isEntailed()
          Checks whether the constraint is definitely satisfied, no matter what further restrictions occur to the domain of its variables.
 boolean isSatisfied()
          Semantic: Testing if the constraint is satisfied.
 boolean leq(IntDomainVar x1, IntDomainVar y1)
           
 boolean less(IntDomainVar x1, IntDomainVar y1)
           
 void propagate()
          Propagates the constraint awake events.
 void updateAlpha(int i)
           
 void updateBeta(int i)
           
 
Methods inherited from class choco.integer.constraints.AbstractLargeIntConstraint
assignIndices, clone, getConstraintIdx, getIntVar, getNbVars, getVar, isCompletelyInstantiated, setConstraintIndex, setVar
 
Methods inherited from class choco.integer.constraints.AbstractIntConstraint
awakeOnBounds, awakeOnRemovals, getSelfIndex, isConsistent
 
Methods inherited from class choco.AbstractConstraint
addListener, awakeOnVar, connectVar, constAwake, delete, fail, getEvent, getPlugIn, getPriority, getProblem, getVarIdxInOpposite, isActive, isEquivalentTo, opposite, setActive, setEntailed, setPassive, setPlugIn, substituteVar
 
Methods inherited from class choco.AbstractEntity
pretty
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface choco.Propagator
awakeOnVar, constAwake, delete, getEvent, getPlugIn, getPriority
 
Methods inherited from interface choco.prop.VarEventListener
addListener, isActive, setActive, setPassive
 
Methods inherited from interface choco.prop.VarEventListener
addListener, isActive, setActive, setPassive
 

Field Detail

n

public int n

alpha

public IStateInt alpha

beta

public IStateInt beta

entailed

public IStateBool entailed

x

public IntDomainVar[] x

y

public IntDomainVar[] y

strict

public boolean strict
Constructor Detail

Lex

public Lex(IntDomainVar[] vars,
           int n,
           boolean strict)
Method Detail

groundEq

public boolean groundEq(IntDomainVar x1,
                        IntDomainVar y1)

leq

public boolean leq(IntDomainVar x1,
                   IntDomainVar y1)

less

public boolean less(IntDomainVar x1,
                    IntDomainVar y1)

greater

public boolean greater(IntDomainVar x1,
                       IntDomainVar y1)

checkLex

public boolean checkLex(int i)

ACleq

public void ACleq(int i)
           throws ContradictionException
Throws:
ContradictionException

ACless

public void ACless(int i)
            throws ContradictionException
Throws:
ContradictionException

updateAlpha

public void updateAlpha(int i)
                 throws ContradictionException
Throws:
ContradictionException

updateBeta

public void updateBeta(int i)
                throws ContradictionException
Throws:
ContradictionException

initialize

public void initialize()
                throws ContradictionException
Throws:
ContradictionException

filter

public void filter(int i)
            throws ContradictionException
Throws:
ContradictionException

awakeOnInf

public void awakeOnInf(int idx)
                throws ContradictionException
Description copied from class: AbstractIntConstraint
Default propagation on improved lower bound: propagation on domain revision.

Specified by:
awakeOnInf in interface IntVarEventListener
Overrides:
awakeOnInf in class AbstractIntConstraint
Throws:
ContradictionException

awakeOnSup

public void awakeOnSup(int idx)
                throws ContradictionException
Description copied from class: AbstractIntConstraint
Default propagation on improved upper bound: propagation on domain revision.

Specified by:
awakeOnSup in interface IntVarEventListener
Overrides:
awakeOnSup in class AbstractIntConstraint
Throws:
ContradictionException

awakeOnRem

public void awakeOnRem(int idx,
                       int x)
                throws ContradictionException
Description copied from class: AbstractIntConstraint
Default propagation on one value removal: propagation on domain revision.

Specified by:
awakeOnRem in interface IntVarEventListener
Overrides:
awakeOnRem in class AbstractIntConstraint
Throws:
ContradictionException

awakeOnInst

public void awakeOnInst(int idx)
                 throws ContradictionException
Description copied from class: AbstractIntConstraint
Default propagation on instantiation: full constraint re-propagation.

Specified by:
awakeOnInst in interface IntVarEventListener
Overrides:
awakeOnInst in class AbstractIntConstraint
Throws:
ContradictionException

propagate

public void propagate()
               throws ContradictionException
Description copied from class: AbstractLargeIntConstraint
Propagates the constraint awake events.

Specified by:
propagate in interface Propagator
Overrides:
propagate in class AbstractLargeIntConstraint
Throws:
ContradictionException

awake

public void awake()
           throws ContradictionException
Description copied from class: AbstractConstraint
Default initial propagation: full constraint re-propagation.

Specified by:
awake in interface Propagator
Overrides:
awake in class AbstractConstraint
Throws:
ContradictionException

isSatisfied

public boolean isSatisfied()
Description copied from interface: Constraint
Semantic: Testing if the constraint is satisfied. Note that all variables involved in the constraint must be instantiated when this method is called.


isEntailed

public java.lang.Boolean isEntailed()
Description copied from interface: Propagator
Checks whether the constraint is definitely satisfied, no matter what further restrictions occur to the domain of its variables.

Specified by:
isEntailed in interface Propagator
Overrides:
isEntailed in class AbstractConstraint