Type Parameters:
T - the type of values
All Superinterfaces:
LogicStructure
All Known Implementing Classes:
ArithmeticTerm, Constant, FunctionalTerm, Individual, NumberTerm, StringTerm, TermAdapter, Variable

public interface Term<T> extends LogicStructure
A term of a logical language, that can be given as argument for logical constructs like atoms or functors. A term can have a Sort which gives it a types, the default Sort which is also used by untyped languages is "Thing".
Author:
Matthias Thimm, Tim Janus
  • Method Summary

    Modifier and Type
    Method
    Description
    Term<?>
    Creates a deep copy of the term
    get()
     
     
    void
    set(T value)
    Changes the java-object representation of the term to the given value.
    Term<?>
    substitute(Term<?> v, Term<?> t)
    Substitutes all occurrences of term "v" in this term by term "t" and returns the new term.

    Methods inherited from interface org.tweetyproject.logics.commons.syntax.interfaces.LogicStructure

    containsTermsOfType, getTerms, getTerms
  • Method Details

    • set

      void set(T value)
      Changes the java-object representation of the term to the given value.
      Parameters:
      value - The new java-object representation of the term.
    • get

      T get()
      Returns:
      the java-object representation of the term.
    • substitute

      Term<?> substitute(Term<?> v, Term<?> t) throws IllegalArgumentException
      Substitutes all occurrences of term "v" in this term by term "t" and returns the new term.
      Parameters:
      v - the term to be substituted.
      t - the term to substitute.
      Returns:
      a term where every occurrence of "v" is replaced by "t".
      Throws:
      IllegalArgumentException - if "v" and "t" are of different sorts (NOTE: this exception is only thrown when "v" actually appears in this formula)
    • getSort

      Sort getSort()
      Returns:
      the sort (type) of this term.
    • clone

      Term<?> clone()
      Creates a deep copy of the term
      Returns:
      the clone