Class LiteralImpl

All Implemented Interfaces:
LogicalFormula, Term, ToDOM, ToJson, Serializable, Cloneable, Comparable<Term>
Direct Known Subclasses:
CyclicTerm, Rule, VarTerm

public class LiteralImpl extends Pred
A Literal extends a Pred with strong negation (~).
See Also:
  • Constructor Details

    • LiteralImpl

      public LiteralImpl(String functor)
      creates a positive literal
    • LiteralImpl

      public LiteralImpl(boolean pos, String functor)
      if pos == true, the literal is positive, otherwise it is negative
    • LiteralImpl

      public LiteralImpl(Literal l)
    • LiteralImpl

      protected LiteralImpl(Literal l, Unifier u)
    • LiteralImpl

      public LiteralImpl(boolean pos, Literal l)
      if pos == true, the literal is positive, otherwise it is negative
    • LiteralImpl

      public LiteralImpl(Atom namespace, boolean pos, String functor)
      if pos == true, the literal is positive, otherwise it is negative
    • LiteralImpl

      public LiteralImpl(Atom namespace, boolean pos, Literal l)
      creates a literal based on another but in another name space and signal
  • Method Details

    • isAtom

      public boolean isAtom()
      Specified by:
      isAtom in interface Term
      Overrides:
      isAtom in class Pred
    • canBeAddedInBB

      public boolean canBeAddedInBB()
      to be overridden by subclasses (as internal action)
      Overrides:
      canBeAddedInBB in class Literal
    • negated

      public boolean negated()
      Description copied from class: Literal
      returns whether this literal is negated or not, use Literal.LNeg and Literal.LPos to compare the returned value
      Overrides:
      negated in class Literal
    • setNegated

      public Literal setNegated(boolean b)
      Description copied from class: Literal
      changes the negation of the literal and return this
      Overrides:
      setNegated in class Literal
    • equals

      public boolean equals(Object o)
      Specified by:
      equals in interface Term
      Overrides:
      equals in class Pred
    • getErrorMsg

      public String getErrorMsg()
      Overrides:
      getErrorMsg in class DefaultTerm
    • clone

      public Term clone()
      Description copied from class: Structure
      make a deep copy of the terms
      Specified by:
      clone in interface Term
      Overrides:
      clone in class Pred
    • capply

      public Term capply(Unifier u)
      Description copied from interface: Term
      clone and applies together (and faster than clone and then apply)
      Specified by:
      capply in interface Term
      Overrides:
      capply in class Pred
    • cloneNS

      public Literal cloneNS(Atom newNameSpace)
      Description copied from interface: Term
      clone in another namespace
      Specified by:
      cloneNS in interface Term
      Overrides:
      cloneNS in class Pred
    • calcHashCode

      protected int calcHashCode()
      Overrides:
      calcHashCode in class Structure
    • getPredicateIndicator

      public PredicateIndicator getPredicateIndicator()
      returns [~] super.getPredicateIndicator
      Overrides:
      getPredicateIndicator in class Literal
    • getAsDOM

      public Element getAsDOM(Document document)
      get as XML
      Specified by:
      getAsDOM in interface ToDOM
      Overrides:
      getAsDOM in class Pred