Claus Brabrand, ITU, Denmark STATIC ANALYSIS (DATA-FLOW ANALYSIS)Apr 09, 2008 Static Analysis: Data-Flow Analysis IV Claus Brabrand ITU - IT University.

Slides:



Advertisements
Similar presentations
Love Lifted Me Click here to play The slides advance automatically with the words.
Advertisements

Claus Brabrand, UFPE, Brazil Aug 11, 2010DATA-FLOW ANALYSIS Claus Brabrand ((( ))) Associate Professor, Ph.D. ((( Programming, Logic, and.
Lecture 11: Code Optimization CS 540 George Mason University.
Compilation 2011 Static Analysis Johnni Winther Michael I. Schwartzbach Aarhus University.
Course Outline Traditional Static Program Analysis –Theory Compiler Optimizations; Control Flow Graphs Data-flow Analysis – today’s class –Classic analyses.
Data-Flow Analysis Framework Domain – What kind of solution is the analysis looking for? Ex. Variables have not yet been defined – Algorithm assigns a.
School of EECS, Peking University “Advanced Compiler Techniques” (Fall 2011) Dataflow Analysis Introduction Guo, Yao Part of the slides are adapted from.
Claus Brabrand, ITU, Denmark Feb 17, 2009WHITE-BOX TESTING White-Box Testing Claus Brabrand [ ] ( “FÅP”: First-year Project Course, ITU,
Lecture 15 – Dataflow Analysis Eran Yahav 1
Lecture 02 – Structural Operational Semantics (SOS) Eran Yahav 1.
Foundations of Data-Flow Analysis. Basic Questions Under what circumstances is the iterative algorithm used in the data-flow analysis correct? How precise.
Common Sub-expression Elim Want to compute when an expression is available in a var Domain:
Claus Brabrand, ITU, Denmark Mar 23, 2009STATIC ANALYSIS (DATA-FLOW ANALYSIS) Static Analysis: Data-Flow Analysis I Claus Brabrand IT University of Copenhagen.
CS 536 Spring Global Optimizations Lecture 23.
Denotational Semantics Syntax-directed approach, generalization of attribute grammars: –Define context-free abstract syntax –Specify syntactic categories.
From last time: live variables Set D = 2 Vars Lattice: (D, v, ?, >, t, u ) = (2 Vars, µ, ;,Vars, [, Å ) x := y op z in out F x := y op z (out) = out –
Chair of Software Engineering Fundamentals of Program Analysis Dr. Manuel Oriol.
Data Flow Analysis Compiler Design Nov. 3, 2005.
4/25/08Prof. Hilfinger CS164 Lecture 371 Global Optimization Lecture 37 (From notes by R. Bodik & G. Necula)
Claus Brabrand, ITU, Denmark Feb 17, 2009WHITE-BOX TESTING White-Box Testing Claus Brabrand [ ] ( “FÅP”: First-year Project Course, ITU,
Data Flow Analysis Compiler Design October 5, 2004 These slides live on the Web. I obtained them from Jeff Foster and he said that he obtained.
Data Flow Analysis Compiler Design Nov. 8, 2005.
Prof. Fateman CS 164 Lecture 221 Global Optimization Lecture 22.
From last lecture x := y op z in out F x := y op z (in) = in [ x ! in(y) op in(z) ] where a op b =
Direction of analysis Although constraints are not directional, flow functions are All flow functions we have seen so far are in the forward direction.
Projects. Dataflow analysis Dataflow analysis: what is it? A common framework for expressing algorithms that compute information about a program Why.
U NIVERSITY OF M ASSACHUSETTS, A MHERST D EPARTMENT OF C OMPUTER S CIENCE Advanced Compilers CMPSCI 710 Spring 2003 Data flow analysis Emery Berger University.
Direction of analysis Although constraints are not directional, flow functions are All flow functions we have seen so far are in the forward direction.
Program Analysis Mooly Sagiv Tel Aviv University Sunday Scrieber 8 Monday Schrieber.
Claus Brabrand, ITU, Denmark DATA-FLOW ANALYSISMar 25, 2009 Static Analysis: Data-Flow Analysis II Claus Brabrand IT University of Copenhagen (
Claus Brabrand, UFPE, Brazil Aug 09, 2010DATA-FLOW ANALYSIS Claus Brabrand ((( ))) Associate Professor, Ph.D. ((( Programming, Logic, and.
Claus Brabrand, UFPE, Brazil Aug 04, 2010DATA-FLOW ANALYSIS Claus Brabrand ((( ))) Associate Professor, Ph.D. ((( Programming, Logic, and.
Prof. Bodik CS 164 Lecture 16, Fall Global Optimization Lecture 16.
Constant Propagation. The constant propagation framework is different from all the data-flow problems discussed so far, in that It has an unbounded set.
Example x := read() v := a + b x := x + 1 w := x + 1 a := w v := a + b z := x + 1 t := a + b.
Nattee Niparnan. Easy & Hard Problem What is “difficulty” of problem? Difficult for computer scientist to derive algorithm for the problem? Difficult.
Python Control Flow statements There are three control flow statements in Python - if, for and while.
Static Program Analyses of DSP Software Systems Ramakrishnan Venkitaraman and Gopal Gupta.
Λλ Fernando Magno Quintão Pereira P ROGRAMMING L ANGUAGES L ABORATORY Universidade Federal de Minas Gerais - Department of Computer Science P ROGRAM A.
For loops in programming Assumes you have seen assignment statements and print statements.
From Intended Learning Outcomes to Teaching/Learning Activities Claus Brabrand ((( ))) ((( ))) Associate.
VARIETE workshop, ITUVariational Abstract Interpretation Nov 28, 2013 Claus Brabrand IT University of Copenhagen Jan Midtgaard Aarhus Universtity Andrzej.
Program Analysis Mooly Sagiv Tel Aviv University Sunday Scrieber 8 Monday Schrieber.
Program Analysis Mooly Sagiv Tel Aviv University Sunday Scrieber 8 Monday Schrieber.
 Assumes events are governed by some lawful order ◦ Based on belief there are consistencies  What could you see as difficulties in transferring this.
Activity 1.2. Some definitions… Independent variable is another name for the input variable of a function Independent variable is another name for the.
ALGORITHMS.
Lesson thirteen Conditional Statement "if- else" ©
ITU Seminar on Teaching & Learning Claus Brabrand ((( ))) ((( ))) Associate Professor, IT University.
Data Flow Analysis II AModel Checking and Abstract Interpretation Feb. 2, 2011.
Design Document Sample Given two concentrated circles with different radii, calculate the area which falls inside the big circle but outside the small.
Iterative Dataflow Problems Taken largely from notes of Alex Aiken (UC Berkeley) and Martin Rinard (MIT) Dataflow information used in optimization Several.
Operational Semantics Mooly Sagiv Reference: Semantics with Applications Chapter 2 H. Nielson and F. Nielson
10-1 Tables and Functions Warm Up Warm Up Lesson Presentation Lesson Presentation Problem of the Day Problem of the Day Lesson Quizzes Lesson Quizzes.
May 5, 2004Slide 2 OmnAuto TMS Solution May 5, 2004Slide 3 OmnAuto TMS Dataflow.
Dataflow Analysis CS What I s Dataflow Analysis? Static analysis reasoning about flow of data in program Different kinds of data: constants, variables,
DFA foundations Simone Campanoni
Phoenix Based Dynamic Slicing Debugging Tool Eric Cheng Lin Xu Matt Gruskin Ravi Ramaseshan Microsoft Phoenix Intern Team (Summer '06)
Iterative Dataflow Problems
Dataflow analysis.
Fall Compiler Principles Lecture 8: Loop Optimizations
Machine-Independent Optimization
Programming Misconceptions
Another example: constant prop
Equivalent Expressions
Fall Compiler Principles Lecture 10: Loop Optimizations
Data Flow Analysis Compiler Design
Programming Concepts and Database
Static Analysis: Data-Flow Analysis I
Live Variables – Basic Block
Presentation transcript:

Claus Brabrand, ITU, Denmark STATIC ANALYSIS (DATA-FLOW ANALYSIS)Apr 09, 2008 Static Analysis: Data-Flow Analysis IV Claus Brabrand ITU - IT University of Copenhagen ( ) ( AMP’08: Advanced Models & Programs, 2008 ) ( WORKSHOP )

[ 2 ] Claus Brabrand, ITU, Denmark STATIC ANALYSIS (DATA-FLOW ANALYSIS)Apr 09, 2008 Data-Flow Analyses :-) ’  ’ ’  ’ ’  ’  ’  ’  ’  ’  = ”Reaching Definitions” ”Very Busy Expressions” ”AvailableExpressions””Live Variables” Variables” ( ,  ) ( ,  ) ( ,  ) ( ,  ) backwards must may forwards ”You have seen…” ”You haven’t seen…”

[ 3 ] Claus Brabrand, ITU, Denmark STATIC ANALYSIS (DATA-FLOW ANALYSIS)Apr 09, 2008 WORKSHOP 1) ”Reaching Definitions”:  (forwards),  (may / smallest set) 2) ”Live Variables”:  (backwards),  (may / smallest set) 3) ”Available Expressions”:  (forwards),  (must / largest set) 4) ”Very Busy Expressions”:  (backwards),  (must / largest set) Agenda: - Group formation (15’) - Workshop (2h45’) - Presentations (4  15’)

[ 4 ] Claus Brabrand, ITU, Denmark STATIC ANALYSIS (DATA-FLOW ANALYSIS)Apr 09, 2008 WORKSHOP 1) Define the problem 2) Show that the problem is undecidable 3) Define a Lattice Check that it is a lattice (and explain how) 4) Define monotone transfer functions Check that they are monotone (and explain how) 5) Pick a program the analysis ”can analyze” …and make ”an entire process”-diagram (cf. slide #3) 6) Repeat 5) for program analysis ”can’t do” 7) Explain possible uses of the analysis

[ 5 ] Claus Brabrand, ITU, Denmark STATIC ANALYSIS (DATA-FLOW ANALYSIS)Apr 09, 2008 The Language ’C--’ Syntactic Categories: Expressions ( E  EXP): Statements ( S  STM): For simplicity: Let’s assume we only have variables ‘ x ’, ‘ y ’, and ‘ z ’ ! E : n | v | E + E’ | – E | E * E’ | E == E’ | input S : skip ; | v := E ; | output E ; | { S 1 … S n } | if E then S else S’ | while E do S