joeq.Compiler.Dataflow
Class WorklistSolver

java.lang.Object
  extended by joeq.Compiler.Dataflow.Solver
      extended by joeq.Compiler.Dataflow.WorklistSolver
Direct Known Subclasses:
PriorityQueueSolver, SortedSetSolver

public abstract class WorklistSolver
extends Solver

WorklistSolver

Version:
$Id: WorklistSolver.java 2298 2005-08-24 01:34:10Z cunkel $
Author:
John Whaley

Field Summary
protected  Collection boundaries
          The boundary locations.
protected  jwutil.graphs.Navigator graphNavigator
          Navigator to navigate the graph of locations.
 
Fields inherited from class joeq.Compiler.Dataflow.Solver
dataflowValues, factory, problem
 
Constructor Summary
protected WorklistSolver()
           
protected WorklistSolver(jwutil.collections.MapFactory f)
           
 
Method Summary
 Iterator boundaryLocations()
          Returns an iteration of all boundary locations.
protected  Collection getPredecessors(Object c)
          Get the predecessor locations of the given location.
protected  Collection getSuccessors(Object c)
          Get the successor locations of the given location.
protected abstract  boolean hasNext()
          Returns true if the worklist is not empty, false otherwise.
 void initialize(Problem p, jwutil.graphs.Graph graph)
          Initializes the solver to prepare to solve the dataflow problem on the given graph.
protected abstract  void initializeWorklist()
          (Re-)initialize the worklist.
protected abstract  Object pull()
          Pull the next location off of the worklist.
protected abstract  void pushAll(Collection c)
          Push all of the given locations onto the worklist.
 void solve()
          Solves this dataflow problem.
 
Methods inherited from class joeq.Compiler.Dataflow.Solver
allLocations, compareResults, direction, dumpResults, getDataflowValue, initializeDataflowValueMap, reset
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

graphNavigator

protected jwutil.graphs.Navigator graphNavigator
Navigator to navigate the graph of locations.


boundaries

protected Collection boundaries
The boundary locations.

Constructor Detail

WorklistSolver

protected WorklistSolver(jwutil.collections.MapFactory f)

WorklistSolver

protected WorklistSolver()
Method Detail

getPredecessors

protected Collection getPredecessors(Object c)
Get the predecessor locations of the given location.


getSuccessors

protected Collection getSuccessors(Object c)
Get the successor locations of the given location.


initializeWorklist

protected abstract void initializeWorklist()
(Re-)initialize the worklist.


hasNext

protected abstract boolean hasNext()
Returns true if the worklist is not empty, false otherwise.


pull

protected abstract Object pull()
Pull the next location off of the worklist.


pushAll

protected abstract void pushAll(Collection c)
Push all of the given locations onto the worklist.


boundaryLocations

public Iterator boundaryLocations()
Description copied from class: Solver
Returns an iteration of all boundary locations.

Specified by:
boundaryLocations in class Solver

initialize

public void initialize(Problem p,
                       jwutil.graphs.Graph graph)
Description copied from class: Solver
Initializes the solver to prepare to solve the dataflow problem on the given graph.

Overrides:
initialize in class Solver

solve

public void solve()
Description copied from class: Solver
Solves this dataflow problem.

Specified by:
solve in class Solver


Copyright © 2001-2008 John Whaley. All Rights Reserved.