GNU Prolog for Java

gnu.prolog.vm.interpreter
Class ExecutionState

java.lang.Object
  extended by gnu.prolog.vm.interpreter.ExecutionState

public class ExecutionState
extends Object

execution state class


Field Summary
 Term[] args
          arguments
static int BACKTRACK
          instruction return code indicating need for backtracking
 Term[] environment
          current environment
 Interpreter interpreter
          current interpreter
static int JUMP
          instruction return code indicating success.
 int jumpPosition
          current position
static int NEXT
          instruction return code indicating success.
 List<Term> pushdown
          pushdown stack, used for unification and calls
static int RETURN
          instruction return code indicating success.
 BacktrackInfo startBacktrackInfo
          current backtrack info, only active on backtracking
 
Constructor Summary
ExecutionState()
           
 
Method Summary
 CallBacktrackInfo getCallBacktrackInfo(int codePosition, Term[] args, PrologCode code, CompoundTermTag tag)
          get BacktrackInfo for call instruction.
 EnterBacktrackInfo getEnterBacktrackInfo()
          get enter backtrack info
 Term getEnvironment(int environmentIndex)
          get term from environment
 LeaveBacktrackInfo getLeaveBacktrackInfo()
          get leave backtrack info
 RetryBacktrackInfo getRetryBacktrackInfo(int retryPosition)
          get BacktrackInfo for try family instructions.
 BacktrackInfo peekBacktrackInfo()
          peek backtrack info w/o popping it
 BacktrackInfo popBacktrackInfo()
          pop backtrack info from stack
 Term popPushDown()
          pop term from pushdown stack
 void pushBacktrackInfo(BacktrackInfo cbi)
          push backtrack info to stack
 void pushPushDown(Term term)
          push term to pushdown stack
 void putEnvironment(int environmentIndex, Term term)
          put term to environment
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BACKTRACK

public static final int BACKTRACK
instruction return code indicating need for backtracking

See Also:
Constant Field Values

NEXT

public static final int NEXT
instruction return code indicating success. backtrack information may or not be created

See Also:
Constant Field Values

JUMP

public static final int JUMP
instruction return code indicating success. jump to position in instruction pointer needed

See Also:
Constant Field Values

RETURN

public static final int RETURN
instruction return code indicating success. return from function needed.

See Also:
Constant Field Values

interpreter

public Interpreter interpreter
current interpreter


startBacktrackInfo

public BacktrackInfo startBacktrackInfo
current backtrack info, only active on backtracking


environment

public Term[] environment
current environment


pushdown

public List<Term> pushdown
pushdown stack, used for unification and calls


jumpPosition

public int jumpPosition
current position


args

public Term[] args
arguments

Constructor Detail

ExecutionState

public ExecutionState()
Method Detail

popBacktrackInfo

public BacktrackInfo popBacktrackInfo()
pop backtrack info from stack


peekBacktrackInfo

public BacktrackInfo peekBacktrackInfo()
peek backtrack info w/o popping it


pushBacktrackInfo

public void pushBacktrackInfo(BacktrackInfo cbi)
push backtrack info to stack


getCallBacktrackInfo

public CallBacktrackInfo getCallBacktrackInfo(int codePosition,
                                              Term[] args,
                                              PrologCode code,
                                              CompoundTermTag tag)
get BacktrackInfo for call instruction.

Parameters:
codePosition -
args -
code -
tag -
Returns:

getRetryBacktrackInfo

public RetryBacktrackInfo getRetryBacktrackInfo(int retryPosition)
get BacktrackInfo for try family instructions.

Parameters:
retryPosition -
Returns:

popPushDown

public Term popPushDown()
pop term from pushdown stack

Returns:

pushPushDown

public void pushPushDown(Term term)
push term to pushdown stack

Parameters:
term -

getEnvironment

public Term getEnvironment(int environmentIndex)
get term from environment

Parameters:
environmentIndex -
Returns:

putEnvironment

public void putEnvironment(int environmentIndex,
                           Term term)
put term to environment

Parameters:
environmentIndex -
term -

getLeaveBacktrackInfo

public LeaveBacktrackInfo getLeaveBacktrackInfo()
get leave backtrack info

Returns:

getEnterBacktrackInfo

public EnterBacktrackInfo getEnterBacktrackInfo()
get enter backtrack info

Returns:

GNU Prolog for Java