public final class Clause
extends java.lang.Object
Constructor and Description |
---|
Clause()
Constructs the empty clause.
|
Clause(Clause rhs)
Constructs a copy of the specified clause.
|
Modifier and Type | Method and Description |
---|---|
void |
add(Clause clause)
Appends the specified clause to the clause.
|
void |
add(int[] vars,
boolean sign)
Appends the specified literals to the clause.
|
void |
add(int[] vars,
boolean[] signs)
Appends the specified literals to the clause.
|
void |
add(int var,
boolean sign)
Appends the specified literal to the clause.
|
void |
clear()
Removes all literals of the clause.
|
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.
|
void |
remove(Clause clause)
Removes the literals for the variables of the specified clause.
|
void |
remove(int var)
Removes the literal for the specified variable.
|
void |
remove(int[] vars)
Removes the literals for the specified variables.
|
int |
size()
Returns the number of literals in the clause.
|
public Clause()
public Clause(Clause rhs)
rhs
- the clause to be copied.public boolean isEmpty()
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 void add(int var, boolean sign)
var
- the variable.sign
- the negation.public void add(int[] vars, boolean sign)
vars
- the variables.sign
- the negation (common for all variables).public void add(int[] vars, boolean[] signs)
vars
- the variables.signs
- the negations.public void add(Clause clause)
clause
- the clause to be added.public void remove(int var)
var
- the variable to be removed.public void remove(int[] vars)
vars
- the variables to be removed.public void remove(Clause clause)
clause
- the clause whose variables to be removed.public void clear()