Package jason.asSyntax
Class Structure
java.lang.Object
jason.asSyntax.DefaultTerm
jason.asSyntax.Literal
jason.asSyntax.Atom
jason.asSyntax.Structure
- All Implemented Interfaces:
LogicalFormula,Term,ToDOM,ToJson,Serializable,Cloneable,Comparable<Term>
- Direct Known Subclasses:
ArithFunctionTerm,BinaryStructure,InternalActionLiteral,ListTermImpl,Plan,PlanBodyImpl,Pred,Trigger
Represents a structure: a functor with n arguments,
e.g.: val(10,x(3)).
- See Also:
-
Field Summary
FieldsFields inherited from class jason.asSyntax.Literal
DefaultNS, LFalse, LNeg, LPos, LTrue, predicateIndicatorCacheFields inherited from class jason.asSyntax.DefaultTerm
hashCodeCache, srcInfo -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadds some terms and return thisadds some terms and return thisprotected intclone and applies together (and faster than clone and then apply)clone()make a deep copy of the termsclone in another namespacevoidvoiddelTerm(int index) booleanintgetArity()returns the number of terms of this literalget as XMLreturns all singleton vars (that appears once) in this literalgetTerm(int i) returns the i-th term (first term is 0)getTerms()returns all terms of this literalintDeprecated.use getAritybooleanhasTerm()returns true if this literal has some termbooleanbooleanisAtom()booleanisGround()booleanbooleanisUnary()voidreplaces all terms by unnamed variables (_).replaces all variables by unnamed variables (_).makeVarsAnnon(Unifier un) replaces all variables of the term for unnamed variables (_).static Structurevoidset all terms of the literal and return thisbooleantoString()varToReplace(Term t, Unifier un) Methods inherited from class jason.asSyntax.Atom
compareTo, getFunctor, getNSMethods 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, isLiteral, logicalConsequence, negated, newFromListOfTerms, newFunctor, noSource, parseLiteral, setAnnots, setNegated, subjectToBUFMethods inherited from class jason.asSyntax.DefaultTerm
getCyclicVar, getErrorMsg, getSrcInfo, hashCode, isArithExpr, isCyclicTerm, isInternalAction, isList, isMap, isNumeric, isPlanBody, isPred, isRule, isSet, isString, isUnnamedVar, isVar, resetHashCodeCache, setSrcInfoMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface jason.asSyntax.Term
getCyclicVar, getSrcInfo, isArithExpr, isCyclicTerm, isInternalAction, isList, isMap, isNumeric, isPlanBody, isPred, isRule, isSet, isString, isUnnamedVar, isVar, setSrcInfoMethods inherited from interface jason.util.ToJson
getAsJsonStr
-
Field Details
-
emptyTermList
-
emptyTermArray
-
-
Constructor Details
-
Structure
-
Structure
-
Structure
-
Structure
-
Structure
-
Structure
Create a structure with a defined number of terms. It is used by list term, plan body, ... to not create the array list for terms.
-
-
Method Details
-
parse
-
calcHashCode
protected int calcHashCode()- Overrides:
calcHashCodein classAtom
-
equals
-
subsumes
- Specified by:
subsumesin interfaceTerm- Overrides:
subsumesin classDefaultTerm
-
capply
Description copied from interface:Termclone and applies together (and faster than clone and then apply) -
clone
make a deep copy of the terms -
cloneNS
Description copied from interface:Termclone in another namespace -
addTerm
-
delTerm
public void delTerm(int index) -
addTerms
Description copied from class:Literaladds some terms and return this -
addTerms
Description copied from class:Literaladds some terms and return this -
setTerms
Description copied from class:Literalset all terms of the literal and return this -
setTerm
-
getTerm
Description copied from class:Literalreturns the i-th term (first term is 0) -
getArity
public int getArity()Description copied from class:Literalreturns the number of terms of this literal -
getTermsSize
Deprecated.use getArity -
getTerms
Description copied from class:Literalreturns all terms of this literal -
hasTerm
public boolean hasTerm()Description copied from class:Literalreturns true if this literal has some term -
isStructure
public boolean isStructure()- Specified by:
isStructurein interfaceTerm- Overrides:
isStructurein classDefaultTerm
-
isAtom
public boolean isAtom() -
isGround
public boolean isGround()- Specified by:
isGroundin interfaceTerm- Overrides:
isGroundin classDefaultTerm
-
isUnary
public boolean isUnary() -
makeVarsAnnon
Description copied from class:Literalreplaces all variables by unnamed variables (_).- Overrides:
makeVarsAnnonin classLiteral
-
makeVarsAnnon
Description copied from class:Literalreplaces all variables of the term for unnamed variables (_).- Overrides:
makeVarsAnnonin classLiteral- Parameters:
un- is the unifier that contains the map of replacements
-
varToReplace
-
makeTermsAnnon
public void makeTermsAnnon()Description copied from class:Literalreplaces all terms by unnamed variables (_).- Overrides:
makeTermsAnnonin classLiteral
-
hasVar
- Specified by:
hasVarin interfaceTerm- Overrides:
hasVarin classDefaultTerm
-
getSingletonVars
Description copied from class:Literalreturns all singleton vars (that appears once) in this literal- Overrides:
getSingletonVarsin classLiteral
-
countVars
- Specified by:
countVarsin interfaceTerm- Overrides:
countVarsin classDefaultTerm
-
toString
-
getAsDOM
get as XML
-