Class DefaultNegativeConstraint

All Implemented Interfaces:
NegativeConstraint, Rule, Comparable<Rule>

public class DefaultNegativeConstraint extends DefaultRule implements NegativeConstraint
A negative constraint prevents to have some set of atoms. Its logical representation is: "¬animal(X) ∧ ¬plant(X)".
The NegativeConstraint Class represent negative constraint by a rule that produce the Bottom atom if the specified atom set is met.
Author:
Clément Sipieter (INRIA) <clement@6pi.fr>
  • Constructor Details

    • DefaultNegativeConstraint

      public DefaultNegativeConstraint()
      Creates an empty unlabeled negative constraint.
    • DefaultNegativeConstraint

      public DefaultNegativeConstraint(CloseableIterator<Atom> atomSet) throws IteratorException
      Creates an unlabeled negative constraint from an atom iterator.
      Parameters:
      atomSet - the iterator over forbidden atoms
      Throws:
      IteratorException - if the iterator cannot be consumed
    • DefaultNegativeConstraint

      public DefaultNegativeConstraint(CloseableIteratorWithoutException<Atom> atomSet)
      Creates an unlabeled negative constraint from an atom iterator.
      Parameters:
      atomSet - the iterator over forbidden atoms
    • DefaultNegativeConstraint

      public DefaultNegativeConstraint(InMemoryAtomSet atomSet)
      Creates an unlabeled negative constraint from an atom set.
      Parameters:
      atomSet - the forbidden atom set
    • DefaultNegativeConstraint

      public DefaultNegativeConstraint(String label, CloseableIterator<Atom> atomSet) throws IteratorException
      Creates a labeled negative constraint from an atom iterator.
      Parameters:
      label - the constraint label
      atomSet - the iterator over forbidden atoms
      Throws:
      IteratorException - if the iterator cannot be consumed
    • DefaultNegativeConstraint

      public DefaultNegativeConstraint(String label, CloseableIteratorWithoutException<Atom> atomSet)
      Creates a labeled negative constraint from an atom iterator.
      Parameters:
      label - the constraint label
      atomSet - the iterator over forbidden atoms
    • DefaultNegativeConstraint

      public DefaultNegativeConstraint(String label, InMemoryAtomSet atomSet)
      Creates a labeled negative constraint from an atom set.
      Parameters:
      label - the constraint label
      atomSet - the forbidden atom set
  • Method Details

    • appendTo

      void appendTo(StringBuilder sb)
      Appends this object representation to the provided builder.
      Parameters:
      sb - the target builder