Sugar version 1.13 Core API Specification

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

java.lang.Object
  extended by jp.ac.kobe_u.cs.sugar.csp.Literal
Direct Known Subclasses:
BooleanLiteral, LinearLiteral, PowerLiteral, ProductLiteral, RelationLiteral

public abstract class Literal
extends Object

This is an abstract class for literals of CSP.

See Also:
CSP

Constructor Summary
Literal()
           
 
Method Summary
abstract  void encode(Encoder encoder, int[] clause)
           
 int[] getBound(IntegerVariable v)
           
 int getCode()
           
 Set<IntegerVariable> getVariables()
           
abstract  boolean isSatisfied()
          Returns true when the literal is satisfied.
abstract  boolean isSimple()
          Returns true when the literal is simple.
abstract  boolean isUnsatisfiable()
           
abstract  boolean isValid()
           
abstract  int propagate()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Literal

public Literal()
Method Detail

getVariables

public Set<IntegerVariable> getVariables()

getBound

public int[] getBound(IntegerVariable v)
               throws SugarException
Throws:
SugarException

isSimple

public abstract boolean isSimple()
Returns true when the literal is simple. A literal is simple when it is a boolean literal or a comparison literal with at most one integer variable.

Returns:
true when the literal is simple

isValid

public abstract boolean isValid()
                         throws SugarException
Throws:
SugarException

isUnsatisfiable

public abstract boolean isUnsatisfiable()
                                 throws SugarException
Throws:
SugarException

propagate

public abstract int propagate()
                       throws SugarException
Throws:
SugarException

getCode

public int getCode()
            throws SugarException
Throws:
SugarException

encode

public abstract void encode(Encoder encoder,
                            int[] clause)
                     throws SugarException,
                            IOException
Throws:
SugarException
IOException

isSatisfied

public abstract boolean isSatisfied()
Returns true when the literal is satisfied.

Returns:
true when the literal is satisfied

Sugar version 1.13 Core API Specification

Sugar: A SAT-based Constraint Solver