Package jason.asSyntax
Class ArithFunctionTerm
java.lang.Object
jason.asSyntax.DefaultTerm
jason.asSyntax.Literal
jason.asSyntax.Atom
jason.asSyntax.Structure
jason.asSyntax.ArithFunctionTerm
- All Implemented Interfaces:
LogicalFormula
,NumberTerm
,Term
,ToDOM
,ToJson
,java.io.Serializable
,java.lang.Cloneable
,java.lang.Comparable<Term>
- Direct Known Subclasses:
ArithExpr
public class ArithFunctionTerm extends Structure implements NumberTerm
Represents an arithmetic function, like math.max(arg1,arg2) -- a functor (math.max) and two arguments.
A Structure is thus used to store the data.
- Author:
- Jomi
- See Also:
- Serialized Form
-
Nested Class Summary
Nested classes/interfaces inherited from class jason.asSyntax.Literal
Literal.FalseLiteral, Literal.TrueLiteral
-
Field Summary
Fields Modifier and Type Field Description private Agent
agent
private ArithFunction
function
private static java.util.logging.Logger
logger
private static long
serialVersionUID
protected NumberTerm
value
Fields inherited from class jason.asSyntax.Structure
emptyTermArray, emptyTermList
Fields inherited from class jason.asSyntax.Literal
DefaultNS, LFalse, LNeg, LPos, LTrue, predicateIndicatorCache
Fields inherited from class jason.asSyntax.DefaultTerm
hashCodeCache, srcInfo
-
Constructor Summary
Constructors Constructor Description ArithFunctionTerm(ArithFunction function)
ArithFunctionTerm(ArithFunctionTerm af)
ArithFunctionTerm(java.lang.String functor, int arity)
-
Method Summary
Modifier and Type Method Description Term
capply(Unifier u)
computes the value for this arithmetic function (as defined in the NumberTerm interface)boolean
checkArity(int a)
NumberTerm
clone()
make a deep copy of the termsLiteral
cloneNS(Atom newnamespace)
clone in another namespaceint
compareTo(Term o)
boolean
equals(java.lang.Object t)
Agent
getAgent()
org.w3c.dom.Element
getAsDOM(org.w3c.dom.Document document)
get as XMLjava.lang.String
getErrorMsg()
boolean
isArithExpr()
boolean
isAtom()
boolean
isLiteral()
boolean
isNumeric()
boolean
isStructure()
java.util.Iterator<Unifier>
logicalConsequence(Agent ag, Unifier un)
logicalConsequence checks whether one particular predicate is a logical consequence of the belief base.void
setAgent(Agent ag)
double
solve()
returns the numeric value of the termMethods inherited from class jason.asSyntax.Structure
addTerm, addTerms, addTerms, calcHashCode, countVars, delTerm, getArity, getSingletonVars, getTerm, getTerms, getTermsSize, hasTerm, hasVar, isGround, isUnary, makeTermsAnnon, makeVarsAnnon, makeVarsAnnon, parse, setTerm, setTerms, subsumes, toString, varToReplace
Methods inherited from class jason.asSyntax.Atom
getFunctor, getNS
Methods inherited from class jason.asSyntax.Literal
addAnnot, addAnnots, addAnnots, addSource, addSourceInfoAsAnnots, canBeAddedInBB, clearAnnots, copy, delAnnot, delAnnots, delAnnots, delSource, delSources, equalsAsStructure, forceFullLiteralImpl, getAnnot, getAnnots, getAnnots, getAsJson, getAsListOfTerms, getPredicateIndicator, getSources, getTermsArray, hasAnnot, hasAnnot, hasSource, hasSource, hasSubsetAnnot, hasSubsetAnnot, importAnnots, negated, newFromListOfTerms, newFunctor, noSource, parseLiteral, setAnnots, setNegated, subjectToBUF
Methods inherited from class jason.asSyntax.DefaultTerm
getCyclicVar, getSrcInfo, hashCode, isCyclicTerm, isInternalAction, isList, isMap, isPlanBody, isPred, isRule, isSet, isString, isUnnamedVar, isVar, resetHashCodeCache, setSrcInfo
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface jason.asSyntax.Term
countVars, getCyclicVar, getSrcInfo, hasVar, isCyclicTerm, isGround, isInternalAction, isList, isMap, isPlanBody, isPred, isRule, isSet, isString, isUnnamedVar, isVar, setSrcInfo, subsumes
Methods inherited from interface jason.util.ToJson
getAsJson, getAsJsonStr
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
- Constant Field Values
-
logger
private static java.util.logging.Logger logger -
value
-
function
-
agent
-
-
Constructor Details
-
ArithFunctionTerm
-
ArithFunctionTerm
-
ArithFunctionTerm
public ArithFunctionTerm(java.lang.String functor, int arity)
-
-
Method Details
-
isNumeric
public boolean isNumeric()- Specified by:
isNumeric
in interfaceTerm
- Overrides:
isNumeric
in classDefaultTerm
-
isAtom
public boolean isAtom() -
isStructure
public boolean isStructure()- Specified by:
isStructure
in interfaceTerm
- Overrides:
isStructure
in classStructure
-
isLiteral
public boolean isLiteral() -
isArithExpr
public boolean isArithExpr()- Specified by:
isArithExpr
in interfaceTerm
- Overrides:
isArithExpr
in classDefaultTerm
-
setAgent
-
getAgent
-
capply
computes the value for this arithmetic function (as defined in the NumberTerm interface) -
solve
Description copied from interface:NumberTerm
returns the numeric value of the term- Specified by:
solve
in interfaceNumberTerm
- Throws:
NoValueException
-
checkArity
public boolean checkArity(int a) -
logicalConsequence
Description copied from class:Literal
logicalConsequence checks whether one particular predicate is a logical consequence of the belief base. Returns an iterator for all unifiers that are logCons.- Specified by:
logicalConsequence
in interfaceLogicalFormula
- Overrides:
logicalConsequence
in classLiteral
-
equals
public boolean equals(java.lang.Object t) -
compareTo
-
getErrorMsg
public java.lang.String getErrorMsg()- Overrides:
getErrorMsg
in classDefaultTerm
-
clone
Description copied from class:Structure
make a deep copy of the terms -
cloneNS
Description copied from interface:Term
clone in another namespace -
getAsDOM
public org.w3c.dom.Element getAsDOM(org.w3c.dom.Document document)Description copied from class:Structure
get as XML
-