CSCE 434 Lecture 40

From Notes
Jump to navigation Jump to search

« previous | Monday, December 2, 2013 | next »

End Exam 2 content


Data Flow Framework

  1. Semilattice that includes a domain of values and a meet (confluence) operator
  2. Family of functions closed under composition
  3. Direction (forward or backward)

Partial ordering such that for .


Semilattice

Pair , where

  • is a nonempty set of values
  • is a binary meet operator on such that for all ,
    • (idempotent)
    • (commutative)
    • (associative)


Top element , such that for all , .

Optionally a bottom element , such that for all , .

Example: Reaching Definitions

, where is the set of all defs in the program.

, where and are sets of defs in representing GEN and KILL sets, respectively.

Meet operator is union ().


Example: Available Expressions

, where is the set of all expressions computed by program.

, where and are sets of defs in representing GEN and KILL sets, respectively.

Meet operator is intersection ().

Example: Constant Propagation

Variables in a program can be one of undefined, nonconstant, or constant.

Transfer functions are quite complicated, but here's the gist:

const val nonconst unknown
const val c == d ? c : nonconst nonconst
nonconst nonconst nonconst nonconst
unknown nonconst unknown


Monotonicity and Distributivity

A framework is monotone if and only if

  • implies for all and all , or equivalently
  • for all and all .


is distributive if and only if

for all and

Distributivity implies monotonicity.