org.kahina.lp.behavior
Class LogicProgrammingTreeBehavior

java.lang.Object
  extended by org.kahina.core.behavior.KahinaBehavior<KahinaTree>
      extended by org.kahina.core.behavior.KahinaTreeBehavior
          extended by org.kahina.lp.behavior.LogicProgrammingTreeBehavior
All Implemented Interfaces:
KahinaListener
Direct Known Subclasses:
TraleSLDTreeBehavior

public class LogicProgrammingTreeBehavior
extends KahinaTreeBehavior


Field Summary
protected  List<TreeAutomaton> creepPoints
           
protected  List<TreeAutomaton> failPoints
           
protected  int lastActiveID
           
protected  Map<Integer,Integer> newStepIDByLastStepID
           
protected  List<TreeAutomaton> primaryBreakpoints
           
protected  List<TreeAutomaton> primaryWarnPoints
           
protected  List<TreeAutomaton> secondaryBreakpoints
           
protected  KahinaTree secondaryTree
           
protected  List<TreeAutomaton> secondaryWarnPoints
           
protected  List<TreeAutomaton> skipPoints
           
protected  int stepBeingRedone
           
 
Fields inherited from class org.kahina.core.behavior.KahinaBehavior
kahina, object
 
Constructor Summary
LogicProgrammingTreeBehavior(KahinaTree tree, KahinaInstance<?,?,?> kahina, KahinaTree secondaryTree)
           
 
Method Summary
 void breakpointCheck(int stepID)
          checks for breakpoint matches caused by adding or modifying the step at stepID; causes events to be fired in the case of matches
 void compileCreepPoints()
           
 void compileFailPoints()
           
 void compilePrimaryBreakpoints()
           
 void compilePrimaryWarnPoints()
           
 void compileSecondaryBreakpoints()
           
 void compileSecondaryWarnPoints()
           
 void compileSkipPoints()
           
 void exceptionBreakpointCheck(int stepID)
          checks for breakpoint matches caused by exception of the step at stepID; causes events to be fired in the case of matches
 void failureBreakpointCheck(int stepID)
          checks for breakpoint matches caused by failure of the step at stepID; causes events to be fired in the case of matches
 int getMaxNodeLabelLength()
           
 void initializeCreepPoints()
          overwrite this to fill the creepPoints list with node patterns describing for which nodes the bridge is to automatically hand over a creep command to the logic programming system
 void initializeFailPoints()
          overwrite this to fill the failPoints list with node patterns describing for which nodes the bridge is to automatically hand over a fail command to the logic programming system
 void initializePrimaryBreakpoints()
          overwrite this to fill the primaryBreakpoints list with node patterns describing at detection of which node patterns in the primary step tree the bridge is to pause leaping or skipping
 void initializePrimaryWarnPoints()
           
 void initializeSecondaryBreakpoints()
          overwrite this to fill the secondaryBreakpoints list with node patterns describing at detection of which node patterns in the secondary step tree the bridge is to pause leaping or skipping
 void initializeSecondaryWarnPoints()
           
 void initializeSkipPoints()
          overwrite this to fill the skipPoints list with node patterns describing for which nodes the bridge is to hand over a skip command to the logic programming system
protected  void integrateIncomingNode(int stepID, int parentID)
          contains the logic by which the tree is formed out of callstacks called by the event processing routine for a KahinaTreeEvent of type "new step"
 void processEvent(KahinaEvent e)
          Does not react to any event by default; is overridden by implementations.
 void processLogicProgrammingBridgeEvent(LogicProgrammingBridgeEvent e)
           
 void processStepDescriptionEvent(KahinaStepDescriptionEvent e)
           
 void processStepException(int stepID)
           
 void processStepExit(int stepID, boolean deterministic)
          register and react to an incoming exit operation
 void processStepFail(int stepID)
          registers and reacts to an incoming failed step
 void processStepInformation(int stepID, String stepInfo)
          integrate incoming step detail information (usually goal descriptions) into tree called by the event processing routine for a KahinaTreeEvent of type "new step"
 void processStepRedo(int lastStepID)
          register and react to an incoming redo operation
 void processSystemEvent(KahinaSystemEvent e)
           
 void setMaxNodeLabelLength(int maxNodeLabelLength)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

secondaryTree

protected KahinaTree secondaryTree

lastActiveID

protected int lastActiveID

primaryBreakpoints

protected List<TreeAutomaton> primaryBreakpoints

secondaryBreakpoints

protected List<TreeAutomaton> secondaryBreakpoints

primaryWarnPoints

protected List<TreeAutomaton> primaryWarnPoints

secondaryWarnPoints

protected List<TreeAutomaton> secondaryWarnPoints

skipPoints

