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, 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
-
Method Summary
Modifier and TypeMethodDescriptionboolean
adds 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 namespacevoid
static Pred
createSource
(Term source) boolean
boolean
removes all annots in this pred that are in the list l.boolean
deletes one source(agName) annotation, return true if deletedvoid
deletes all source annotationsboolean
boolean
find 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.boolean
hasAnnot()
returns true if the pred has at least one annotboolean
returns true if there is some annotation t in the literalboolean
returns true if this literal has some source annotationboolean
returns true if this literal has a "source(agName)"boolean
returns true if all this predicate annots are in p's annotsboolean
hasSubsetAnnot
(Literal p, Unifier u) Returns true if all this predicate's annots are in p's annots using the unifier u.boolean
boolean
"import" annots from another predicate p.boolean
isAtom()
boolean
isGround()
boolean
isPred()
makeVarsAnnon
(Unifier un) replaces all variables of the term for unnamed variables (_).static Pred
Methods 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, varToReplace
Methods inherited from class jason.asSyntax.Atom
compareTo, getFunctor, getNS
Methods inherited from class jason.asSyntax.Literal
addSourceInfoAsAnnots, canBeAddedInBB, copy, delAnnots, forceFullLiteralImpl, getAsJson, getAsListOfTerms, getPredicateIndicator, getTermsArray, isLiteral, logicalConsequence, negated, newFromListOfTerms, newFunctor, noSource, parseLiteral, setNegated, subjectToBUF
Methods inherited from class jason.asSyntax.DefaultTerm
getCyclicVar, getErrorMsg, getSrcInfo, hashCode, isArithExpr, isCyclicTerm, isInternalAction, isList, isMap, isNumeric, isPlanBody, 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
getCyclicVar, getSrcInfo, isArithExpr, isCyclicTerm, isInternalAction, isList, isMap, isNumeric, isPlanBody, isRule, isSet, isString, isUnnamedVar, isVar, setSrcInfo
Methods inherited from interface jason.util.ToJson
getAsJsonStr
-
Constructor Details
-
Pred
-
Pred
-
Pred
-
Pred
-
Pred
-
Pred
-
-
Method Details
-
parsePred
-
isPred
public boolean isPred()- Specified by:
isPred
in interfaceTerm
- Overrides:
isPred
in classDefaultTerm
-
isAtom
public boolean isAtom() -
isGround
public boolean isGround() -
setAnnots
-
addAnnot
-
addAnnots
Description copied from class:Literal
adds some annots and return this -
addAnnots
Description copied from class:Literal
adds some annots and return this -
delAnnot
-
clearAnnots
Description copied from class:Literal
removes all annotations and returns itself- Overrides:
clearAnnots
in classLiteral
-
getAnnots
Description copied from class:Literal
returns all annotations of the literal -
capplyAnnots
-
hasAnnot
Description copied from class:Literal
returns 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:Literal
returns 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:
importAnnots
in classLiteral
- Returns:
- true if some annot was imported.
-
delAnnots
Description copied from class:Literal
removes all annots in this pred that are in the list l. -
getAnnots
Description copied from class:Literal
returns 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:Literal
returns true if all this predicate annots are in p's annots- Overrides:
hasSubsetAnnot
in classLiteral
-
hasSubsetAnnot
Description copied from class:Literal
Returns 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:
hasSubsetAnnot
in classLiteral
-
addSource
Description copied from class:Literal
adds the annotation source(agName) -
delSource
Description copied from class:Literal
deletes one source(agName) annotation, return true if deleted -
createSource
-
getSources
Description copied from class:Literal
returns the sources of this literal as a new list. e.g.: from annots [source(a), source(b)], it returns [a,b]- Overrides:
getSources
in classLiteral
-
delSources
public void delSources()Description copied from class:Literal
deletes all source annotations- Overrides:
delSources
in classLiteral
-
hasSource
public boolean hasSource()Description copied from class:Literal
returns true if this literal has some source annotation -
hasSource
Description copied from class:Literal
returns true if this literal has a "source(agName)" -
makeVarsAnnon
Description copied from class:Literal
replaces all variables of the term for unnamed variables (_).- Overrides:
makeVarsAnnon
in classStructure
- Parameters:
un
- is the unifier that contains the map of replacements
-
equals
-
equalsAsStructure
- Overrides:
equalsAsStructure
in classLiteral
-
capply
Description copied from interface:Term
clone and applies together (and faster than clone and then apply) -
clone
Description copied from class:Structure
make a deep copy of the terms -
cloneNS
Description copied from interface:Term
clone in another namespace -
toStringAsTerm
-
getAsDOM
get as XML
-