Class ArithmeticTerm

  • All Implemented Interfaces:
    net.sf.tweety.logics.commons.syntax.interfaces.LogicStructure, net.sf.tweety.logics.commons.syntax.interfaces.Term<net.sf.tweety.commons.util.Triple<ASPOperator.ArithmeticOperator,​net.sf.tweety.logics.commons.syntax.interfaces.Term<?>,​net.sf.tweety.logics.commons.syntax.interfaces.Term<?>>>

    public class ArithmeticTerm
    extends net.sf.tweety.logics.commons.syntax.TermAdapter<net.sf.tweety.commons.util.Triple<ASPOperator.ArithmeticOperator,​net.sf.tweety.logics.commons.syntax.interfaces.Term<?>,​net.sf.tweety.logics.commons.syntax.interfaces.Term<?>>>
    This class represents an arithmetic term in the ASP-Core-2 format. An arithmetic term is either -(t) or (t x u), where t and u are Terms and x is one of +,-,*,/
    Author:
    Anna Gessler
    • Constructor Detail

      • ArithmeticTerm

        public ArithmeticTerm​(net.sf.tweety.commons.util.Triple<ASPOperator.ArithmeticOperator,​net.sf.tweety.logics.commons.syntax.interfaces.Term<?>,​net.sf.tweety.logics.commons.syntax.interfaces.Term<?>> triple)
      • ArithmeticTerm

        public ArithmeticTerm​(ASPOperator.ArithmeticOperator op,
                              net.sf.tweety.logics.commons.syntax.interfaces.Term<?> left,
                              net.sf.tweety.logics.commons.syntax.interfaces.Term<?> right)
      • ArithmeticTerm

        public ArithmeticTerm​(ASPOperator.ArithmeticOperator op,
                              net.sf.tweety.logics.commons.syntax.interfaces.Term<?> t)
        Creates an arithmetic term of the form -(t)
        Parameters:
        op - an operator
        t - a term
    • Method Detail

      • toString

        public String toString()
        Overrides:
        toString in class net.sf.tweety.logics.commons.syntax.TermAdapter<net.sf.tweety.commons.util.Triple<ASPOperator.ArithmeticOperator,​net.sf.tweety.logics.commons.syntax.interfaces.Term<?>,​net.sf.tweety.logics.commons.syntax.interfaces.Term<?>>>
      • clone

        public net.sf.tweety.logics.commons.syntax.TermAdapter<?> clone()
        Specified by:
        clone in interface net.sf.tweety.logics.commons.syntax.interfaces.Term<net.sf.tweety.commons.util.Triple<ASPOperator.ArithmeticOperator,​net.sf.tweety.logics.commons.syntax.interfaces.Term<?>,​net.sf.tweety.logics.commons.syntax.interfaces.Term<?>>>
        Specified by:
        clone in class net.sf.tweety.logics.commons.syntax.TermAdapter<net.sf.tweety.commons.util.Triple<ASPOperator.ArithmeticOperator,​net.sf.tweety.logics.commons.syntax.interfaces.Term<?>,​net.sf.tweety.logics.commons.syntax.interfaces.Term<?>>>
      • setOperator

        public void setOperator​(ASPOperator.ArithmeticOperator op)
        Sets the operator of this arithmetic term.
        Parameters:
        op - an arithmetic operator
      • getLeft

        public net.sf.tweety.logics.commons.syntax.interfaces.Term<?> getLeft()
        Returns the left subterm of this arithmetic term.
        Returns:
        left term
      • getRight

        public net.sf.tweety.logics.commons.syntax.interfaces.Term<?> getRight()
        Returns the right subterm of this arithmetic term.
        Returns:
        right term