Sugar version 1.13 Core API Specification

jp.ac.kobe_u.cs.sugar.csp
Class LinearLiteral

java.lang.Object
  extended by jp.ac.kobe_u.cs.sugar.csp.Literal
      extended by jp.ac.kobe_u.cs.sugar.csp.LinearLiteral

public class LinearLiteral
extends Literal

This class implements a comparison literal of CSP. The comparison represents the condition "linearSum <= 0".

See Also:
CSP, LinearSum

Constructor Summary
LinearLiteral(LinearSum linearSum)
          Constructs a new comparison literal of given linear expression.
 
Method Summary
 void encode(Encoder encoder, int[] clause)
           
 int[] getBound(IntegerVariable v)
           
 int getCode()
           
 LinearSum getLinearExpression()
          Returns the linear expression of the comparison literal.
 Set<IntegerVariable> getVariables()
           
 boolean isSatisfied()
          Returns true when the literal is satisfied.
 boolean isSimple()
          Returns true when the linear expression is simple.
 boolean isUnsatisfiable()
           
 boolean isValid()
           
 int propagate()
           
 String toString()
          Returns the string representation of the comparison literal.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LinearLiteral

public LinearLiteral(LinearSum linearSum)
Constructs a new comparison literal of given linear expression.

Parameters:
linearSum - the linear expression
Method Detail

getVariables

public Set<IntegerVariable> getVariables()
Overrides:
getVariables in class Literal

getBound

public int[] getBound(IntegerVariable v)
               throws SugarException
Overrides:
getBound in class Literal
Throws:
SugarException

isSimple

public boolean isSimple()
Returns true when the linear expression is simple.

Specified by:
isSimple in class Literal
Returns:
true when the linear expression is simple
See Also:
LinearSum.isSimple()

getLinearExpression

public LinearSum getLinearExpression()
Returns the linear expression of the comparison literal.

Returns:
the linear expression

isValid

public boolean isValid()
                throws SugarException
Specified by:
isValid in class Literal
Throws:
SugarException

isUnsatisfiable

public boolean isUnsatisfiable()
                        throws SugarException
Specified by:
isUnsatisfiable in class Literal
Throws:
SugarException

propagate

public int propagate()
              throws SugarException
Specified by:
propagate in class Literal
Throws:
SugarException

getCode

public int getCode()
            throws SugarException
Overrides:
getCode in class Literal
Throws:
SugarException

encode

public void encode(Encoder encoder,
                   int[] clause)
            throws SugarException,
                   IOException
Specified by:
encode in class Literal
Throws:
SugarException
IOException

isSatisfied

public boolean isSatisfied()
Description copied from class: Literal
Returns true when the literal is satisfied.

Specified by:
isSatisfied in class Literal
Returns:
true when the literal is satisfied

toString

public String toString()
Returns the string representation of the comparison literal.

Overrides:
toString in class Object
Returns:
the string representation

Sugar version 1.13 Core API Specification

Sugar: A SAT-based Constraint Solver