forge.cfg
Class ForgeCFG

java.lang.Object
  extended by forge.cfg.ForgeCFG
All Implemented Interfaces:
ProgramElement
Direct Known Subclasses:
ForgeCFG.Impl, ForgeCFG.Spec

public abstract class ForgeCFG
extends java.lang.Object
implements ProgramElement

The CFG of a procedure.

Author:
Greg Dennis (gdennis@mit.edu)

Nested Class Summary
static class ForgeCFG.Impl
          An implementation CFG with several statements.
static class ForgeCFG.Spec
          A specification CFG containing only a single specification statement.
 
Method Summary
 void checkCFG(CFGElement element)
           
abstract  CFGStmt entry()
          Returns the entry stmt of the cfg.
 ExitStmt exit()
          Returns the exit stmt of the cfg.
static ForgeCFG.Spec generalSpecification(ForgeProcedure proc, java.util.Set<? extends ForgeVariable> mods, ForgeExpression condition)
          Returns a new unmodifiable CFG that who entry is a specification stmt with the given set of modifiables.
static ForgeCFG.Impl implementation(ForgeProcedure proc)
          Returns a new modifiable CFG that who entry is the exit stmt.
 ForgeProcedure procedure()
           
 ForgeProgram program()
          Returns the program to which this element belongs.
static ForgeCFG.Spec specification(ForgeProcedure proc, java.util.Set<GlobalVariable> globals, ForgeExpression condition)
          Returns a new unmodifiable CFG that who entry is a specification stmt that modifies the union of the given globals and output parameters and with the given condition.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

implementation

public static ForgeCFG.Impl implementation(ForgeProcedure proc)
Returns a new modifiable CFG that who entry is the exit stmt.


specification

public static ForgeCFG.Spec specification(ForgeProcedure proc,
                                          java.util.Set<GlobalVariable> globals,
                                          ForgeExpression condition)
Returns a new unmodifiable CFG that who entry is a specification stmt that modifies the union of the given globals and output parameters and with the given condition.


generalSpecification

public static ForgeCFG.Spec generalSpecification(ForgeProcedure proc,
                                                 java.util.Set<? extends ForgeVariable> mods,
                                                 ForgeExpression condition)
Returns a new unmodifiable CFG that who entry is a specification stmt with the given set of modifiables. The modifiables must meet the following constraint: outs - ins in mods in outs + globals


procedure

public final ForgeProcedure procedure()

program

public final ForgeProgram program()
Description copied from interface: ProgramElement
Returns the program to which this element belongs.

Specified by:
program in interface ProgramElement

entry

public abstract CFGStmt entry()
Returns the entry stmt of the cfg.


exit

public final ExitStmt exit()
Returns the exit stmt of the cfg.


checkCFG

public void checkCFG(CFGElement element)
Throws:
java.lang.IllegalArgumentException - - if elem does not belong to this cfg
java.lang.NullPointerException - - if the given elem is null

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object