Class NormalForm


  • public final class NormalForm
    extends java.lang.Object
    This class represents a normal form, which is a set of clauses. The representation can be interpreted as either DNF or CNF.
    • Constructor Summary

      Constructors 
      Constructor 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.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • NormalForm

        public NormalForm​(NormalForm.Type type,
                          java.util.Collection<Clause> clauses)
        Constructs the normal form of the specified type consisting of the specified clauses.
        Parameters:
        type - the type of the form.
        clauses - the clauses of the form.
      • NormalForm

        public NormalForm​(NormalForm.Type type)
        Constructs the empty normal form of the specified type.
        Parameters:
        type - the type of the form.
    • Method Detail

      • getType

        public NormalForm.Type getType()
        Returns the type of the normal form (DNF or CNF).
        Returns:
        the type of the form.
      • isEmpty

        public boolean isEmpty()
        Checks whether the normal form is empty.
        Returns:
        true if the normal form is empty; false otherwise.
      • size

        public int size()
        Returns the number of clauses in the normal form.
        Returns:
        the size of the form.
      • getClauses

        public java.util.List<Clause> getClauses()
        Returns the clauses of the normal form.
        Returns:
        the clauses of the form.
      • toString

        public java.lang.String toString()
        Returns the string representation of the normal form.
        Overrides:
        toString in class java.lang.Object
        Returns:
        the string representing the form.