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

Quick Search    Search Deep

Compil3r.Dataflow
Class Problem  view Problem download Problem.java

java.lang.Object
  extended byCompil3r.Dataflow.Problem
Direct Known Subclasses:
ReachingDefs

public abstract class Problem
extends java.lang.Object

Problem

Version:
$Id: Problem.java,v 1.1 2003/06/17 02:37:51 joewhaley Exp $

Constructor Summary
Problem()
           
 
Method Summary
 Fact apply(TransferFunction tf, Fact f)
          Applies the transfer function to the given dataflow value, yielding another dataflow value.
abstract  Fact boundary()
          Returns the boundary value for this dataflow problem.
 TransferFunction closure(TransferFunction tf)
          Returns the closure of the given transfer function.
 boolean compare(Fact f1, Fact f2)
          Compares two dataflow facts, returning true if they are equal and false otherwise.
 TransferFunction compose(TransferFunction tf1, TransferFunction tf2)
          Returns the composition of two transfer functions.
abstract  boolean direction()
          Returns true if this is a forward dataflow problem, false if it is a backward dataflow problem.
abstract  TransferFunction getTransferFunction(java.lang.Object e)
          Returns the transfer function for the given code element.
 void initialize(Util.Graphs.Graph g)
          Performs necessary initialization for this dataflow problem.
abstract  Fact interior()
          Returns the value that the interior points should be initialized to.
 Fact merge(Fact f1, Fact f2)
          Combines two dataflow values, returning a new value that is the confluence of the two.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Problem

public Problem()
Method Detail

initialize

public void initialize(Util.Graphs.Graph g)
Performs necessary initialization for this dataflow problem.


direction

public abstract boolean direction()
Returns true if this is a forward dataflow problem, false if it is a backward dataflow problem.


boundary

public abstract Fact boundary()
Returns the boundary value for this dataflow problem. For a forward problem, this is the value at the entrypoint, whereas for a backward problem, this is the value at the exitpoint.


interior

public abstract Fact interior()
Returns the value that the interior points should be initialized to.


getTransferFunction

public abstract TransferFunction getTransferFunction(java.lang.Object e)
Returns the transfer function for the given code element.


apply

public Fact apply(TransferFunction tf,
                  Fact f)
Applies the transfer function to the given dataflow value, yielding another dataflow value.


compare

public boolean compare(Fact f1,
                       Fact f2)
Compares two dataflow facts, returning true if they are equal and false otherwise.


merge

public Fact merge(Fact f1,
                  Fact f2)
Combines two dataflow values, returning a new value that is the confluence of the two.


compose

public TransferFunction compose(TransferFunction tf1,
                                TransferFunction tf2)
Returns the composition of two transfer functions. The default implementation simply returns a transfer function that applies each of the transfer functions in turn.


closure

public TransferFunction closure(TransferFunction tf)
Returns the closure of the given transfer function. The closure is a transfer function that is equivalent to composing the given transfer function with itself repeatedly until the value stablizes. (A monotone lattice with finite descending chains guarantees this.)