public class PlanBodyImpl extends Structure implements PlanBody, java.lang.Iterable<PlanBody>
a1; ?t; !g
is represented by the following structure
(a1, (?t, (!g)))
.PlanBody.BodyType
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
BODY_PLAN_FUNCTOR |
emptyTermArray, emptyTermList
LFalse, LNeg, LPos, LTrue, predicateIndicatorCache
hashCodeCache, srcInfo
Constructor and Description |
---|
PlanBodyImpl()
constructor for empty plan body
|
PlanBodyImpl(boolean planTerm) |
PlanBodyImpl(PlanBody.BodyType t,
Term b) |
PlanBodyImpl(PlanBody.BodyType t,
Term b,
boolean planTerm) |
Modifier and Type | Method and Description |
---|---|
boolean |
add(int index,
PlanBody bl) |
boolean |
add(PlanBody bl)
clone the plan body and adds it in the end of this plan
|
int |
calcHashCode() |
PlanBody |
capply(Unifier u)
clone and applies together (and faster than clone and then apply)
|
PlanBody |
clone()
make a deep copy of the terms
|
PlanBody |
clonePB()
clone the plan body
|
boolean |
equals(java.lang.Object o) |
int |
getArity()
returns the number of terms of this literal
|
org.w3c.dom.Element |
getAsDOM(org.w3c.dom.Document document)
get as XML
|
PlanBody |
getBodyNext() |
Term |
getBodyTerm() |
PlanBody.BodyType |
getBodyType() |
PlanBody |
getLastBody() |
int |
getPlanSize() |
Term |
getTerm(int i)
returns the i-th term (first term is 0)
|
boolean |
isAtom() |
boolean |
isBodyTerm() |
boolean |
isEmptyBody() |
boolean |
isPlanBody() |
java.util.Iterator<PlanBody> |
iterator() |
java.util.Iterator<Unifier> |
logicalConsequence(Agent ag,
Unifier un)
logicalConsequence checks whether one particular predicate
is a logical consequence of the belief base.
|
Term |
removeBody(int index) |
void |
setAsBodyTerm(boolean b) |
void |
setBodyNext(PlanBody next) |
void |
setBodyTerm(Term t) |
void |
setBodyType(PlanBody.BodyType bt) |
void |
setTerm(int i,
Term t) |
java.lang.String |
toString() |
addTerm, addTerms, addTerms, compareTo, countVars, delTerm, getSingletonVars, getTerms, getTermsSize, hasTerm, hasVar, isGround, isStructure, isUnary, makeTermsAnnon, makeVarsAnnon, makeVarsAnnon, parse, setTerms, subsumes, varToReplace
getFunctor
addAnnot, addAnnots, addAnnots, addSource, canBeAddedInBB, clearAnnots, copy, delAnnot, delAnnots, delSource, delSources, equalsAsStructure, forceFullLiteralImpl, getAnnot, getAnnots, getAnnots, getAsListOfTerms, getPredicateIndicator, getSources, getTermsArray, hasAnnot, hasAnnot, hasSource, hasSource, hasSubsetAnnot, hasSubsetAnnot, importAnnots, isLiteral, negated, newFromListOfTerms, parseLiteral, setAnnots, setNegated
getCyclicVar, getErrorMsg, getSrcInfo, hashCode, isArithExpr, isCyclicTerm, isInternalAction, isList, isNumeric, isPred, isRule, isString, isUnnamedVar, isVar, resetHashCodeCache, setSrcInfo
finalize, getClass, notify, notifyAll, wait, wait, wait
countVars, getCyclicVar, getSrcInfo, hasVar, isArithExpr, isCyclicTerm, isGround, isInternalAction, isList, isLiteral, isNumeric, isPred, isRule, isString, isStructure, isUnnamedVar, isVar, setSrcInfo, subsumes
public static final java.lang.String BODY_PLAN_FUNCTOR
public PlanBodyImpl()
public PlanBodyImpl(boolean planTerm)
public PlanBodyImpl(PlanBody.BodyType t, Term b)
public PlanBodyImpl(PlanBody.BodyType t, Term b, boolean planTerm)
public void setBodyNext(PlanBody next)
setBodyNext
in interface PlanBody
public PlanBody getBodyNext()
getBodyNext
in interface PlanBody
public boolean isEmptyBody()
isEmptyBody
in interface PlanBody
public PlanBody.BodyType getBodyType()
getBodyType
in interface PlanBody
public void setBodyType(PlanBody.BodyType bt)
setBodyType
in interface PlanBody
public Term getBodyTerm()
getBodyTerm
in interface PlanBody
public void setBodyTerm(Term t)
setBodyTerm
in interface PlanBody
public boolean isBodyTerm()
isBodyTerm
in interface PlanBody
public boolean isAtom()
public void setAsBodyTerm(boolean b)
setAsBodyTerm
in interface PlanBody
public boolean isPlanBody()
isPlanBody
in interface Term
isPlanBody
in class DefaultTerm
public java.util.Iterator<PlanBody> iterator()
iterator
in interface java.lang.Iterable<PlanBody>
public int getArity()
Literal
public Term getTerm(int i)
Literal
public java.util.Iterator<Unifier> logicalConsequence(Agent ag, Unifier un)
Literal
logicalConsequence
in interface LogicalFormula
logicalConsequence
in class Literal
public boolean equals(java.lang.Object o)
public int calcHashCode()
calcHashCode
in class Structure
public boolean add(PlanBody bl)
public PlanBody getLastBody()
getLastBody
in interface PlanBody
public Term removeBody(int index)
removeBody
in interface PlanBody
public int getPlanSize()
getPlanSize
in interface PlanBody
public PlanBody capply(Unifier u)
Term
public PlanBody clone()
Structure