|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectubc.cs.JLog.Foundation.jGoal
ubc.cs.JLog.Terms.Goals.jQuadaryBuiltinPredicateGoal
public class jQuadaryBuiltinPredicateGoal
A very basic goal for quadary builtin predicates. It only attempts to prove once (i.e., the retry fails). It calls the prove(jQuadaryBuiltinPredicateGoal) method of the associated predicate to perform the prove.
| Field Summary | |
|---|---|
protected jQuadaryBuiltinPredicate |
predicate
|
jTerm |
term1
|
jTerm |
term2
|
jTerm |
term3
|
jTerm |
term4
|
jUnifiedVector |
unified
|
| Fields inherited from class ubc.cs.JLog.Foundation.jGoal |
|---|
next |
| Constructor Summary | |
|---|---|
jQuadaryBuiltinPredicateGoal(jQuadaryBuiltinPredicate p,
jTerm t1,
jTerm t2,
jTerm t3,
jTerm t4)
|
|
| Method Summary | |
|---|---|
int |
getArity()
Returns the arity of this instance. |
String |
getName()
Returns the name of this instance. |
void |
internal_restore(iGoalStack goals)
Combines internal_remove with a full restart and resoration of
any previous variable state. |
boolean |
prove(iGoalStack goals,
iGoalStack proved)
Attempt to prove the goal represented by this jGoal. |
boolean |
retry(iGoalStack goals,
iGoalStack proved)
Attempt to prove the goal represented by this jGoal. |
String |
toString()
|
| Methods inherited from class ubc.cs.JLog.Foundation.jGoal |
|---|
internal_remove |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected jQuadaryBuiltinPredicate predicate
public jTerm term1
public jTerm term2
public jTerm term3
public jTerm term4
public jUnifiedVector unified
| Constructor Detail |
|---|
public jQuadaryBuiltinPredicateGoal(jQuadaryBuiltinPredicate p,
jTerm t1,
jTerm t2,
jTerm t3,
jTerm t4)
| Method Detail |
|---|
public boolean prove(iGoalStack goals,
iGoalStack proved)
jGoaljGoal.
Goal must not be on either stack to prove (pop off goals stack before prove call).
Goal must place itself on the appropriate stack before returning.
proved stack if 'proved', goals stack otherwise.
Since proved doesn't pop the stack we don't need a try/catch block.
Must be called at least once before calling retry.
prove in class jGoalgoals - iGoalStack containing goals yet to be proved.proved - iGoalStack containing evaluated goals (goals
that may already be proved, or awaiting their child goals
to be proved).
boolean is true if this goal ended up on
proved, false otherwise.
public boolean retry(iGoalStack goals,
iGoalStack proved)
jGoaljGoal.
Goal must not be on either stack to retry (pop off proved stack before retry call).
Goal must place itself on the goal stack, and normally need not pop either stack.
Since retry doesn't pop the stack we don't need a try/catch block.
retry in class jGoalgoals - iGoalStack containing goals yet to be proved.proved - iGoalStack containing evaluated goals (goals
that may already be proved, or awaiting their child goals
to be proved).
boolean is true if the prover should attempt
a prove on this goal, false otherwise.public void internal_restore(iGoalStack goals)
jGoalinternal_remove with a full restart and resoration of
any previous variable state. May be called by other goals, such as a
jCutGoal. this is still located on proved stack.
internal_restore in class jGoalgoals - iGoalStack containing goals yet to be proved.public String getName()
iName
String containing name of this instance.public int getArity()
iNameArity
int whose value is the arity of this instance.public String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||