Class FunctionalTerm

java.lang.Object
org.tweetyproject.math.term.Term
org.tweetyproject.math.term.FunctionalTerm
Direct Known Subclasses:
AbsoluteValue, Exp, Logarithm, Power, Root

public abstract class FunctionalTerm extends Term
Instances of this class represent a functional term on some inner term.
Author:
Matthias Thimm
  • Constructor Details

    • FunctionalTerm

      public FunctionalTerm(Term term)
      Creates a new functional term with the given inner term.
      Parameters:
      term - a term
  • Method Details

    • getTerm

      public Term getTerm()
      Returns the inner term.
      Returns:
      the inner term.
    • collapseAssociativeOperations

      public void collapseAssociativeOperations()
      Description copied from class: Term
      This method collapses all associative operations appearing in this term, e.g. every min{min{a,b},c} becomes min{a,b,c}.
      Specified by:
      collapseAssociativeOperations in class Term
    • expandAssociativeOperations

      public void expandAssociativeOperations()
      Description copied from class: Term
      This method expands all associative operations appearing in this term, e.g. every min{a,b,c} becomes min{min{a,b},c}.
      Specified by:
      expandAssociativeOperations in class Term
    • getMinimums

      public Set<Minimum> getMinimums()
      Description copied from class: Term
      Returns all minimums of this term.
      Specified by:
      getMinimums in class Term
      Returns:
      all minimums of this term.
    • getMaximums

      public Set<Maximum> getMaximums()
      Description copied from class: Term
      Returns all maximums of this term.
      Specified by:
      getMaximums in class Term
      Returns:
      all maximums of this term.
    • getProducts

      public Set<Product> getProducts()
      Description copied from class: Term
      Returns all products of this term.
      Specified by:
      getProducts in class Term
      Returns:
      all products of this term.
    • getSums

      public Set<Sum> getSums()
      Description copied from class: Term
      Returns all sums of this term.
      Specified by:
      getSums in class Term
      Returns:
      all sums of this term.
    • getVariables

      public Set<Variable> getVariables()
      Description copied from class: Term
      Returns all variables in this term.
      Specified by:
      getVariables in class Term
      Returns:
      all variables in this term.
    • getAbsoluteValues

      public Set<AbsoluteValue> getAbsoluteValues()
      Description copied from class: Term
      Returns all absolute values of this term.
      Specified by:
      getAbsoluteValues in class Term
      Returns:
      all absolute values of this term.
    • isInteger

      public boolean isInteger()
      Description copied from class: Term
      Checks whether this term represents an integer value.
      Specified by:
      isInteger in class Term
      Returns:
      "true" iff this term represents an integer value.
    • toLinearForm

      public Sum toLinearForm() throws IllegalArgumentException
      Description copied from class: Term
      Converts this term into a linear normal form, i.e. into a sum of products of a constant and a variable.
      Specified by:
      toLinearForm in class Term
      Returns:
      a term in linear normal form.
      Throws:
      IllegalArgumentException - if this term cannot be converted into a linear normal form.
    • toQuadraticForm

      public Sum toQuadraticForm() throws IllegalArgumentException
      Specified by:
      toQuadraticForm in class Term
      Throws:
      IllegalArgumentException
    • replaceTerm

      public abstract Term replaceTerm(Term toSubstitute, Term substitution)
      Description copied from class: Term
      Replaces each occurrence of "toSubstitute" by "substitution" and return the new term.
      Specified by:
      replaceTerm in class Term
      Parameters:
      toSubstitute - the term to be substituted
      substitution - the new term
      Returns:
      this term where "toSubstitute" is replaced by "substitution"
    • toString

      public abstract String toString()
      Specified by:
      toString in class Term
    • isLinear

      public boolean isLinear()
      Description copied from class: Term
      Checks whether this term is linear.
      Overrides:
      isLinear in class Term
      Returns:
      "true" if this term is linear.
    • value

      public abstract Constant value() throws IllegalArgumentException
      Description copied from class: Term
      Computes the actual value of this term if it contains no variables.
      Specified by:
      value in class Term
      Returns:
      the value of this term, either a float or an integer.
      Throws:
      IllegalArgumentException - if this term contains at least on variable.