Sugar version 1.13 Core API Specification

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

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

public class RelationLiteral
extends Literal

This class implements a literal for relations.

See Also:
CSP

Field Summary
 int arity
           
 boolean conflicts
           
 IntegerVariable[] vs
           
 
Constructor Summary
RelationLiteral(int arity, boolean conflicts, int[][] tuples, IntegerVariable[] vs)
           
 
Method Summary
 void encode(Encoder encoder, int[] clause0)
           
 boolean isSatisfied()
          Returns true when the literal is satisfied.
 boolean isSimple()
          Returns true when the literal is simple.
 boolean isUnsatisfiable()
           
 boolean isValid()
           
 int propagate()
           
 String toString()
           
 
Methods inherited from class jp.ac.kobe_u.cs.sugar.csp.Literal
getBound, getCode, getVariables
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

arity

public int arity

conflicts

public boolean conflicts

vs

public IntegerVariable[] vs
Constructor Detail

RelationLiteral

public RelationLiteral(int arity,
                       boolean conflicts,
                       int[][] tuples,
                       IntegerVariable[] vs)
Method Detail

isSimple

public boolean isSimple()
Description copied from class: Literal
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.

Specified by:
isSimple in class Literal
Returns:
true when the literal is simple

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

encode

public void encode(Encoder encoder,
                   int[] clause0)
            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()
Overrides:
toString in class Object

Sugar version 1.13 Core API Specification

Sugar: A SAT-based Constraint Solver