Prolog Cafe v1.2

jp.ac.kobe_u.cs.prolog.lang
Class CPFStack

java.lang.Object
  extended by jp.ac.kobe_u.cs.prolog.lang.CPFStack
All Implemented Interfaces:
java.io.Serializable

public class CPFStack
extends java.lang.Object
implements java.io.Serializable

Choice point frame stack.
The CPFStack class represents a stack of choice point frames.
Each choice point frame has the following fields:

See Also:
Serialized Form

Field Summary
protected  jp.ac.kobe_u.cs.prolog.lang.CPFEntry[] buffer
          An array of choice point frames.
protected  Prolog engine
          Holds the Prolog engine that this CPFStack belongs to.
protected  int maxContents
          Maximum size of enties.
protected  int top
          the top index of this CPFStack.
 
Constructor Summary
CPFStack(Prolog _engine)
          Constructs a new choice point frame stack.
CPFStack(Prolog _engine, int n)
          Constructs a new choice point frame stack with the given size.
 
Method Summary
 void create(Term[] args, Predicate p)
          Create a new choice point frame.
 void cut(int i)
          Discards all choice points after the value of i.
 void delete()
          Discards the top of choice points.
 void deleteAll()
          Discards all choice points.
 boolean empty()
          Tests if this stack has no entry.
 Term[] getArgs()
          Returns the arguments of current choice point frame.
 int getB0()
          Returns the cut point of current choice point frame.
 Predicate getBP()
          Returns the next clause of current choice point frame.
 Predicate getCont()
          Returns the continuation goal of current choice point frame.
 long getTimeStamp()
          Returns the time stamp of current choice point frame.
 int getTR()
          Returns the trail pointer of current choice point frame.
 void init()
          Discards all choice points.
 int max()
          Returns the value of maxContents.
 void setB0(int i)
          Sets the cut point of current choice point frame.
 void setBP(Predicate p)
          Sets the next clause of current choice point frame.
 void setTimeStamp(long t)
          Sets the time stamp of current choice point frame.
 void setTR(int i)
          Sets the trail pointer of current choice point frame.
 void show()
          Shows the contents of this CPFStack.
 int top()
          Returns the value of top.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

maxContents

protected int maxContents
Maximum size of enties. Initial size is 20000.


buffer

protected jp.ac.kobe_u.cs.prolog.lang.CPFEntry[] buffer
An array of choice point frames.


top

protected int top
the top index of this CPFStack.


engine

protected Prolog engine
Holds the Prolog engine that this CPFStack belongs to.

Constructor Detail

CPFStack

public CPFStack(Prolog _engine)
Constructs a new choice point frame stack.


CPFStack

public CPFStack(Prolog _engine,
                int n)
Constructs a new choice point frame stack with the given size.

Method Detail

create

public void create(Term[] args,
                   Predicate p)
Create a new choice point frame.

Parameters:
args - arguments
p - a continuation goal

deleteAll

public void deleteAll()
Discards all choice points.


cut

public void cut(int i)
Discards all choice points after the value of i.


delete

public void delete()
Discards the top of choice points.


init

public void init()
Discards all choice points.


empty

public boolean empty()
Tests if this stack has no entry.


top

public int top()
Returns the value of top.

See Also:
top

max

public int max()
Returns the value of maxContents.

See Also:
maxContents

getArgs

public Term[] getArgs()
Returns the arguments of current choice point frame.


getCont

public Predicate getCont()
Returns the continuation goal of current choice point frame.


getTimeStamp

public long getTimeStamp()
Returns the time stamp of current choice point frame.


setTimeStamp

public void setTimeStamp(long t)
Sets the time stamp of current choice point frame.


getBP

public Predicate getBP()
Returns the next clause of current choice point frame.


setBP

public void setBP(Predicate p)
Sets the next clause of current choice point frame.


getTR

public int getTR()
Returns the trail pointer of current choice point frame.


setTR

public void setTR(int i)
Sets the trail pointer of current choice point frame.


getB0

public int getB0()
Returns the cut point of current choice point frame.


setB0

public void setB0(int i)
Sets the cut point of current choice point frame.


show

public void show()
Shows the contents of this CPFStack.


Prolog Cafe v1.2

Copyright (C) 1997-2008 M.BANBARA and N.TAMURA