Class Literal

java.lang.Object
com.semedy.reasoner.api.logic.Compound
com.semedy.reasoner.api.logic.Literal
All Implemented Interfaces:
Serializable, Cloneable

public class Literal extends Compound
object to represent a literal
Author:
angele
See Also:
  • Constructor Details

    • Literal

      public Literal(String symbol, long symbolcode, boolean positive, Object[] arguments, int uniqueId, Literal original)
    • Literal

      public Literal(String symbol, long symbolcode, boolean positive, Object[] arguments, int uniqueId)
    • Literal

      public Literal(String symbol, boolean positive, Object[] arguments, Literal original)
    • Literal

      public Literal(String symbol, long symbolcode, boolean positive, Object[] arguments, Literal original)
    • Literal

      public Literal(String symbol, boolean positive, Object[] arguments)
    • Literal

      public Literal(String symbol, long symbolcode, boolean positive, Object[] arguments)
  • Method Details

    • getOriginal

      public Literal getOriginal()
      returns the original of the literal.
      null otherwise
      Returns:
    • getNormalized

      public Literal getNormalized()
      get a normalized version (all variables are renamed to Xi)
      Overrides:
      getNormalized in class Compound
      Returns:
    • getNormalizedRenumber

      public Literal getNormalizedRenumber()
      get a normalized version and renumber variables
      Returns:
    • clone

      public Literal clone()
      clone it
      Overrides:
      clone in class Compound
      Returns:
    • getStratum

      public int getStratum()
      return the rule stratum the literal is in
      Returns:
    • setStratum

      public void setStratum(int s)
      set the rule stratum
      Parameters:
      s -
    • setDebugInfo

      public void setDebugInfo(String s)
      set debug info to literal
      Parameters:
      s -
    • getDebugInfo

      public String getDebugInfo()
      get stored debug info
      Returns:
    • isPositive

      public boolean isPositive()
      is the literal positive?
      Returns:
    • getUniqueIdentifier

      public int getUniqueIdentifier()
      return a unique identifier of the literal
      Returns:
    • getPredicateSymbol

      public String getPredicateSymbol()
      return the predicate symbol of the literal
      Returns:
    • getQualifiedPredicateSymbol

      public String getQualifiedPredicateSymbol()
      return a qualified predicate symbol with name and arity like add|2
      Returns:
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Compound
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Compound
    • setNumberOfParts

      public void setNumberOfParts(int parts)
      Partial evaluation means that a part of the facts are used for evaluation only.
      Is used for facts partitioning based threaded evaluation
      Parameters:
      parts -
    • setPathNumbers

      public void setPathNumbers(int start, int end)
      set numbers for path
      Parameters:
      start -
      end -
    • getPathStart

      public int getPathStart()
      get start number for path
      Returns:
    • getPathEnd

      public int getPathEnd()
      get end number for path
      Returns:
    • getNumberOfParts

      public int getNumberOfParts()
      Partial evaluation means that a part of the facts are used for evaluation only
      Is used for facts partitioning based threaded evaluation
      Returns:
      parts
    • toString

      public String toString()
      Overrides:
      toString in class Compound
    • toString

      public String toString(SymbolTable symbols) throws IOException, SemReasonerException
      Throws:
      IOException
      SemReasonerException