public final class NormalForm
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
NormalForm.Type
This enumeration contains the type of the normal form.
|
Constructor and Description |
---|
NormalForm(NormalForm.Type type)
Constructs the empty normal form of the specified type.
|
NormalForm(NormalForm.Type type,
java.util.Collection<Clause> clauses)
Constructs the normal form of the specified type consisting of the specified clauses.
|
Modifier and Type | Method and Description |
---|---|
void |
add(Clause clause)
Appends the specified clause to the normal form.
|
void |
add(NormalForm form)
Appends the clauses of the normal form specified as a parameter to this normal form.
|
void |
clear()
Removes all clauses of the normal form.
|
java.util.List<Clause> |
getClauses()
Returns the clauses of the normal form.
|
NormalForm.Type |
getType()
Returns the type of the normal form (
DNF or CNF ). |
boolean |
isEmpty()
Checks whether the normal form is empty.
|
int |
size()
Returns the number of clauses in the normal form.
|
java.lang.String |
toString()
Returns the string representation of the normal form.
|
public NormalForm(NormalForm.Type type)
type
- the type of the form.public NormalForm(NormalForm.Type type, java.util.Collection<Clause> clauses)
type
- the type of the form.clauses
- the clauses of the form.public NormalForm.Type getType()
DNF
or CNF
).public boolean isEmpty()
public int size()
public java.util.List<Clause> getClauses()
public void add(Clause clause)
clause
- the clause to be added.public void add(NormalForm form)
form
- the form whose clauses to be added.public void clear()
public java.lang.String toString()
toString
in class java.lang.Object