Package jason.asSyntax
Class Pred
java.lang.Object
jason.asSyntax.DefaultTerm
jason.asSyntax.Literal
jason.asSyntax.Atom
jason.asSyntax.Structure
jason.asSyntax.Pred
- All Implemented Interfaces:
LogicalFormula,Term,ToDOM,ToJson,Serializable,Cloneable,Comparable<Term>
- Direct Known Subclasses:
LiteralImpl
A Pred extends a Structure with annotations, e.g.: a(1)[an1,an2].
- 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, srcInfo -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanadds some annots and return thisadds some annots and return thisadds the annotation source(agName)clone and applies together (and faster than clone and then apply)removes all annotations and returns itselfclone()make a deep copy of the termsclone in another namespacevoidstatic PredcreateSource(Term source) booleanbooleanremoves all annots in this pred that are in the list l.booleandeletes one source(agName) annotation, return true if deletedvoiddeletes all source annotationsbooleanbooleanfind the first annotation with a given functor (only literal annots are considered)returns all annotations of the literalreturns all annots with the specified functor e.g.: from annots [t(a), t(b), source(tom)] and functor "t", it returns [t(a),t(b)] in case that there is no such an annot, it returns an empty list.get as XMLreturns the sources of this literal as a new list.booleanhasAnnot()returns true if the pred has at least one annotbooleanreturns true if there is some annotation t in the literalbooleanreturns true if this literal has some source annotationbooleanreturns true if this literal has a "source(agName)"booleanreturns true if all this predicate annots are in p's annotsbooleanhasSubsetAnnot(Literal p, Unifier u) Returns true if all this predicate's annots are in p's annots using the unifier u.booleanboolean"import" annots from another predicate p.booleanisAtom()booleanisGround()booleanisPred()makeVarsAnnon(Unifier un) replaces all variables of the term for unnamed variables (_).static PredMethods inherited from class jason.asSyntax.Structure
addTerm, addTerms, addTerms, calcHashCode, delTerm, getArity, getSingletonVars, getTerm, getTerms, getTermsSize, hasTerm, isStructure, isUnary, makeTermsAnnon, makeVarsAnnon, parse, setTerm, setTerms, subsumes, toString, varToReplaceMethods inherited from class jason.asSyntax.Atom
compareTo, getFunctor, getNSMethods inherited from class jason.asSyntax.Literal
addSourceInfoAsAnnots, canBeAddedInBB, copy, delAnnots, forceFullLiteralImpl, getAsJson, getAsListOfTerms, getPredicateIndicator, getTermsArray, isLiteral, logicalConsequence, negated, newFromListOfTerms, newFunctor, noSource, parseLiteral, setNegated, subjectToBUFMethods inherited from class jason.asSyntax.DefaultTerm
getCyclicVar, getErrorMsg, getSrcInfo, hashCode, isArithExpr, isCyclicTerm, isInternalAction, isList, isMap, isNumeric, isPlanBody, 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, isRule, isSet, isString, isUnnamedVar, isVar, setSrcInfoMethods inherited from interface jason.util.ToJson
getAsJsonStr
-
Constructor Details
-
Pred
-
Pred
-
Pred
-
Pred
-
Pred
-
Pred
-
-
Method Details
-
parsePred
-
isPred
public boolean isPred()- Specified by:
isPredin interfaceTerm- Overrides:
isPredin classDefaultTerm
-
isAtom
public boolean isAtom() -
isGround
public boolean isGround() -
setAnnots
-
addAnnot
-
addAnnots
Description copied from class:Literaladds some annots and return this -
addAnnots
Description copied from class:Literaladds some annots and return this -
delAnnot
-
clearAnnots
Description copied from class:Literalremoves all annotations and returns itself- Overrides:
clearAnnotsin classLiteral
-
getAnnots
Description copied from class:Literalreturns all annotations of the literal -
capplyAnnots
-
hasAnnot
Description copied from class:Literalreturns true if there is some annotation t in the literal -
getAnnot
find the first annotation with a given functor (only literal annots are considered) -
hasAnnot
public boolean hasAnnot()Description copied from class:Literalreturns true if the pred has at least one annot -
hasVar
-
countVars
-
importAnnots
Description copied from class:Literal"import" annots from another predicate p. p will be changed to contain only the annots actually imported (for Event), for example: p = b[a,b] this = b[b,c] after import, p = b[a] It is used to generate event invalid input: '<'+b[a]>.- Overrides:
importAnnotsin classLiteral- Returns:
- true if some annot was imported.
-
delAnnots
Description copied from class:Literalremoves all annots in this pred that are in the list l. -
getAnnots
Description copied from class:Literalreturns all annots with the specified functor e.g.: from annots [t(a), t(b), source(tom)] and functor "t", it returns [t(a),t(b)] in case that there is no such an annot, it returns an empty list. -
hasSubsetAnnot
Description copied from class:Literalreturns true if all this predicate annots are in p's annots- Overrides:
hasSubsetAnnotin classLiteral
-
hasSubsetAnnot
Description copied from class:LiteralReturns true if all this predicate's annots are in p's annots using the unifier u. if p annots has a Tail, p annots's Tail will receive this predicate's annots, e.g.: this[a,b,c] = p[x,y,b|T] unifies and T is [a,c] (this will be a subset if p has a and c in its annots). if this annots has a tail, the Tail will receive all necessary term to be a subset, e.g.: this[b|T] = p[x,y,b] unifies and T is [x,y] (this will be a subset if T is [x,y].- Overrides:
hasSubsetAnnotin classLiteral
-
addSource
Description copied from class:Literaladds the annotation source(agName) -
delSource
Description copied from class:Literaldeletes one source(agName) annotation, return true if deleted -
createSource
-
getSources
Description copied from class:Literalreturns the sources of this literal as a new list. e.g.: from annots [source(a), source(b)], it returns [a,b]- Overrides:
getSourcesin classLiteral
-
delSources
public void delSources()Description copied from class:Literaldeletes all source annotations- Overrides:
delSourcesin classLiteral
-
hasSource
public boolean hasSource()Description copied from class:Literalreturns true if this literal has some source annotation -
hasSource
Description copied from class:Literalreturns true if this literal has a "source(agName)" -
makeVarsAnnon
Description copied from class:Literalreplaces all variables of the term for unnamed variables (_).- Overrides:
makeVarsAnnonin classStructure- Parameters:
un- is the unifier that contains the map of replacements
-
equals
-
equalsAsStructure
- Overrides:
equalsAsStructurein classLiteral
-
capply
Description copied from interface:Termclone and applies together (and faster than clone and then apply) -
clone
Description copied from class:Structuremake a deep copy of the terms -
cloneNS
Description copied from interface:Termclone in another namespace -
toStringAsTerm
-
getAsDOM
get as XML
-