Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

alice.tuprolog
Class RTContext  view RTContext download RTContext.java

java.lang.Object
  extended byalice.tuprolog.RTContext
All Implemented Interfaces:
java.io.Serializable

final class RTContext
extends java.lang.Object
implements java.io.Serializable

runtime execution context during a demonstration.

it keeps track of information necessary to do a correct renaming of variables (time) and a correct unification/deunification of terms (mark)

it manages information about current demonstrating goal, current choice explored, open choices


Field Summary
 alice.util.LinkedList compatibleGoals
          clause compatible with goal list
 GoalInfo currentGoal
          current goal
 boolean evalState
          evaluation state: false -> not demonstrable goal
 alice.util.LinkedList goalsToEval
          goals to execute list
 int mark
           
 int nCompatibleGoals
           
 int nGoalsToEval
           
 int nOpenTermsExecuted
          number of choices not yet explored
 int nTermsExecuted
          number of choices explored
(package private)  alice.util.LinkedList sDBTS
          dbase before goal evaluation - it's a list of assert and retract ops done before
 Term startGoal
          starting goal
 int startLevel
          starting level, time and mark
 int startMark
          starting level, time and mark
 int startTime
          starting level, time and mark
 alice.util.LinkedList termsExecuted
          terms executed list
 int time
           
 
Constructor Summary
(package private) RTContext()
           
 
Method Summary
 void cut()
          cuts current SLD tree
 boolean existChoice()
          returns true if at least other solution path exists
 Term getRenamedTermCopy(Term t)
          gets a copy of a term renaming the vars starting from current time index
 boolean loadChoice()
          gets the first open alternatives if exist and try to unify with current goal
 void loadFGoal()
          fetches next goal to be executed
 void loadStatus()
          loads the time and mark index of current goal
 void loadTGoal()
          fetches next goal from executed goal list (backtrack phase)
 void saveFGoal()
          saves current goal to goals to be executed list
 void saveTGoal()
          saves current goal to executed goals list
 void setGoal(Term g)
          sets current goal
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sDBTS

alice.util.LinkedList sDBTS
dbase before goal evaluation - it's a list of assert and retract ops done before


startGoal

public Term startGoal
starting goal


currentGoal

public GoalInfo currentGoal
current goal


startLevel

public int startLevel
starting level, time and mark


startTime

public int startTime
starting level, time and mark


startMark

public int startMark
starting level, time and mark


time

public int time

mark

public int mark

evalState

public boolean evalState
evaluation state: false -> not demonstrable goal


compatibleGoals

public alice.util.LinkedList compatibleGoals
clause compatible with goal list


nCompatibleGoals

public int nCompatibleGoals

goalsToEval

public alice.util.LinkedList goalsToEval
goals to execute list


nGoalsToEval

public int nGoalsToEval

termsExecuted

public alice.util.LinkedList termsExecuted
terms executed list


nTermsExecuted

public int nTermsExecuted
number of choices explored


nOpenTermsExecuted

public int nOpenTermsExecuted
number of choices not yet explored

Constructor Detail

RTContext

RTContext()
Method Detail

saveFGoal

public void saveFGoal()
saves current goal to goals to be executed list


loadFGoal

public void loadFGoal()
fetches next goal to be executed


saveTGoal

public void saveTGoal()
saves current goal to executed goals list


loadTGoal

public void loadTGoal()
fetches next goal from executed goal list (backtrack phase)


setGoal

public void setGoal(Term g)
sets current goal


cut

public void cut()
cuts current SLD tree

cuts every open alternative of subgoals, empty the open alternatives list


loadStatus

public void loadStatus()
loads the time and mark index of current goal


loadChoice

public boolean loadChoice()
gets the first open alternatives if exist and try to unify with current goal


existChoice

public boolean existChoice()
returns true if at least other solution path exists


getRenamedTermCopy

public Term getRenamedTermCopy(Term t)
gets a copy of a term renaming the vars starting from current time index

VERY IMPORTANT: in order to get a correct renaming process, time count is updated reflecting eventually new variables encountered in the term to be renamed