JTP API Documentation

jtp.disp
Class AbstractRelationBasedFCReasoner

java.lang.Object
  |
  +--jtp.disp.AbstractRelationBasedReasoner
        |
        +--jtp.disp.AbstractRelationBasedFCReasoner
All Implemented Interfaces:
Reasoner, RelationBasedFCReasoner, RelationBasedReasoner, Serializable
Direct Known Subclasses:
BlendingRuleAction, EquivalenceEnforcer

public abstract class AbstractRelationBasedFCReasoner
extends jtp.disp.AbstractRelationBasedReasoner
implements RelationBasedFCReasoner

See Also:
Serialized Form

Field Summary
protected  int arity
           
protected  int polarity
           
protected  Symbol relation
           
 
Fields inherited from interface jtp.disp.RelationBasedReasoner
ANY_ARITY, BOTH, NEGATIVE, POSITIVE
 
Constructor Summary
AbstractRelationBasedFCReasoner(String relation, int arity, int polarity)
           
AbstractRelationBasedFCReasoner(Symbol relation, int arity, int polarity)
           
 
Method Summary
 boolean acceptable(Object rs)
          decides if the goal is suitable for being processed by this reasoner.
 int getArity()
          returns the "arity" of literals that are appropriate for this reasoner.
 int getPolarity()
          returns the polarity of literals that are appropriate for this reasoner.
 Symbol getRelation()
          returns the relation symbol of literals that are appropriate for this reasoner.
protected  boolean literalAcceptable(Literal lit)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface jtp.disp.RelationBasedReasoner
getArity, getPolarity, getRelation
 
Methods inherited from interface jtp.Reasoner
process
 

Field Detail

relation

protected Symbol relation

arity

protected int arity

polarity

protected int polarity
Constructor Detail

AbstractRelationBasedFCReasoner

public AbstractRelationBasedFCReasoner(String relation,
                                       int arity,
                                       int polarity)

AbstractRelationBasedFCReasoner

public AbstractRelationBasedFCReasoner(Symbol relation,
                                       int arity,
                                       int polarity)
Method Detail

acceptable

public boolean acceptable(Object rs)
Description copied from interface: Reasoner
decides if the goal is suitable for being processed by this reasoner. This method should be fast; if there are doubts as to whether a goal is acceptable, and it looks like determining it might take some time, the method should return true and let the process method figure it out.

Example. Many reasoners only process literals with certain predicates and arity. These reasoners will use those criteria to determine acceptability, for example a reasoner dealing with equality could accept goals that are:

  1. Literals,
  2. have = as their relation predicate,
  3. have exactly two arguments.

Specified by:
acceptable in interface Reasoner
Returns:
true if the goal is suitable for this reasoner, false otherwise.

getRelation

public Symbol getRelation()
Description copied from interface: RelationBasedReasoner
returns the relation symbol of literals that are appropriate for this reasoner.

Specified by:
getRelation in interface RelationBasedReasoner
Returns:
the relation symbol of literals that are appropriate for this reasoner.

getArity

public int getArity()
Description copied from interface: RelationBasedReasoner
returns the "arity" of literals that are appropriate for this reasoner. Arity is the number of parameters of the literal. Return RelationBasedReasoner.ANY_ARITY for reasoners that are not limited to a certain arity.

Specified by:
getArity in interface RelationBasedReasoner
Returns:
the "arity" of literals that are appropriate for this reasoner.

getPolarity

public int getPolarity()
Description copied from interface: RelationBasedReasoner
returns the polarity of literals that are appropriate for this reasoner. Polarity can be one of the following:
  1. RelationBasedReasoner.POSITIVE - for literals that are not negated,
  2. RelationBasedReasoner.NEGATIVE - for literals that are negated,
  3. RelationBasedReasoner.BOTH - if the reasoner can handle literals of any polarity.

Specified by:
getPolarity in interface RelationBasedReasoner

literalAcceptable

protected boolean literalAcceptable(Literal lit)

JTP API Documentation