Package jason.asSyntax
Class VarTerm
- All Implemented Interfaces:
ListTerm,LogicalFormula,NumberTerm,Term,ToDOM,ToJson,Serializable,Cloneable,Comparable<Term>,Iterable<Term>,Collection<Term>,List<Term>,SequencedCollection<Term>
- Direct Known Subclasses:
UnnamedVar
Represents a variable Term: like X (starts with upper case). It may have a
value, after
VarTerm.apply.
An object of this class can be used in place of a
Literal, Number, List, String, .... It behaves like a
Literal, Number, .... just in case its value is a Literal,
Number, ...- See Also:
-
Field Summary
Fields inherited from class jason.asSyntax.Structure
emptyTermArray, emptyTermListFields inherited from class jason.asSyntax.Literal
DefaultNS, LFalse, LNeg, LPos, LTrue, predicateIndicatorCacheFields inherited from class jason.asSyntax.DefaultTerm
hashCodeCache, srcInfoFields inherited from interface jason.asSyntax.ListTerm
EMPTY_LIST -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbooleanbooleanaddAll(int index, Collection c) booleanaddAll(Collection c) voidadds some terms and return thisprotected intbooleanto be overridden by subclasses (as internal action)clone and applies together (and faster than clone and then apply)voidclear()clone()make a deep copy of the termscloneLT()clone the list termmake a shallow copy of the list (terms are not cloned, only the structure)clone in another namespaceintbooleanbooleanvoiddifference(ListTerm lt) booleanget(int index) intgetArity()returns the number of terms of this literalget as XMLgetLast()getNext()getTail()getTerm()getTerm(int i) returns the i-th term (first term is 0)getTerms()returns all terms of this literalbooleanintintersection(ListTerm lt) booleanbooleanisAtom()booleanbooleanisEmpty()booleanisEnd()booleanisGround()booleanbooleanisList()booleanbooleanbooleanbooleanisPred()booleanisRule()booleanisString()booleanbooleanisTail()booleanbooleanisVar()iterator()intlistIterator(int index) logicalConsequence(Agent ag, Unifier un) logicalConsequence checks whether one particular predicate is a logical consequence of the belief base.static VarTermDeprecated.prefer ASSyntax.parseVar(...)remove(int index) booleanbooleanbooleanreverse()voidvoidvoidvoidset all terms of the literal and return thisintsize()doublesolve()returns the numeric value of the termsubList(int arg0, int arg1) subSets(int k) returns all subsets that take k elements of this listbooleanObject[]toArray()Object[]Methods inherited from class jason.asSyntax.LiteralImpl
getErrorMsg, getPredicateIndicator, negated, setNegatedMethods inherited from class jason.asSyntax.Pred
addAnnot, addAnnots, addAnnots, addSource, capplyAnnots, clearAnnots, createSource, delAnnot, delAnnots, delSource, delSources, equalsAsStructure, getAnnot, getAnnots, getAnnots, getSources, hasAnnot, hasAnnot, hasSource, hasSource, hasSubsetAnnot, hasSubsetAnnot, importAnnots, makeVarsAnnon, parsePred, setAnnots, toStringAsTermMethods inherited from class jason.asSyntax.Structure
addTerms, delTerm, getSingletonVars, getTermsSize, hasTerm, isUnary, makeTermsAnnon, makeVarsAnnon, parse, toString, varToReplaceMethods inherited from class jason.asSyntax.Atom
getFunctor, getNSMethods inherited from class jason.asSyntax.Literal
addSourceInfoAsAnnots, copy, delAnnots, forceFullLiteralImpl, getAsJson, getAsListOfTerms, getTermsArray, newFromListOfTerms, newFunctor, noSource, parseLiteral, subjectToBUFMethods inherited from class jason.asSyntax.DefaultTerm
getCyclicVar, getSrcInfo, hashCode, isMap, isSet, resetHashCodeCache, setSrcInfoMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface java.util.List
addFirst, addLast, getFirst, hashCode, removeFirst, replaceAll, reversed, sort, spliteratorMethods inherited from interface jason.asSyntax.Term
getCyclicVar, getSrcInfo, isMap, isSet, setSrcInfoMethods inherited from interface jason.util.ToJson
getAsJson, getAsJsonStr
-
Constructor Details
-
VarTerm
-
VarTerm
-
VarTerm
-
-
Method Details
-
parseVar
Deprecated.prefer ASSyntax.parseVar(...) -
capply
Description copied from interface:Termclone and applies together (and faster than clone and then apply)- Specified by:
capplyin interfaceTerm- Overrides:
capplyin classLiteralImpl
-
clone
Description copied from class:Structuremake a deep copy of the terms- Specified by:
clonein interfaceTerm- Overrides:
clonein classLiteralImpl
-
cloneNS
Description copied from interface:Termclone in another namespace- Specified by:
cloneNSin interfaceTerm- Overrides:
cloneNSin classLiteralImpl
-
cloneLT
Description copied from interface:ListTermclone the list term -
isVar
public boolean isVar()- Specified by:
isVarin interfaceTerm- Overrides:
isVarin classDefaultTerm
-
isUnnamedVar
public boolean isUnnamedVar()- Specified by:
isUnnamedVarin interfaceTerm- Overrides:
isUnnamedVarin classDefaultTerm
-
isGround
public boolean isGround() -
equals
- Specified by:
equalsin interfaceCollection<Term>- Specified by:
equalsin interfaceList<Term>- Specified by:
equalsin interfaceTerm- Overrides:
equalsin classLiteralImpl
-
calcHashCode
protected int calcHashCode()- Overrides:
calcHashCodein classLiteralImpl
-
compareTo
- Specified by:
compareToin interfaceComparable<Term>- Overrides:
compareToin classAtom
-
subsumes
-
logicalConsequence
Description copied from class:LiterallogicalConsequence checks whether one particular predicate is a logical consequence of the belief base. Returns an iterator for all unifiers that are logCons.- Specified by:
logicalConsequencein interfaceLogicalFormula- Overrides:
logicalConsequencein classLiteral
-
getTerm
Description copied from class:Literalreturns the i-th term (first term is 0) -
addTerm
-
getArity
public int getArity()Description copied from class:Literalreturns the number of terms of this literal -
getTerms
Description copied from class:Literalreturns all terms of this literal -
setTerms
Description copied from class:Literalset all terms of the literal and return this -
setTerm
-
addTerms
Description copied from class:Literaladds some terms and return this -
isInternalAction
public boolean isInternalAction()- Specified by:
isInternalActionin interfaceTerm- Overrides:
isInternalActionin classDefaultTerm
-
isList
public boolean isList()- Specified by:
isListin interfaceTerm- Overrides:
isListin classDefaultTerm
-
isString
public boolean isString()- Specified by:
isStringin interfaceTerm- Overrides:
isStringin classDefaultTerm
-
isPlanBody
public boolean isPlanBody()- Specified by:
isPlanBodyin interfaceTerm- Overrides:
isPlanBodyin classDefaultTerm
-
isNumeric
public boolean isNumeric()- Specified by:
isNumericin interfaceTerm- Overrides:
isNumericin classDefaultTerm
-
isPred
public boolean isPred() -
isLiteral
public boolean isLiteral() -
isStructure
public boolean isStructure()- Specified by:
isStructurein interfaceTerm- Overrides:
isStructurein classStructure
-
isAtom
public boolean isAtom()- Specified by:
isAtomin interfaceTerm- Overrides:
isAtomin classLiteralImpl
-
isRule
public boolean isRule()- Specified by:
isRulein interfaceTerm- Overrides:
isRulein classDefaultTerm
-
isArithExpr
public boolean isArithExpr()- Specified by:
isArithExprin interfaceTerm- Overrides:
isArithExprin classDefaultTerm
-
isCyclicTerm
public boolean isCyclicTerm()- Specified by:
isCyclicTermin interfaceTerm- Overrides:
isCyclicTermin classDefaultTerm
-
hasVar
-
countVars
-
canBeAddedInBB
public boolean canBeAddedInBB()Description copied from class:LiteralImplto be overridden by subclasses (as internal action)- Overrides:
canBeAddedInBBin classLiteralImpl
-
solve
Description copied from interface:NumberTermreturns the numeric value of the term- Specified by:
solvein interfaceNumberTerm- Throws:
NoValueException
-
add
-
add
-
addAll
-
addAll
-
clear
public void clear() -
contains
-
containsAll
- Specified by:
containsAllin interfaceCollection<Term>- Specified by:
containsAllin interfaceList<Term>
-
get
-
indexOf
-
lastIndexOf
- Specified by:
lastIndexOfin interfaceList<Term>
-
iterator
-
listIterator
- Specified by:
listIteratorin interfaceList<Term>
-
listIterator
- Specified by:
listIteratorin interfaceList<Term>
-
remove
-
remove
-
removeAll
-
retainAll
-
set
-
subList
-
subSets
Description copied from interface:ListTermreturns all subsets that take k elements of this list -
toArray
-
toArray
-
setTerm
-
setNext
-
append
-
insert
-
concat
-
reverse
-
union
-
intersection
- Specified by:
intersectionin interfaceListTerm
-
difference
- Specified by:
differencein interfaceListTerm
-
getAsList
-
getLast
-
getPenultimate
- Specified by:
getPenultimatein interfaceListTerm
-
removeLast
- Specified by:
removeLastin interfaceList<Term>- Specified by:
removeLastin interfaceListTerm- Specified by:
removeLastin interfaceSequencedCollection<Term>
-
getNext
-
getTerm
-
isEmpty
public boolean isEmpty() -
isEnd
public boolean isEnd() -
isTail
public boolean isTail() -
setTail
-
getTail
-
listTermIterator
- Specified by:
listTermIteratorin interfaceListTerm
-
size
public int size() -
cloneLTShallow
Description copied from interface:ListTermmake a shallow copy of the list (terms are not cloned, only the structure)- Specified by:
cloneLTShallowin interfaceListTerm
-
getAsDOM
get as XML- Specified by:
getAsDOMin interfaceToDOM- Overrides:
getAsDOMin classLiteralImpl
-