jtp.disp
Class AbstractRelationBasedBCReasoner
java.lang.Object
|
+--jtp.disp.AbstractRelationBasedReasoner
|
+--jtp.disp.AbstractRelationBasedBCReasoner
- All Implemented Interfaces:
- Reasoner, RelationBasedBCReasoner, RelationBasedReasoner, Serializable
- Direct Known Subclasses:
- Equals, EquivalenceDemonstrator, EvaluableFunctionReasoner, ForIn, GetSetof, InEqual, jtp.func.NumberComparator, Unprovable
- public abstract class AbstractRelationBasedBCReasoner
- extends jtp.disp.AbstractRelationBasedReasoner
- implements RelationBasedBCReasoner
- See Also:
- Serialized Form
Method Summary |
boolean |
acceptable(Object o)
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 |
relation
protected Symbol relation
arity
protected int arity
polarity
protected int polarity
AbstractRelationBasedBCReasoner
public AbstractRelationBasedBCReasoner(String relation,
int arity,
int polarity)
AbstractRelationBasedBCReasoner
public AbstractRelationBasedBCReasoner(Symbol relation,
int arity,
int polarity)
acceptable
public boolean acceptable(Object o)
- 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:
- Literals,
- have = as their relation predicate,
- 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:
RelationBasedReasoner.POSITIVE
- for literals that are not negated,
RelationBasedReasoner.NEGATIVE
- for literals that are negated,
RelationBasedReasoner.BOTH
- if the reasoner can handle literals of any polarity.
- Specified by:
getPolarity
in interface RelationBasedReasoner
literalAcceptable
protected boolean literalAcceptable(Literal lit)