Package net.sf.tweety.lp.asp.syntax
Class ArithmeticTerm
- java.lang.Object
-
- net.sf.tweety.logics.commons.syntax.TermAdapter<Triple<ASPOperator.ArithmeticOperator,Term<?>,Term<?>>>
-
- net.sf.tweety.lp.asp.syntax.ArithmeticTerm
-
- All Implemented Interfaces:
LogicStructure
,Term<Triple<ASPOperator.ArithmeticOperator,Term<?>,Term<?>>>
public class ArithmeticTerm extends TermAdapter<Triple<ASPOperator.ArithmeticOperator,Term<?>,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 Summary
Constructors Constructor Description ArithmeticTerm(Triple<ASPOperator.ArithmeticOperator,Term<?>,Term<?>> triple)
ArithmeticTerm(ArithmeticTerm other)
ArithmeticTerm(ASPOperator.ArithmeticOperator op, Term<?> t)
Creates an arithmetic term of the form -(t)ArithmeticTerm(ASPOperator.ArithmeticOperator op, Term<?> left, Term<?> right)
-
Method Summary
Modifier and Type Method Description TermAdapter<?>
clone()
Creates a deep copy of the termTerm<?>
getLeft()
Returns the left subterm of this arithmetic term.ASPOperator.ArithmeticOperator
getOperator()
Returns the operator of this arithmetic term.Term<?>
getRight()
Returns the right subterm of this arithmetic term.void
setOperator(ASPOperator.ArithmeticOperator op)
Sets the operator of this arithmetic term.java.lang.String
toString()
-
Methods inherited from class net.sf.tweety.logics.commons.syntax.TermAdapter
containsTermsOfType, equals, get, getSort, getTerms, getTerms, hashCode, set, substitute
-
-
-
-
Constructor Detail
-
ArithmeticTerm
public ArithmeticTerm(Triple<ASPOperator.ArithmeticOperator,Term<?>,Term<?>> triple)
-
ArithmeticTerm
public ArithmeticTerm(ArithmeticTerm other)
-
ArithmeticTerm
public ArithmeticTerm(ASPOperator.ArithmeticOperator op, Term<?> left, Term<?> right)
-
ArithmeticTerm
public ArithmeticTerm(ASPOperator.ArithmeticOperator op, Term<?> t)
Creates an arithmetic term of the form -(t)- Parameters:
op
- an operatort
- a term
-
-
Method Detail
-
toString
public java.lang.String toString()
- Overrides:
toString
in classTermAdapter<Triple<ASPOperator.ArithmeticOperator,Term<?>,Term<?>>>
-
clone
public TermAdapter<?> clone()
Description copied from interface:Term
Creates a deep copy of the term- Specified by:
clone
in interfaceTerm<Triple<ASPOperator.ArithmeticOperator,Term<?>,Term<?>>>
- Specified by:
clone
in classTermAdapter<Triple<ASPOperator.ArithmeticOperator,Term<?>,Term<?>>>
- Returns:
- the clone
-
getOperator
public ASPOperator.ArithmeticOperator getOperator()
Returns the operator of this arithmetic term.- Returns:
- an arithmetic operator
-
setOperator
public void setOperator(ASPOperator.ArithmeticOperator op)
Sets the operator of this arithmetic term.- Parameters:
op
- an arithmetic operator
-
getLeft
public Term<?> getLeft()
Returns the left subterm of this arithmetic term.- Returns:
- left term
-
getRight
public Term<?> getRight()
Returns the right subterm of this arithmetic term.- Returns:
- right term
-
-