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, emptyTermListFields inherited from class jason.asSyntax.Literal
DefaultNS, LFalse, LNeg, LPos, LTrue, predicateIndicatorCacheFields inherited from class jason.asSyntax.DefaultTerm
hashCodeCache, srcInfo -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected intclone and applies together (and faster than clone and then apply)clone()make a deep copy of the termsvoidbooleanget as XMLgetBody()getHead()booleanbooleanisAtom()booleanisGround()booleanisRule()booleanisTerm()makeVarsAnnon(Unifier un) replaces all variables of the term for unnamed variables (_).voidsetAsTerm(boolean b) toString()Methods inherited from class jason.asSyntax.LiteralImpl
canBeAddedInBB, cloneNS, getErrorMsg, getPredicateIndicator, negated, setNegatedMethods 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, toStringAsTermMethods inherited from class jason.asSyntax.Structure
addTerm, addTerms, addTerms, delTerm, getArity, getSingletonVars, getTerm, getTerms, getTermsSize, hasTerm, isStructure, isUnary, makeTermsAnnon, makeVarsAnnon, parse, setTerm, setTerms, subsumes, varToReplaceMethods inherited from class jason.asSyntax.Atom
compareTo, getFunctor, getNSMethods inherited from class jason.asSyntax.Literal
addSourceInfoAsAnnots, copy, delAnnots, forceFullLiteralImpl, getAsJson, getAsListOfTerms, getTermsArray, isLiteral, logicalConsequence, newFromListOfTerms, newFunctor, noSource, parseLiteral, subjectToBUFMethods inherited from class jason.asSyntax.DefaultTerm
getCyclicVar, getSrcInfo, hashCode, isArithExpr, isCyclicTerm, isInternalAction, isList, isMap, isNumeric, isPlanBody, isSet, isString, isUnnamedVar, isVar, resetHashCodeCache, setSrcInfoMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface jason.asSyntax.Term
getCyclicVar, getSrcInfo, isArithExpr, isCyclicTerm, isInternalAction, isList, isMap, isNumeric, isPlanBody, isSet, isString, isUnnamedVar, isVar, setSrcInfoMethods inherited from interface jason.util.ToJson
getAsJsonStr
-
Constructor Details
-
Rule
-
Rule
-
-
Method Details
-
isRule
public boolean isRule()- Specified by:
isRulein interfaceTerm- Overrides:
isRulein classDefaultTerm
-
isAtom
public boolean isAtom()- Specified by:
isAtomin interfaceTerm- Overrides:
isAtomin classLiteralImpl
-
isGround
public boolean isGround() -
setAsTerm
public void setAsTerm(boolean b) -
isTerm
public boolean isTerm() -
equals
- Specified by:
equalsin interfaceTerm- Overrides:
equalsin classLiteralImpl
-
calcHashCode
protected int calcHashCode()- Overrides:
calcHashCodein classLiteralImpl
-
getBody
-
getHead
-
makeVarsAnnon
Description copied from class:Literalreplaces all variables of the term for unnamed variables (_).- Overrides:
makeVarsAnnonin classPred- Parameters:
un- is the unifier that contains the map of replacements
-
capply
Description copied from interface:Termclone and applies together (and faster than clone and then apply)- Specified by:
capplyin interfaceTerm- Overrides:
capplyin classLiteralImpl
-
clone
Description copied from class:Structuremake a deep copy of the terms- Specified by:
clonein interfaceTerm- Overrides:
clonein classLiteralImpl
-
headClone
-
headCApply
-
toString
-
hasVar
-
countVars
-
getAsDOM
get as XML- Specified by:
getAsDOMin interfaceToDOM- Overrides:
getAsDOMin classLiteralImpl
-