fortran-vars-0.4.0: Fortran memory model and other static analysis tools.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Language.Fortran.Vars.ConstantPropagation

Synopsis

Documentation

constantPropagationValue :: Data a => ProgramFile (Analysis a) -> ValueOf a Source #

Given a ProgramFile, return ValueOf closure, which determines whether given Expression can be evaluated statically to a constant value using constant propagation analysis.

Usage: The best approach is to create a closure first as illustrated in the following code example, so only one run of constant propragation analysis is performed for a ProgramFile.

  let cpValueOf = constantPropagationValue pf
  ...
  in
      ...
      cpVauleOf e1
      cpValueOf e2
  

type ValueOf a = Expression (Analysis a) -> CPValue Source #

ValueOf is a closure that takes an Expression and deduces its CPValue