public class Rule extends LiteralImpl
Literal.FalseLiteral, Literal.TrueLiteral
Modifier and Type | Field and Description |
---|---|
private LogicalFormula |
body |
private boolean |
isTerm |
private static java.util.logging.Logger |
logger |
private static long |
serialVersionUID |
emptyTermArray, emptyTermList
DefaultNS, LFalse, LNeg, LPos, LTrue, predicateIndicatorCache
hashCodeCache, srcInfo
Constructor and Description |
---|
Rule(Literal head,
LogicalFormula body) |
Rule(Rule r,
Unifier u) |
Modifier and Type | Method and Description |
---|---|
protected int |
calcHashCode() |
Term |
capply(Unifier u)
clone and applies together (and faster than clone and then apply)
|
Rule |
clone()
make a deep copy of the terms
|
void |
countVars(java.util.Map<VarTerm,java.lang.Integer> c) |
boolean |
equals(java.lang.Object o) |
org.w3c.dom.Element |
getAsDOM(org.w3c.dom.Document document)
get as XML
|
LogicalFormula |
getBody() |
Literal |
getHead() |
boolean |
hasVar(VarTerm t,
Unifier u) |
Literal |
headCApply(Unifier u) |
Literal |
headClone() |
boolean |
isAtom() |
boolean |
isGround() |
boolean |
isRule() |
boolean |
isTerm() |
Literal |
makeVarsAnnon(Unifier un)
replaces all variables of the term for unnamed variables (_).
|
void |
setAsTerm(boolean b) |
java.lang.String |
toString() |
canBeAddedInBB, cloneNS, compareTo, getErrorMsg, getPredicateIndicator, negated, setNegated
addAnnot, addAnnots, addAnnots, addSource, clearAnnots, createSource, delAnnot, delAnnots, delSource, delSources, equalsAsStructure, getAnnot, getAnnots, getAnnots, getSources, hasAnnot, hasAnnot, hasSource, hasSource, hasSubsetAnnot, hasSubsetAnnot, importAnnots, isPred, parsePred, setAnnots, toStringAsTerm
addTerm, addTerms, addTerms, delTerm, getArity, getSingletonVars, getTerm, getTerms, getTermsSize, hasTerm, isStructure, isUnary, makeTermsAnnon, makeVarsAnnon, parse, setTerm, setTerms, subsumes, varToReplace
getFunctor, getNS
copy, forceFullLiteralImpl, getAsListOfTerms, getTermsArray, isLiteral, logicalConsequence, newFromListOfTerms, parseLiteral
getCyclicVar, getSrcInfo, hashCode, isArithExpr, isCyclicTerm, isInternalAction, isList, isNumeric, isPlanBody, isString, isUnnamedVar, isVar, resetHashCodeCache, setSrcInfo
finalize, getClass, notify, notifyAll, wait, wait, wait
getCyclicVar, getSrcInfo, isArithExpr, isCyclicTerm, isInternalAction, isList, isNumeric, isPlanBody, isString, isUnnamedVar, isVar, setSrcInfo
private static final long serialVersionUID
private static java.util.logging.Logger logger
private LogicalFormula body
private boolean isTerm
public Rule(Literal head, LogicalFormula body)
public boolean isRule()
isRule
in interface Term
isRule
in class DefaultTerm
public boolean isAtom()
isAtom
in interface Term
isAtom
in class LiteralImpl
public boolean isGround()
public void setAsTerm(boolean b)
public boolean isTerm()
public boolean equals(java.lang.Object o)
equals
in interface Term
equals
in class LiteralImpl
protected int calcHashCode()
calcHashCode
in class LiteralImpl
public LogicalFormula getBody()
public Literal getHead()
public Literal makeVarsAnnon(Unifier un)
Literal
makeVarsAnnon
in class Pred
un
- is the unifier that contains the map of replacementspublic Term capply(Unifier u)
Term
capply
in interface Term
capply
in class LiteralImpl
public Rule clone()
Structure
clone
in interface Term
clone
in class LiteralImpl
public Literal headClone()
public void countVars(java.util.Map<VarTerm,java.lang.Integer> c)
public org.w3c.dom.Element getAsDOM(org.w3c.dom.Document document)
getAsDOM
in interface ToDOM
getAsDOM
in class LiteralImpl