|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjdrew.oo.td.BackwardReasoner.GoalList
public class BackwardReasoner.GoalList
GoalList - contains a list of Goals and is attached to a specific Goal which is called its parent. If and when a Goal in the list becomes solved, or partially solved, the effect is to bind variables in the atomic formula. These bindings are immediately applied to the sibling Goals in this SubGoalList. They may also be propogated to the parent Goal, by calling subGoalListSolved() on the parent when the parent is attached to this SubGoalList. By default, this call must be done by the programmmer, but the default behaviour can be set to PROPAGATE_FULLY_SOLVED, which changes it so that subGoalSolved is called on the parent when the SubGoalList is fully solved. The default behaviour can also be set to PROPAGATE_EAGERLY which will propagate eagerly: subGoalSolved is called automatically whenever a GoalList becomes more fully solved by the solution of one more of its member Goals.
Because a Goal may be attached to a failed SubGoalList, but other SubGoalLists are still available for it, it is important to be able undo the effects of this failed SubGoalList on the Goal, and consequently effects that have may been propagated throughout the BackwardReasoner. Thus each Goal and each GoalList has a backup facility that makes it possible to retrieve a previous version, replacing the old values the variable bindings. In the case of the GoalList, the backup facility also retrieves a records of what member Goals have been solved. The backup facility is used through the createBackup() and restoreBackup() routines. Thus backups are done manually, not automatically, and are based on a stack; N calls to createBackup() followed by M calls to restoreBackup(), when N<=M, will restore to the point when N-M call to createBackup() was made. If M>N, an exception is thrown. (We may consider automatic backups through the tree but the problem is that backups need to be synchronized so that the tree is brought back to a consistent overall state. This is also the reason why propagation from GoalLists to Goals is not automatic by default. One can keep the effects of changes to the Clause tree local in a GoalList until that GoalList is fully solved, and only then propagate it. This removes the need to undo the results of propagating partially solved GoalLists through the tree.)
Title: OO jDREW
Description: A deductive reasoning engine for Object-Oriented Knowledge Representation in OO RuleML
Copyright: Copyright (c) 2003
Company: National Research Council of Canada
| Field Summary | |
|---|---|
int |
atomCount
|
Term[] |
atoms
|
boolean |
hasVariableNames
|
BackwardReasoner.Goal[] |
memberGoals
|
BackwardReasoner.Goal |
parent
|
java.util.Hashtable |
varBindings
|
int |
varCount
|
java.lang.String[] |
variableNames
|
| Method Summary | |
|---|---|
void |
createBackup()
|
BackwardReasoner.Goal |
firstOpenGoal()
|
Term |
getAtom(int idx)
|
java.lang.String[] |
getVariableNames()
|
BackwardReasoner.Goal |
head()
|
void |
propagateBindingsToParent()
|
void |
purgeBackup()
|
void |
restoreBackup()
|
java.lang.String |
toString()
Used to display the Proof Tree in the GUI |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public java.util.Hashtable varBindings
public int varCount
public java.lang.String[] variableNames
public boolean hasVariableNames
public int atomCount
public Term[] atoms
public BackwardReasoner.Goal parent
public BackwardReasoner.Goal[] memberGoals
| Method Detail |
|---|
public void propagateBindingsToParent()
public java.lang.String toString()
toString in class java.lang.Objectpublic BackwardReasoner.Goal firstOpenGoal()
public BackwardReasoner.Goal head()
public Term getAtom(int idx)
idx - int
public void createBackup()
public void restoreBackup()
public void purgeBackup()
public java.lang.String[] getVariableNames()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||