Package jason.asSyntax
Class LogExpr
java.lang.Object
- All Implemented Interfaces:
LogicalFormula
,Term
,ToDOM
,ToJson
,java.io.Serializable
,java.lang.Cloneable
,java.lang.Comparable<Term>
public class LogExpr extends BinaryStructure implements LogicalFormula
Represents a logical formula with some logical operator ("&", "|", "not").
- See Also:
- Serialized Form
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
LogExpr.LogicalOp
Nested classes/interfaces inherited from class jason.asSyntax.Literal
Literal.FalseLiteral, Literal.TrueLiteral
-
Field Summary
Fields Modifier and Type Field Description static java.util.List<Unifier>
EMPTY_UNIF_LIST
private static java.util.logging.Logger
logger
private LogExpr.LogicalOp
op
private static long
serialVersionUID
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
Constructors Constructor Description LogExpr(LogExpr.LogicalOp oper, LogicalFormula f)
LogExpr(LogicalFormula f1, LogExpr.LogicalOp oper, LogicalFormula f2)
-
Method Summary
Modifier and Type Method Description Term
capply(Unifier u)
clone and applies together (and faster than clone and then apply)LogicalFormula
clone()
make a hard copy of the termsLiteral
cloneNS(Atom newnamespace)
clone in another namespacestatic java.util.Iterator<Unifier>
createUnifIterator(Unifier... unifs)
creates an iterator for a list of unifiersorg.w3c.dom.Element
getAsDOM(org.w3c.dom.Document document)
get as XMLLogicalFormula
getLHS()
gets the LHS of this ExpressionLogExpr.LogicalOp
getOp()
gets the Operation of this ExpressionLogicalFormula
getRHS()
gets the RHS of this Expressionjava.util.Iterator<Unifier>
logicalConsequence(Agent ag, Unifier un)
logicalConsequence checks whether one particular predicate is a logical consequence of the belief base.static LogicalFormula
parseExpr(java.lang.String sExpr)
returns some LogicalFormula that can be evaluatedMethods inherited from class jason.asSyntax.BinaryStructure
toString
Methods inherited from class jason.asSyntax.Structure
addTerm, addTerms, addTerms, calcHashCode, countVars, delTerm, equals, getArity, getSingletonVars, getTerm, getTerms, getTermsSize, hasTerm, hasVar, isAtom, isGround, isStructure, isUnary, makeTermsAnnon, makeVarsAnnon, makeVarsAnnon, parse, setTerm, setTerms, subsumes, varToReplace
Methods inherited from class jason.asSyntax.Atom
compareTo, getFunctor, getNS
Methods inherited from class jason.asSyntax.Literal
addAnnot, addAnnots, addAnnots, addSource, addSourceInfoAsAnnots, canBeAddedInBB, clearAnnots, copy, delAnnot, delAnnots, delAnnots, delSource, delSources, equalsAsStructure, forceFullLiteralImpl, getAnnot, getAnnots, getAnnots, getAsJson, getAsListOfTerms, getPredicateIndicator, getSources, getTermsArray, hasAnnot, hasAnnot, hasSource, hasSource, hasSubsetAnnot, hasSubsetAnnot, importAnnots, isLiteral, negated, newFromListOfTerms, newFunctor, noSource, parseLiteral, setAnnots, setNegated, subjectToBUF
Methods inherited from class jason.asSyntax.DefaultTerm
getCyclicVar, getErrorMsg, getSrcInfo, hashCode, isArithExpr, isCyclicTerm, isInternalAction, isList, isMap, isNumeric, isPlanBody, isPred, isRule, isSet, isString, isUnnamedVar, isVar, resetHashCodeCache, setSrcInfo
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Comparable
compareTo
Methods inherited from interface jason.asSyntax.Term
countVars, equals, getCyclicVar, getSrcInfo, hasVar, isArithExpr, isAtom, isCyclicTerm, isGround, isInternalAction, isList, isLiteral, isMap, isNumeric, isPlanBody, isPred, isRule, isSet, isString, isStructure, isUnnamedVar, isVar, setSrcInfo, subsumes
Methods inherited from interface jason.util.ToJson
getAsJson, getAsJsonStr
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
- Constant Field Values
-
logger
private static java.util.logging.Logger logger -
EMPTY_UNIF_LIST
-
op
-
-
Constructor Details
-
LogExpr
-
LogExpr
-
-
Method Details
-
getLHS
gets the LHS of this Expression- Overrides:
getLHS
in classBinaryStructure
-
getRHS
gets the RHS of this Expression- Overrides:
getRHS
in classBinaryStructure
-
logicalConsequence
Description copied from class:Literal
logicalConsequence checks whether one particular predicate is a logical consequence of the belief base. Returns an iterator for all unifiers that are logCons.- Specified by:
logicalConsequence
in interfaceLogicalFormula
- Overrides:
logicalConsequence
in classLiteral
-
createUnifIterator
creates an iterator for a list of unifiers -
parseExpr
returns some LogicalFormula that can be evaluated -
capply
Description copied from interface:Term
clone and applies together (and faster than clone and then apply) -
clone
make a hard copy of the terms -
cloneNS
Description copied from interface:Term
clone in another namespace -
getOp
gets the Operation of this Expression -
getAsDOM
public org.w3c.dom.Element getAsDOM(org.w3c.dom.Document document)get as XML- Specified by:
getAsDOM
in interfaceToDOM
- Overrides:
getAsDOM
in classBinaryStructure
-