protected List<TreeAutomaton> skipPoints

creepPoints

protected List<TreeAutomaton> creepPoints

failPoints

protected List<TreeAutomaton> failPoints

stepBeingRedone

protected int stepBeingRedone

newStepIDByLastStepID

protected Map<Integer,Integer> newStepIDByLastStepID
Constructor Detail

LogicProgrammingTreeBehavior

public LogicProgrammingTreeBehavior(KahinaTree tree,
                                    KahinaInstance<?,?,?> kahina,
                                    KahinaTree secondaryTree)
Method Detail

getMaxNodeLabelLength

public int getMaxNodeLabelLength()

setMaxNodeLabelLength

public void setMaxNodeLabelLength(int maxNodeLabelLength)
Parameters:
maxNodeLabelLength - Length after which node labels are cut off. -1 for no cutoff.

initializePrimaryBreakpoints

public void initializePrimaryBreakpoints()
overwrite this to fill the primaryBreakpoints list with node patterns describing at detection of which node patterns in the primary step tree the bridge is to pause leaping or skipping


initializeSecondaryBreakpoints

public void initializeSecondaryBreakpoints()
overwrite this to fill the secondaryBreakpoints list with node patterns describing at detection of which node patterns in the secondary step tree the bridge is to pause leaping or skipping


initializePrimaryWarnPoints

public void initializePrimaryWarnPoints()

initializeSecondaryWarnPoints

public void initializeSecondaryWarnPoints()

initializeSkipPoints

public void initializeSkipPoints()
overwrite this to fill the skipPoints list with node patterns describing for which nodes the bridge is to hand over a skip command to the logic programming system


initializeCreepPoints

public void initializeCreepPoints()
overwrite this to fill the creepPoints list with node patterns describing for which nodes the bridge is to automatically hand over a creep command to the logic programming system


initializeFailPoints

public void initializeFailPoints()
overwrite this to fill the failPoints list with node patterns describing for which nodes the bridge is to automatically hand over a fail command to the logic programming system


compilePrimaryBreakpoints

public void compilePrimaryBreakpoints()

compileSecondaryBreakpoints

public void compileSecondaryBreakpoints()

compilePrimaryWarnPoints

public void compilePrimaryWarnPoints()

compileSecondaryWarnPoints

public void compileSecondaryWarnPoints()

compileSkipPoints

public void compileSkipPoints()

compileCreepPoints

public void compileCreepPoints()

compileFailPoints

public void compileFailPoints()

breakpointCheck

public void breakpointCheck(int stepID)
checks for breakpoint matches caused by adding or modifying the step at stepID; causes events to be fired in the case of matches


failureBreakpointCheck

public void failureBreakpointCheck(int stepID)
checks for breakpoint matches caused by failure of the step at stepID; causes events to be fired in the case of matches


exceptionBreakpointCheck

public void exceptionBreakpointCheck(int stepID)
checks for breakpoint matches caused by exception of the step at stepID; causes events to be fired in the case of matches


integrateIncomingNode

protected void integrateIncomingNode(int stepID,
                                     int parentID)
contains the logic by which the tree is formed out of callstacks called by the event processing routine for a KahinaTreeEvent of type "new step"


processStepInformation

public void processStepInformation(int stepID,
                                   String stepInfo)
integrate incoming step detail information (usually goal descriptions) into tree called by the event processing routine for a KahinaTreeEvent of type "new step"

Parameters:
stepID - - the step ID in the monitored logic programming system
stepInfo - - the step information to be associated with the step

processStepRedo

public void processStepRedo(int lastStepID)
register and react to an incoming redo operation

Parameters:
lastStepID - - the ID of the step being redone in the monitored logic programming system

processStepExit

public void processStepExit(int stepID,
                            boolean deterministic)
register and react to an incoming exit operation

Parameters:
stepID - - the ID of the step that exited in the monitored logic programming system
deterministic - - whether the exit was deterministic

processStepFail

public void processStepFail(int stepID)
registers and reacts to an incoming failed step

Parameters:
stepID - - the ID of the step that failed in the monitored logic programming system

processStepException

public void processStepException(int stepID)

processEvent

public void processEvent(KahinaEvent e)
Description copied from class: KahinaBehavior
Does not react to any event by default; is overridden by implementations.

Specified by:
processEvent in interface KahinaListener
Overrides:
processEvent in class KahinaBehavior<KahinaTree>

processLogicProgrammingBridgeEvent

public void processLogicProgrammingBridgeEvent(LogicProgrammingBridgeEvent e)

processSystemEvent

public void processSystemEvent(KahinaSystemEvent e)

processStepDescriptionEvent

public void processStepDescriptionEvent(KahinaStepDescriptionEvent e)