Package jason.asSyntax
Class Rule
- All Implemented Interfaces:
LogicalFormula
,Term
,ToDOM
,ToJson
,Serializable
,Cloneable
,Comparable<Term>
A rule is a Literal (head) with a body, as in "a :- b & c".
- 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 TypeMethodDescriptionprotected int
clone and applies together (and faster than clone and then apply)clone()
make a deep copy of the termsvoid
boolean
get as XMLgetBody()
getHead()
boolean
boolean
isAtom()
boolean
isGround()
boolean
isRule()
boolean
isTerm()
makeVarsAnnon
(Unifier un) replaces all variables of the term for unnamed variables (_).void
setAsTerm
(boolean b) toString()
Methods inherited from class jason.asSyntax.LiteralImpl
canBeAddedInBB, cloneNS, getErrorMsg, getPredicateIndicator, negated, setNegated
Methods inherited from class jason.asSyntax.Pred
addAnnot, addAnnots, addAnnots, addSource, capplyAnnots, clearAnnots, createSource, delAnnot, delAnnots, delSource, delSources, equalsAsStructure, getAnnot, getAnnots, getAnnots, getSources, hasAnnot, hasAnnot, hasSource, hasSource, hasSubsetAnnot, hasSubsetAnnot, importAnnots, isPred, parsePred, setAnnots, toStringAsTerm
Methods inherited from class jason.asSyntax.Structure
addTerm, addTerms, addTerms, delTerm, getArity, getSingletonVars, getTerm, getTerms, getTermsSize, hasTerm, isStructure, isUnary, makeTermsAnnon, makeVarsAnnon, parse, setTerm, setTerms, subsumes, varToReplace
Methods inherited from class jason.asSyntax.Atom
compareTo, getFunctor, getNS
Methods inherited from class jason.asSyntax.Literal
addSourceInfoAsAnnots, copy, delAnnots, forceFullLiteralImpl, getAsJson, getAsListOfTerms, getTermsArray, isLiteral, logicalConsequence, newFromListOfTerms, newFunctor, noSource, parseLiteral, subjectToBUF
Methods inherited from class jason.asSyntax.DefaultTerm
getCyclicVar, getSrcInfo, hashCode, isArithExpr, isCyclicTerm, isInternalAction, isList, isMap, isNumeric, isPlanBody, 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, isSet, isString, isUnnamedVar, isVar, setSrcInfo
Methods inherited from interface jason.util.ToJson
getAsJsonStr
-
Constructor Details
-
Rule
-
Rule
-
-
Method Details
-
isRule
public boolean isRule()- Specified by:
isRule
in interfaceTerm
- Overrides:
isRule
in classDefaultTerm
-
isAtom
public boolean isAtom()- Specified by:
isAtom
in interfaceTerm
- Overrides:
isAtom
in classLiteralImpl
-
isGround
public boolean isGround() -
setAsTerm
public void setAsTerm(boolean b) -
isTerm
public boolean isTerm() -
equals
- Specified by:
equals
in interfaceTerm
- Overrides:
equals
in classLiteralImpl
-
calcHashCode
protected int calcHashCode()- Overrides:
calcHashCode
in classLiteralImpl
-
getBody
-
getHead
-
makeVarsAnnon
Description copied from class:Literal
replaces all variables of the term for unnamed variables (_).- Overrides:
makeVarsAnnon
in classPred
- Parameters:
un
- is the unifier that contains the map of replacements
-
capply
Description copied from interface:Term
clone and applies together (and faster than clone and then apply)- Specified by:
capply
in interfaceTerm
- Overrides:
capply
in classLiteralImpl
-
clone
Description copied from class:Structure
make a deep copy of the terms- Specified by:
clone
in interfaceTerm
- Overrides:
clone
in classLiteralImpl
-
headClone
-
headCApply
-
toString
-
hasVar
-
countVars
-
getAsDOM
get as XML- Specified by:
getAsDOM
in interfaceToDOM
- Overrides:
getAsDOM
in classLiteralImpl
-