ubc.cs.JLog.Builtins.Goals
Class jCallNGoal

java.lang.Object
  extended by ubc.cs.JLog.Foundation.jGoal
      extended by ubc.cs.JLog.Builtins.Goals.jCallGoal
          extended by ubc.cs.JLog.Builtins.Goals.jCallNGoal
All Implemented Interfaces:
iName, iNameArity

public class jCallNGoal
extends jCallGoal


Field Summary
 
Fields inherited from class ubc.cs.JLog.Builtins.Goals.jCallGoal
callee, end_goal, unified
 
Fields inherited from class ubc.cs.JLog.Foundation.jGoal
next
 
Constructor Summary
jCallNGoal(jCompoundTerm c)
           
 
Method Summary
 int getArity()
          Returns the arity of this instance.
 boolean prove(iGoalStack goals, iGoalStack proved)
          Attempt to prove the goal represented by this jGoal.
 java.lang.String toString()
           
 
Methods inherited from class ubc.cs.JLog.Builtins.Goals.jCallGoal
getName, internal_remove, internal_restore, retry, setEndGoal
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

jCallNGoal

public jCallNGoal(jCompoundTerm c)
Method Detail

prove

public boolean prove(iGoalStack goals,
                     iGoalStack proved)
Description copied from class: jGoal
Attempt to prove the goal represented by this jGoal. 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.

Overrides:
prove in class jCallGoal
Parameters:
goals - 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).
Returns:
boolean is true if this goal ended up on proved, false otherwise.

getArity

public int getArity()
Description copied from interface: iNameArity
Returns the arity of this instance.

Specified by:
getArity in interface iNameArity
Overrides:
getArity in class jCallGoal
Returns:
int whose value is the arity of this instance.

toString

public java.lang.String toString()
Overrides:
toString in class jCallGoal