joeq.Compiler.Dataflow
Class IterativeSolver

java.lang.Object
  extended by joeq.Compiler.Dataflow.Solver
      extended by joeq.Compiler.Dataflow.IterativeSolver

public class IterativeSolver
extends Solver

Solves a dataflow problem using a iterative technique. Successively iterates over the locations in the graph in a given order until there are no more changes.

Version:
$Id: IterativeSolver.java 1931 2004-09-22 22:17:47Z joewhaley $
Author:
John Whaley

Field Summary
protected  Collection boundaries
          The boundary locations.
protected  boolean change
          Change flag, set to true if we need to iterate more times.
protected  jwutil.graphs.Navigator graphNavigator
          Navigator to navigate the graph of locations.
protected  List traversalOrder
          The order in which the locations are to be traversed.
 
Fields inherited from class joeq.Compiler.Dataflow.Solver
dataflowValues, factory, problem
 
Constructor Summary
IterativeSolver()
           
IterativeSolver(jwutil.collections.MapFactory f)
           
 
Method Summary
 Iterator allLocations()
          Returns an iteration of all graph locations.
 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  Iterator getTraversalOrder()
          Returns an iteration of the order in which the locations are to be traversed.
 void initialize(Problem p, jwutil.graphs.Graph graph)
          Initializes the solver to prepare to solve the dataflow problem on the given graph.
 void initialize(Problem p, jwutil.graphs.Graph graph, List order)
          Initializes this solver with the given dataflow problem, graph, and traversal order.
 void solve()
          Solves this dataflow problem.
 
Methods inherited from class joeq.Compiler.Dataflow.Solver
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

traversalOrder

protected List traversalOrder
The order in which the locations are to be traversed.


boundaries

protected Collection boundaries
The boundary locations.


graphNavigator

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


change

protected boolean change
Change flag, set to true if we need to iterate more times.

Constructor Detail

IterativeSolver

public IterativeSolver(jwutil.collections.MapFactory f)

IterativeSolver

public IterativeSolver()
Method Detail

getTraversalOrder

protected Iterator getTraversalOrder()
Returns an iteration of the order in which the locations are to be traversed.


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.


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

initialize

public void initialize(Problem p,
                       jwutil.graphs.Graph graph,
                       List order)
Initializes this solver with the given dataflow problem, graph, and traversal order.

See Also:
Solver.initialize(joeq.Compiler.Dataflow.Problem, jwutil.graphs.Graph)

allLocations

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

Specified by:
allLocations in class Solver

boundaryLocations

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

Specified by:
boundaryLocations 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.