Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## jason.asSyntax
Class Rule

    java.lang.Object
      jason.asSyntax.DefaultTerm
          jason.asSyntax.Literal
              jason.asSyntax.Atom
                  jason.asSyntax.Structure
                      jason.asSyntax.Pred
                          jason.asSyntax.LiteralImpl
                              jason.asSyntax.Rule

All Implemented Interfaces:
  LogicalFormula, Term, ToDOM, java.io.Serializable, java.lang.Cloneable, java.lang.Comparable<Term>

    public class Rule

extends LiteralImpl

A rule is a Literal (head) with a body, as in "a :- b & c".

See Also:
  Serialized Form

Field Summary

Fields inherited from class jason.asSyntax.Structure
`emptyTermArray, emptyTermList`

Fields inherited from class jason.asSyntax.Literal
`LFalse, LNeg, LPos, LTrue, predicateIndicatorCache`

Fields inherited from class jason.asSyntax.DefaultTerm
`hashCodeCache, srcInfo`

Constructor Summary
`Rule(Literal head, LogicalFormula body)`

Method Summary
`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()`
`int` | `hashCode()`
`boolean` | `hasVar(VarTerm t)`
`Literal` | `headClone()`
`boolean` | `isRule()`
`Literal` | `makeVarsAnnon(Unifier un)` replaces all variables of the term for unnamed variables (_).
`java.lang.String` | `toString()`

Methods inherited from class jason.asSyntax.LiteralImpl
`calcHashCode, canBeAddedInBB, compareTo, getErrorMsg, getPredicateIndicator, isAtom, negated, setNegated`

Methods inherited from class jason.asSyntax.Pred
`addAnnot, addAnnots, addAnnots, addSource, apply, clearAnnots, createSource, delAnnot, delAnnots, delSource, delSources, equalsAsStructure, getAnnots, getAnnots, getSources, hasAnnot, hasAnnot, hasSource, hasSource, hasSubsetAnnot, hasSubsetAnnot, importAnnots, isGround, isPred, parsePred, setAnnots, toStringAsTerm`

Methods inherited from class jason.asSyntax.Structure
`addTerm, addTerms, addTerms, delTerm, getArity, getSingletonVars, getTerm, getTerms, getTermsSize, hasTerm, isStructure, makeTermsAnnon, makeVarsAnnon, parse, setTerm, setTerms, varToReplace`

Methods inherited from class jason.asSyntax.Atom
`getFunctor`

Methods inherited from class jason.asSyntax.Literal
`copy, forceFullLiteralImpl, getAsListOfTerms, getTermsArray, isLiteral, logicalConsequence, newFromListOfTerms, parseLiteral`

Methods inherited from class jason.asSyntax.DefaultTerm
`getSrcInfo, isArithExpr, isInternalAction, isList, isNumeric, isPlanBody, 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.LogicalFormula
`logicalConsequence`

Methods inherited from interface jason.asSyntax.Term
`apply, getSrcInfo, isArithExpr, isGround, isInternalAction, isList, isLiteral, isNumeric, isPlanBody, isPred, isString, isStructure, isUnnamedVar, isVar, setSrcInfo`

Constructor Detail

### Rule

    public Rule(Literal head,
                LogicalFormula body)

Method Detail

### isRule

    public boolean isRule()

  Specified by:
    `isRule` in interface `Term`
  Overrides:
    `isRule` in class `DefaultTerm`

### equals

    public boolean equals(java.lang.Object o)

  Specified by:
    `equals` in interface `Term`
  Overrides:
    `equals` in class `LiteralImpl`

### hashCode

    public int hashCode()

  Overrides:
    `hashCode` in class `DefaultTerm`

### getBody

    public LogicalFormula getBody()

### makeVarsAnnon

    public Literal makeVarsAnnon(Unifier un)

  Description copied from class: `Literal`
  replaces all variables of the term for unnamed variables (_).

  Overrides:
    `makeVarsAnnon` in class `Pred`
  Parameters:
    `un` - is the unifier that contains the map of replacements

### clone

    public Rule clone()

  Description copied from class: `Structure`
  make a deep copy of the terms

  Specified by:
    `clone` in interface `Term`
  Overrides:
    `clone` in class `LiteralImpl`

### headClone

    public Literal headClone()

### toString

    public java.lang.String toString()

  Overrides:
    `toString` in class `LiteralImpl`

### hasVar

    public boolean hasVar(VarTerm t)

  Specified by:
    `hasVar` in interface `Term`
  Overrides:
    `hasVar` in class `Pred`

### countVars

    public void countVars(java.util.Map<VarTerm,java.lang.Integer> c)

  Specified by:
    `countVars` in interface `Term`
  Overrides:
    `countVars` in class `Pred`

### getAsDOM

    public org.w3c.dom.Element getAsDOM(org.w3c.dom.Document document)

  get as XML

  Specified by:
    `getAsDOM` in interface `ToDOM`
  Overrides:
    `getAsDOM` in class `LiteralImpl`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD