public class Arithmetic extends DLPElementAdapter implements DLPElement
| Modifier and Type | Field and Description |
|---|---|
private Term<?> |
left
the term X on the left of an arithmetic expression: Z=X+Y or the first
argument of an build-in function #func(X,Y,Z)
|
private java.lang.String |
operator
the operator or the id of the build-in function
|
private Term<?> |
result
the term Z giving the result of the arithmetic expression: Z=X+Y or the third
argument of an build-in function #func(X,Y,Z)
|
private Term<?> |
right
the term Y on the right of the arithmetic expression: Z=X+Y or the second
argument of an build-in function #func(X,Y,Z)
|
| Constructor and Description |
|---|
Arithmetic(Arithmetic other)
Copy-Ctor
|
Arithmetic(java.lang.String op,
Term<?> left,
Term<?> right,
Term<?> result) |
| Modifier and Type | Method and Description |
|---|---|
Arithmetic |
clone()
Creates a deep copy of this formula
|
boolean |
equals(java.lang.Object other) |
java.util.Set<DLPAtom> |
getAtoms()
Processes the set of all atoms which appear in this formula
|
Term<?> |
getLeftArgument() |
java.util.SortedSet<DLPLiteral> |
getLiterals() |
java.lang.String |
getOperator() |
java.util.Set<DLPPredicate> |
getPredicates()
Processes the set of all predicates which appear in this
formula
|
Term<?> |
getResult() |
Term<?> |
getRightArgument() |
FolSignature |
getSignature()
Returns the signature of the language of this formula.
|
java.util.Set<Term<?>> |
getTerms() |
int |
hashCode() |
boolean |
isGround()
Checks whether this formula is ground, i.e.
|
Arithmetic |
substitute(Term<?> t,
Term<?> v)
Substitutes all occurrences of term "v" in this formula
by term "t" and returns the new formula.
|
java.lang.String |
toString() |
getPredicateClscontainsTermsOfType, exchange, getTerms, isLiteral, isWellFormed, substitutefinalize, getClass, notify, notifyAll, wait, wait, waitexchange, isWellFormed, substitutegetPredicateCls, isLiteralcontainsTermsOfType, getTermsprivate java.lang.String operator
private Term<?> left
private Term<?> right
private Term<?> result
public Arithmetic(Arithmetic other)
other - public Term<?> getResult()
public Term<?> getLeftArgument()
public Term<?> getRightArgument()
public java.lang.String getOperator()
public java.lang.String toString()
toString in class java.lang.Objectpublic java.util.SortedSet<DLPLiteral> getLiterals()
getLiterals in interface DLPElementpublic java.util.Set<Term<?>> getTerms()
getTerms in interface LogicStructurepublic boolean isGround()
ComplexLogicalFormulaisGround in interface ComplexLogicalFormulaisGround in class ComplexLogicalFormulaAdapterpublic Arithmetic clone()
SimpleLogicalFormulaclone in interface ComplexLogicalFormulaclone in interface SimpleLogicalFormulaclone in interface DLPElementclone in class DLPElementAdapterpublic java.util.Set<DLPPredicate> getPredicates()
SimpleLogicalFormulagetPredicates in interface SimpleLogicalFormulagetPredicates in interface DLPElementpublic java.util.Set<DLPAtom> getAtoms()
SimpleLogicalFormulagetAtoms in interface SimpleLogicalFormulagetAtoms in interface DLPElementpublic Arithmetic substitute(Term<?> t, Term<?> v)
ComplexLogicalFormulasubstitute in interface ComplexLogicalFormulasubstitute in interface DLPElementt - the term to be substituted.v - the term to substitute.public FolSignature getSignature()
FormulagetSignature in interface FormulagetSignature in interface DLPElementpublic int hashCode()
hashCode in interface SimpleLogicalFormulahashCode in class java.lang.Objectpublic boolean equals(java.lang.Object other)
equals in interface SimpleLogicalFormulaequals in class java.lang.Object