public class Clause
extends java.lang.Object
CSP
Constructor and Description |
---|
Clause()
Constructs a new clause.
|
Clause(java.util.List<Literal> literals)
Constructs a new clause with give literals.
|
Clause(Literal literal) |
Modifier and Type | Method and Description |
---|---|
void |
add(Literal literal)
Adds the given literal to the clause.
|
void |
addAll(java.util.List<Literal> literals)
Adds all given literals to the clause.
|
java.lang.String |
getComment()
Returns the comment set to the clause.
|
java.util.Set<IntegerVariable> |
getCommonVariables() |
java.util.List<Literal> |
getLiterals()
Returns the literals of the clause.
|
boolean |
isModified() |
boolean |
isSatisfied()
Returns true when the clause is satisfied.
|
boolean |
isSimple()
Returns true when the clause is simple.
|
boolean |
isUnsatisfiable() |
boolean |
isValid() |
int |
propagate() |
int |
removeFalsefood() |
void |
setComment(java.lang.String comment)
Sets the comment to the clause.
|
int |
simpleSize() |
int |
size() |
java.lang.String |
toString()
Returns the string representation of the clause.
|
public Clause(java.util.List<Literal> literals)
literals
- the literals of the clausepublic Clause()
public Clause(Literal literal)
public java.util.List<Literal> getLiterals()
public void addAll(java.util.List<Literal> literals)
literals
- the literals to be addedpublic void add(Literal literal)
literal
- the literal to be added.public int size()
public java.lang.String getComment()
public void setComment(java.lang.String comment)
comment
- the comment to setpublic boolean isModified()
public java.util.Set<IntegerVariable> getCommonVariables()
public int simpleSize()
public boolean isSimple()
Literal.isSimple()
public boolean isValid() throws SugarException
SugarException
public boolean isUnsatisfiable() throws SugarException
SugarException
public int propagate() throws SugarException
SugarException
public int removeFalsefood() throws SugarException
SugarException
public boolean isSatisfied()
public java.lang.String toString()
toString
in class java.lang.Object