| java.lang.Object org.mandarax.reference.AbstractResolutionInferenceEngine
All known Subclasses: org.mandarax.reference.ResolutionInferenceEngine3, org.mandarax.reference.ResolutionInferenceEngine4, org.mandarax.reference.ResolutionInferenceEngine, org.mandarax.reference.ResolutionInferenceEngine2,
AbstractResolutionInferenceEngine | abstract public class AbstractResolutionInferenceEngine implements InferenceEngine,LogCategories(Code) | | Abstract superclass for inference engines based on resolution.
The design is rather modular - a selection rule, the unification
algorithm and a loop checking algorithm used are public properties of the engine and can be configured.
Note that by default we do not use loop checking, the default loop checker is the trivial do nothing
implementation.
author: Jens Dietrich version: 3.4 <7 March 05> since: 1.7.2 |
Method Summary | |
protected Clause | getGoal(Query query) Build the first goal from the query. | public LoopCheckingAlgorithm | getLoopCheckingAlgorithm() Get the loop checking algorithm. | public int | getMaxNumberOfProofSteps() Get the maximum number of proof steps that should be performed. | public int | getMaxSteps() Returns the max number of resolution steps. | protected List | getNextConstraintPool(List cp, Resolution r) Get the next constraint pool. | protected Clause | getNextGoal(Clause c1, Clause c2, Resolution r) Build the next goal, i.e., remove the unified terms, join the remaining clauses,
and apply the unifications. | public SelectionPolicy | getSelectionPolicy() Get the used selection policy. | public SemanticEvaluationPolicy | getSemanticEvaluationPolicy() Returns the semantic evaluation policy. | public UnificationAlgorithm | getUnificationAlgorithm() Get the used unification algorithm. | protected List | merge(List v1, List v2, int skip) Merge both lists, skip the element at the index "skip" in the second list. | protected void | notifyListenersOnDerivationStart(Session session, boolean debugOn) Invoke a procedural attachment. | protected void | notifyListenersOnResult(Session session, boolean debugOn) Invoke a procedural attachment. | protected Clause | performSemanticalEvaluation(Clause c, Session session, boolean logOn) Try to execute literals in the clause, and remove those literals if the
result ist true. | public void | setLoopCheckingAlgorithm(LoopCheckingAlgorithm anAlgorithm) Set a new loop checking algorithm. | public void | setMaxNumberOfProofSteps(int steps) Set the maximum number of proof steps that should be performed. | public void | setMaxSteps(int value) Sets the max number of resolution steps. | public void | setSelectionPolicy(SelectionPolicy aPolicy) Set a selection policy. | public void | setSemanticEvaluationPolicy(SemanticEvaluationPolicy policy) Sets the semantic evaluation policy. | public void | setUnificationAlgorithm(UnificationAlgorithm anAlgorithm) Set a unification algorithm. |
MAXSTEPS | public int MAXSTEPS(Code) | | |
AbstractResolutionInferenceEngine | public AbstractResolutionInferenceEngine()(Code) | | AbstractInferenceEngine constructor comment.
|
getGoal | protected Clause getGoal(Query query)(Code) | | Build the first goal from the query.
a goal Parameters: query - a query |
getMaxNumberOfProofSteps | public int getMaxNumberOfProofSteps()(Code) | | Get the maximum number of proof steps that should be performed.
If this number is reached without a result, the engine gives up.
the max number of proof steps |
getMaxSteps | public int getMaxSteps()(Code) | | Returns the max number of resolution steps.
int |
getNextConstraintPool | protected List getNextConstraintPool(List cp, Resolution r)(Code) | | Get the next constraint pool.
a list replacements Parameters: cp - the previous constraint pool Parameters: r - a resulution |
getNextGoal | protected Clause getNextGoal(Clause c1, Clause c2, Resolution r)(Code) | | Build the next goal, i.e., remove the unified terms, join the remaining clauses,
and apply the unifications.
the next goal Parameters: c1 - the first unified clause Parameters: c2 - the second unified clause Parameters: u - a resolution |
getSelectionPolicy | public SelectionPolicy getSelectionPolicy()(Code) | | Get the used selection policy.
the used policy |
getSemanticEvaluationPolicy | public SemanticEvaluationPolicy getSemanticEvaluationPolicy()(Code) | | Returns the semantic evaluation policy.
the current policy |
getUnificationAlgorithm | public UnificationAlgorithm getUnificationAlgorithm()(Code) | | Get the used unification algorithm.
the used algorithm |
merge | protected List merge(List v1, List v2, int skip)(Code) | | Merge both lists, skip the element at the index "skip" in the second list.
a new list Parameters: v1 - the first list Parameters: v2 - the second list Parameters: skip - the index to be skipped in the second list |
notifyListenersOnDerivationStart | protected void notifyListenersOnDerivationStart(Session session, boolean debugOn) throws InferenceException(Code) | | Invoke a procedural attachment.
Parameters: session - a session Parameters: debugOn - whether debug is switched on |
notifyListenersOnResult | protected void notifyListenersOnResult(Session session, boolean debugOn) throws InferenceException(Code) | | Invoke a procedural attachment.
Parameters: session - a session Parameters: debugOn - whether debug is switched on |
performSemanticalEvaluation | protected Clause performSemanticalEvaluation(Clause c, Session session, boolean logOn)(Code) | | Try to execute literals in the clause, and remove those literals if the
result ist true. E.g., the result of performing +[]-[L1,L2,2<4,L3]
would be +[]-[L1,L2,2<4,L3]. If the parameter was +[]-[L1,L2,2>4,L3],
null would be returned.
Check whether we should use the selection policy here, right now we
use a from the left to the right policy.
A rather sensible question is how to handle exceptions that occur when
evaluating literals. The approach taken here is that an exception will render
the literal as "false".
Parameters: c - a clause Parameters: session - a session Parameters: logOn - indicates whether we should log another clause |
setLoopCheckingAlgorithm | public void setLoopCheckingAlgorithm(LoopCheckingAlgorithm anAlgorithm)(Code) | | Set a new loop checking algorithm.
Parameters: lp - a loop checker |
setMaxNumberOfProofSteps | public void setMaxNumberOfProofSteps(int steps)(Code) | | Set the maximum number of proof steps that should be performed.
If this number is reached without a result, the engine gives up.
Parameters: steps - the max number of steps |
setMaxSteps | public void setMaxSteps(int value)(Code) | | Sets the max number of resolution steps.
Parameters: value - the max number of resolution steps |
setSelectionPolicy | public void setSelectionPolicy(SelectionPolicy aPolicy)(Code) | | Set a selection policy.
Parameters: aPolicy - the new selection policy |
setSemanticEvaluationPolicy | public void setSemanticEvaluationPolicy(SemanticEvaluationPolicy policy)(Code) | | Sets the semantic evaluation policy.
Parameters: policy - The policy to set |
setUnificationAlgorithm | public void setUnificationAlgorithm(UnificationAlgorithm anAlgorithm)(Code) | | Set a unification algorithm.
Parameters: anAlgorithm - the new algorithm |
|
|