CSCE 434 Lecture 40
Jump to navigation
Jump to search
for all and
« previous | Monday, December 2, 2013 | next »
End Exam 2 content
Data Flow Framework
- Semilattice that includes a domain of values and a meet (confluence) operator
- Family of functions closed under composition
- 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
Distributivity implies monotonicity.