Constructor and Description |
---|
BooleanLiteral(BooleanVariable v,
boolean negative)
Constructs a new boolean literal of the given boolean variable and negative flag.
|
Modifier and Type | Method and Description |
---|---|
BooleanVariable |
getBooleanVariable()
Returns the boolean variable of CSP.
|
int |
getCode() |
boolean |
getNegative()
Returns the negative flag of the boolean literal.
|
boolean |
isSatisfied()
Returns true when the literal is satisfied.
|
boolean |
isSimple()
Always returns true since boolean literals are simple.
|
boolean |
isUnsatisfiable() |
boolean |
isValid() |
Literal |
neg() |
int |
propagate() |
java.lang.String |
toString()
Returns the string representation of the boolean literal.
|
getBound, getVariables
public BooleanLiteral(BooleanVariable v, boolean negative)
v
- the boolean variable of CSPnegative
- the negative flagpublic boolean isSimple()
public BooleanVariable getBooleanVariable()
public boolean getNegative()
public boolean isValid() throws SugarException
isValid
in class Literal
SugarException
public boolean isUnsatisfiable() throws SugarException
isUnsatisfiable
in class Literal
SugarException
public boolean isSatisfied()
Literal
isSatisfied
in class Literal
public Literal neg() throws SugarException
neg
in class Literal
SugarException
public java.lang.String toString()
toString
in class java.lang.Object