03 DFA - Course Outline Introduction Control-flow analysis...

Info iconThis preview shows pages 1–11. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Course Outline Introduction Control-flow analysis Dataflow analysis and abstract interpretation Sparse analysis Adding indirection (pointers) Adding functions Type- and constraint-based analysis Ben Hardekopf () CS 290C Program Analysis Fall 2011 1 / 80 Section Outline Dataflow Analysis (DFA) Example analyses Abstract domains and lattices Abstract semantics and transfer functions Dataflow analysis framework Complexity, precision, termination, and soundness Ben Hardekopf () CS 290C Program Analysis Fall 2011 2 / 80 First-Order Analyses First-order analyses are concerned with properties about states ; they can be determined by looking at a single configuration. A common example is value-based analysis , like the Zero/Non-Zero and the Even/Odd analyses we’ve already seen. Example Analyses Constant Propagation Range Propagation Ben Hardekopf () CS 290C Program Analysis Fall 2011 3 / 80 Constant Propagation For each node of the CFG, which variables are guaranteed to be a constant value? Program x := 5 ; z := input ; if (z > 0) then { y := x+1 } else { y := x-1 } ; z := y Ben Hardekopf () CS 290C Program Analysis Fall 2011 4 / 80 Range Propagation For each node of the CFG, map each variable to the range of values it might have at that node. (Notice that this analysis is strictly more precise than constant propagation.) Program x := 5 ; z := input ; if (z > 0) then { y := x+1 } else { y := x-1 } ; z := y Ben Hardekopf () CS 290C Program Analysis Fall 2011 5 / 80 Second-Order Analyses Second-order analyses are concerned with properties about paths ; they can be determined by looking at a sequence of configurations. Example Analyses Reaching Definitions Available Expressions Ben Hardekopf () CS 290C Program Analysis Fall 2011 6 / 80 Reaching Definitions A definition is a variable assignment. A definition “x := ...” at node A reaches node B is there is an executable path from A to B that does not redefine x . Determine for each node the set of possible reaching definitions. Program x := 4 ; y := 6 ; if (z > 0) then { x := 2 } else { x := 3 } ; z := x + y Ben Hardekopf () CS 290C Program Analysis Fall 2011 7 / 80 Available Expressions An expression such as “ x + y ” is available at node A if it is computed along every executable path to A and its operands are not redefined along those paths before reaching A. Determine for each node the set of available expressions. Program x := a+b ; y := c+d ; if (z > 0) then { a := y } else { z := y } ; r := a+b ; s := c+d Notice that unlike every other example analysis, this is a must analysis (under-approximation) rather than a may analysis (over-approximation). Ben Hardekopf () CS 290C Program Analysis Fall 2011 8 / 80 Section Outline Dataflow Analysis (DFA) Example analyses Abstract domains and lattices Abstract semantics and transfer functions Dataflow analysis framework Complexity, precision, termination, and soundness Ben Hardekopf () CS 290C Program Analysis Fall 2011 9 / 80 Abstract Domains We formalize the notion of “abstract domain” using an algebraic structure...
View Full Document

This note was uploaded on 12/27/2011 for the course CMPSC 290a taught by Professor Vandam during the Fall '09 term at UCSB.

Page1 / 127

03 DFA - Course Outline Introduction Control-flow analysis...

This preview shows document pages 1 - 11. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online