code.space
Class Space

java.lang.Object
  extended by java.lang.Thread
      extended by code.space.Space
All Implemented Interfaces:
java.lang.Runnable

public class Space
extends java.lang.Thread

This class abstracts the narrowing space of a term. The class is structured as a thread with an input queue and an output queue. This thread takes a term (its computation, actually) from the input queue and places the result (its computation, actually) in an output queue.

This thread waits when the input queue is empty and/or when the output queue is full. This thread should be notified when a term is placed in the input queue and when a term is removed from the output queue.


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
private  boolean abort
           
 Term current
          Term register lent to instructions.
static int freeVar
          Maximum number of free variables in a rewrite rule.
private  boolean halt
           
protected  boolean halted
           
private  Queue inputQueue
          Set of computations.
static Space instance
           
static int lastSourceEndPos
           
static java.lang.String lastSourceFile
           
static int lastSourceStartPos
           
private  IOQueue outputQueue
           
 java.util.Stack preTerm
          Term stack register lent to computations.
 Term[] varRegister
          Uninstantiated variables registers.
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
protected Space()
           
 
Method Summary
 void abort()
           
 void register(Computation computation)
           
 void run()
           
 void setOutputQueue(IOQueue outputQueue)
           
private  void unregister()
           
 void unregister(Computation c)
           
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

freeVar

public static final int freeVar
Maximum number of free variables in a rewrite rule.

See Also:
Constant Field Values

lastSourceStartPos

public static int lastSourceStartPos

lastSourceEndPos

public static int lastSourceEndPos

lastSourceFile

public static java.lang.String lastSourceFile

preTerm

public java.util.Stack preTerm
Term stack register lent to computations.


current

public Term current
Term register lent to instructions.


varRegister

public Term[] varRegister
Uninstantiated variables registers.


inputQueue

private Queue inputQueue
Set of computations.


halt

private boolean halt

halted

protected boolean halted

instance

public static Space instance

outputQueue

private IOQueue outputQueue

abort

private boolean abort
Constructor Detail

Space

protected Space()
Method Detail

setOutputQueue

public void setOutputQueue(IOQueue outputQueue)

abort

public void abort()

register

public void register(Computation computation)

run

public void run()
Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread

unregister

private void unregister()

unregister

public void unregister(Computation c)