public final class Clause
extends java.lang.Object
Clause
represents a clause, which is a set of literals.Modifier and Type | Class and Description |
---|---|
static class |
Clause.Builder
Clause.Builder implements a clause builder. |
Constructor and Description |
---|
Clause()
Constructs an empty clause.
|
Clause(Clause rhs)
Constructs a copy of the specified clause.
|
Clause(java.util.Map<java.lang.Integer,java.lang.Boolean> literals)
Constructs a clause with the given set of literals.
|
Modifier and Type | Method and Description |
---|---|
boolean |
contains(Clause clause)
Checks whether the clause contains the specified clause.
|
boolean |
contains(int var)
Checks whether the clause contains the specified variable.
|
java.util.Set<java.lang.Integer> |
getCommonVars(Clause rhs)
Returns the set of common variables of this clause and the specified one.
|
boolean |
getSign(int var)
Returns the sign of the specified variable.
|
java.util.Set<java.lang.Integer> |
getUniqueVars(Clause rhs)
Returns the set of variables of the clause that do not belong to the specified clause.
|
java.util.Set<java.lang.Integer> |
getVars()
Returns the set of variables of the clause.
|
boolean |
isEmpty()
Checks whether the clause is empty.
|
int |
size()
Returns the number of literals in the clause.
|
java.lang.String |
toString() |
java.lang.String |
toString(java.lang.String op) |
public Clause(java.util.Map<java.lang.Integer,java.lang.Boolean> literals)
literals
- the literals.public Clause()
public Clause(Clause rhs)
rhs
- the clause to be copied.public boolean isEmpty()
true
if the clause is empty; false
otherwise.public int size()
public java.util.Set<java.lang.Integer> getVars()
public java.util.Set<java.lang.Integer> getCommonVars(Clause rhs)
rhs
- the clause whose variables to be considered.public java.util.Set<java.lang.Integer> getUniqueVars(Clause rhs)
rhs
- the clause whose variables to be considered.public boolean getSign(int var)
var
- the variable.public boolean contains(int var)
var
- the variable to be checked.public boolean contains(Clause clause)
clause
- the clause to be checked.public java.lang.String toString(java.lang.String op)
public java.lang.String toString()
toString
in class java.lang.Object