public class Pred extends Structure
emptyTermArray, emptyTermList
LFalse, LNeg, LPos, LTrue, predicateIndicatorCache
hashCodeCache, srcInfo
Modifier | Constructor and Description |
---|---|
|
Pred(Literal l) |
protected |
Pred(Literal l,
Unifier u) |
|
Pred(java.lang.String functor) |
|
Pred(java.lang.String functor,
int termsSize) |
Modifier and Type | Method and Description |
---|---|
boolean |
addAnnot(Term t) |
Literal |
addAnnots(java.util.List<Term> l)
adds some annots and return this
|
Literal |
addAnnots(Term... l)
adds some annots and return this
|
void |
addSource(Term agName)
adds the annotation source(agName)
|
Term |
capply(Unifier u)
clone and applies together (and faster than clone and then apply)
|
void |
clearAnnots()
removes all annotations
|
Term |
clone()
make a deep copy of the terms
|
int |
compareTo(Term t) |
void |
countVars(java.util.Map<VarTerm,java.lang.Integer> c) |
static Pred |
createSource(Term source) |
boolean |
delAnnot(Term t) |
boolean |
delAnnots(java.util.List<Term> l)
removes all annots in this pred that are in the list l.
|
boolean |
delSource(Term agName)
deletes one source(agName) annotation, return true if deleted
|
void |
delSources()
deletes all source annotations
|
boolean |
equals(java.lang.Object o) |
boolean |
equalsAsStructure(java.lang.Object p) |
Literal |
getAnnot(java.lang.String functor)
returns the first annotation (literal) that has the functor
|
ListTerm |
getAnnots()
returns all annotations of the literal
|
ListTerm |
getAnnots(java.lang.String functor)
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.
|
org.w3c.dom.Element |
getAsDOM(org.w3c.dom.Document document)
get as XML
|
ListTerm |
getSources()
returns the sources of this literal as a new list.
|
boolean |
hasAnnot()
returns true if the pred has at least one annot
|
boolean |
hasAnnot(Term t)
returns true if there is some annotation t in the literal
|
boolean |
hasSource()
returns true if this literal has some source annotation
|
boolean |
hasSource(Term agName)
returns true if this literal has a "source(agName)"
|
boolean |
hasSubsetAnnot(Literal p)
returns true if all this predicate annots are in p's annots
|
boolean |
hasSubsetAnnot(Literal p,
Unifier u)
Returns true if all this predicate's annots are in p's annots using the
unifier u.
|
boolean |
hasVar(VarTerm t,
Unifier u) |
boolean |
importAnnots(Literal p)
"import" annots from another predicate p.
|
boolean |
isAtom() |
boolean |
isGround() |
boolean |
isPred() |
Literal |
makeVarsAnnon(Unifier un)
replaces all variables of the term for unnamed variables (_).
|
static Pred |
parsePred(java.lang.String sPred) |
Literal |
setAnnots(ListTerm l) |
java.lang.String |
toString() |
java.lang.String |
toStringAsTerm() |
addTerm, addTerms, addTerms, calcHashCode, delTerm, getArity, getSingletonVars, getTerm, getTerms, getTermsSize, hasTerm, isStructure, isUnary, makeTermsAnnon, makeVarsAnnon, parse, setTerm, setTerms, subsumes, varToReplace
getFunctor
canBeAddedInBB, copy, forceFullLiteralImpl, getAsListOfTerms, getPredicateIndicator, getTermsArray, isLiteral, logicalConsequence, negated, newFromListOfTerms, parseLiteral, setNegated
getCyclicVar, getErrorMsg, getSrcInfo, hashCode, isArithExpr, isCyclicTerm, isInternalAction, isList, isNumeric, isPlanBody, isRule, isString, isUnnamedVar, isVar, resetHashCodeCache, setSrcInfo
finalize, getClass, notify, notifyAll, wait, wait, wait
getCyclicVar, getSrcInfo, isArithExpr, isCyclicTerm, isInternalAction, isList, isNumeric, isPlanBody, isRule, isString, isUnnamedVar, isVar, setSrcInfo
public Pred(java.lang.String functor)
public Pred(Literal l)
public Pred(java.lang.String functor, int termsSize)
public static Pred parsePred(java.lang.String sPred)
public boolean isPred()
isPred
in interface Term
isPred
in class DefaultTerm
public boolean isAtom()
public boolean isGround()
public Literal addAnnots(java.util.List<Term> l)
Literal
public Literal addAnnots(Term... l)
Literal
public void clearAnnots()
Literal
clearAnnots
in class Literal
public ListTerm getAnnots()
Literal
public boolean hasAnnot(Term t)
Literal
public Literal getAnnot(java.lang.String functor)
Literal
public boolean hasAnnot()
Literal
public void countVars(java.util.Map<VarTerm,java.lang.Integer> c)
public boolean importAnnots(Literal p)
Literal
importAnnots
in class Literal
public boolean delAnnots(java.util.List<Term> l)
Literal
public ListTerm getAnnots(java.lang.String functor)
Literal
public boolean hasSubsetAnnot(Literal p)
Literal
hasSubsetAnnot
in class Literal
public boolean hasSubsetAnnot(Literal p, Unifier u)
Literal
hasSubsetAnnot
in class Literal
public void addSource(Term agName)
Literal
public boolean delSource(Term agName)
Literal
public ListTerm getSources()
Literal
getSources
in class Literal
public void delSources()
Literal
delSources
in class Literal
public boolean hasSource()
Literal
public boolean hasSource(Term agName)
Literal
public Literal makeVarsAnnon(Unifier un)
Literal
makeVarsAnnon
in class Structure
un
- is the unifier that contains the map of replacementspublic boolean equals(java.lang.Object o)
public boolean equalsAsStructure(java.lang.Object p)
equalsAsStructure
in class Literal
public int compareTo(Term t)
public Term capply(Unifier u)
Term
public java.lang.String toStringAsTerm()