Dataflow Analysis and Abstract Interpretation

Similar documents
Introduction to Models and Properties

Graduate AI Lecture 16: Planning 2. Teachers: Martial Hebert Ariel Procaccia (this time)

Differentiation Applications 1: Related Rates

Fall 2013 Physics 172 Recitation 3 Momentum and Springs

Chapter Summary. Mathematical Induction Strong Induction Recursive Definitions Structural Induction Recursive Algorithms

CS 477/677 Analysis of Algorithms Fall 2007 Dr. George Bebis Course Project Due Date: 11/29/2007

Dead-beat controller design

the results to larger systems due to prop'erties of the projection algorithm. First, the number of hidden nodes must

Five Whys How To Do It Better

Termination analysis of floating-point programs using parameterizable rational approximations

CHAPTER 24: INFERENCE IN REGRESSION. Chapter 24: Make inferences about the population from which the sample data came.

Math Foundations 20 Work Plan

BASD HIGH SCHOOL FORMAL LAB REPORT

Admin. MDP Search Trees. Optimal Quantities. Reinforcement Learning

Kinetic Model Completeness

Inflow Control on Expressway Considering Traffic Equilibria

L a) Calculate the maximum allowable midspan deflection (w o ) critical under which the beam will slide off its support.

Exponential Functions, Growth and Decay

Bootstrap Method > # Purpose: understand how bootstrap method works > obs=c(11.96, 5.03, 67.40, 16.07, 31.50, 7.73, 11.10, 22.38) > n=length(obs) >

Thermodynamics Partial Outline of Topics

How do scientists measure trees? What is DBH?

Math Foundations 10 Work Plan

We can see from the graph above that the intersection is, i.e., [ ).

Administrativia. Assignment 1 due thursday 9/23/2004 BEFORE midnight. Midterm exam 10/07/2003 in class. CS 460, Sessions 8-9 1

Lim f (x) e. Find the largest possible domain and its discontinuity points. Why is it discontinuous at those points (if any)?

Reinforcement Learning" CMPSCI 383 Nov 29, 2011!

Lecture 13: Markov Chain Monte Carlo. Gibbs sampling

A Correlation of. to the. South Carolina Academic Standards for Mathematics Precalculus

ENG2410 Digital Design Sequential Circuits: Part A

Assessment Primer: Writing Instructional Objectives

A Few Basic Facts About Isothermal Mass Transfer in a Binary Mixture

Distributions, spatial statistics and a Bayesian perspective

Determining the Accuracy of Modal Parameter Estimation Methods

The Law of Total Probability, Bayes Rule, and Random Variables (Oh My!)

MODULE 1. e x + c. [You can t separate a demominator, but you can divide a single denominator into each numerator term] a + b a(a + b)+1 = a + b

Least Squares Optimal Filtering with Multirate Observations

SPH3U1 Lesson 06 Kinematics

Thermodynamics and Equilibrium

CHM112 Lab Graphing with Excel Grading Rubric

Math 105: Review for Exam I - Solutions

Experiment #3. Graphing with Excel

Cambridge Assessment International Education Cambridge Ordinary Level. Published

Physics 2010 Motion with Constant Acceleration Experiment 1

I.S. 239 Mark Twain. Grade 7 Mathematics Spring Performance Task: Proportional Relationships

Exam #1. A. Answer any 1 of the following 2 questions. CEE 371 October 8, Please grade the following questions: 1 or 2

Floating Point Method for Solving Transportation. Problems with Additional Constraints

Synchronous Motor V-Curves

Trigonometric Ratios Unit 5 Tentative TEST date

1996 Engineering Systems Design and Analysis Conference, Montpellier, France, July 1-4, 1996, Vol. 7, pp

Chapter 16. Capacitance. Capacitance, cont. Parallel-Plate Capacitor, Example 1/20/2011. Electric Energy and Capacitance

More Tutorial at

CHEM-443, Fall 2013, Section 010 Midterm 2 November 4, 2013

Revisiting the Socrates Example

Lecture 17: Free Energy of Multi-phase Solutions at Equilibrium

NUMBERS, MATHEMATICS AND EQUATIONS

CONSTRUCTING STATECHART DIAGRAMS

" 1 = # $H vap. Chapter 3 Problems

ES201 - Examination 2 Winter Adams and Richards NAME BOX NUMBER

COMP 551 Applied Machine Learning Lecture 9: Support Vector Machines (cont d)

Homology groups of disks with holes

Lesson Plan. Recode: They will do a graphic organizer to sequence the steps of scientific method.

Exam #1. A. Answer any 1 of the following 2 questions. CEE 371 March 10, Please grade the following questions: 1 or 2

Revision: August 19, E Main Suite D Pullman, WA (509) Voice and Fax

ENSC Discrete Time Systems. Project Outline. Semester

This section is primarily focused on tools to aid us in finding roots/zeros/ -intercepts of polynomials. Essentially, our focus turns to solving.

READING STATECHART DIAGRAMS

BASIC DIRECT-CURRENT MEASUREMENTS

Lecture 02 CSE 40547/60547 Computing at the Nanoscale

Department: MATHEMATICS

Adaptive Large Neighborhood Search (ALNS)

THE LIFE OF AN OBJECT IT SYSTEMS

5.60 Thermodynamics & Kinetics Spring 2008

Fields and Waves I. Lecture 3

Preparation work for A2 Mathematics [2017]

Lecture 13: Electrochemical Equilibria

Lecture 23: Lattice Models of Materials; Modeling Polymer Solutions

Unit 1: Introduction to Biology

Professional Development. Implementing the NGSS: High School Physics

Building to Transformations on Coordinate Axis Grade 5: Geometry Graph points on the coordinate plane to solve real-world and mathematical problems.

Lab #3: Pendulum Period and Proportionalities

Keysight Technologies Understanding the Kramers-Kronig Relation Using A Pictorial Proof

Making and Experimenting with Voltaic Cells. I. Basic Concepts and Definitions (some ideas discussed in class are omitted here)

Hypothesis Tests for One Population Mean

[COLLEGE ALGEBRA EXAM I REVIEW TOPICS] ( u s e t h i s t o m a k e s u r e y o u a r e r e a d y )

Higher Mathematics Booklet CONTENTS

UN Committee of Experts on Environmental Accounting New York, June Peter Cosier Wentworth Group of Concerned Scientists.

Chem 163 Section: Team Number: ALE 24. Voltaic Cells and Standard Cell Potentials. (Reference: 21.2 and 21.3 Silberberg 5 th edition)

Medium Scale Integrated (MSI) devices [Sections 2.9 and 2.10]

Homework #7. True False. d. Given a CFG, G, and a string w, it is decidable whether w ε L(G) True False

Chapter 2 GAUSS LAW Recommended Problems:

Kepler's Laws of Planetary Motion

ECE 545 Project Deliverables

**DO NOT ONLY RELY ON THIS STUDY GUIDE!!!**

Pattern Recognition 2014 Support Vector Machines

Automaton-based Non-interference Monitoring

k-nearest Neighbor How to choose k Average of k points more reliable when: Large k: noise in attributes +o o noise in class labels

Review Problems 3. Four FIR Filter Types

1. Transformer A transformer is used to obtain the approximate output voltage of the power supply. The output of the transformer is still AC.

A Quick Overview of the. Framework for K 12 Science Education

Transcription:

Dataflw Analysis and Abstract Interpretatin Cmputer Science and Artificial Intelligence Labratry MIT Nvember 9, 2015

Recap Last time we develped frm first principles an algrithm t derive invariants. Key idea: - Define a lattice f pssible invariants - Define a fixpint equatin whse slutin will give yu the invariants Tday we fllw a mre histrical develpment and will present a frmalizatin that will allw us t better reasn abut this kind f analysis algrithms 2

Dataflw Analysis First develped by Gary Kildall in 1973 - This was 4 years after Hare presented aximatic semantics in 1969, which itself was based n the wrk f Flyd in 1967 - The tw appraches were nt seen as being cnnected t each ther Framewrk defined in terms f pls f facts - Observes that these pls f facts frm a lattice, allwing fr a simple fixpint algrithm t find them. - General framewrk defined in terms f facts that are created and destryed at every prgram pint. - Meet peratr is very natural as the intersectin f facts cming frm different edges. 3

Frward Dataflw Analysis Simulates executin f prgram frward with flw f cntrl Fr each nde n, have - in n value at prgram pint befre n - ut n value at prgram pint after n - f n transfer functin fr n (given in n, cmputes ut n ) Require that slutin satisfy - n. ut n = f n (in n ) - n n 0. in n = { ut m. m in pred(n) } - in n0 = I - Where I summarizes infrmatin at start f prgram 4

Dataflw Equatins Cmpiler prcesses prgram t btain a set f dataflw equatins ut n := f n (in n ) in n := { ut m. m in pred(n) } Cnceptually separates analysis prblem frm prgram 5

Wrklist Algrithm fr Slving Frward Dataflw Equatins fr each n d ut n := f n ( ) in n0 := I; ut n0 := f n0 (I) wrklist := N - { n 0 } //N is the set f all ndes while wrklist d remve a nde n frm wrklist in n := { ut m m in pred(n) } ut n := f n (in n ) if ut n changed then wrklist := wrklist succ(n) 6

Crrectness Argument Why result satisfies dataflw equatins? Whenever a nde n is prcessed, ut n := f n (in n ) Algrithm ensures that ut n = f n (in n ) Whenever ut n changes, put succ(n) n wrklist. Cnsider any nde m succ(n). When it cmes ff the wrklist, the algrithm will set in n := { ut m. m in pred(n) } t ensure that in n = { ut m. m in pred(n) } S final slutin will satisfy dataflw equatins 7

Terminatin Argument Why des algrithm terminate? Sequence f values taken n by in n r ut n is a chain. If values stp increasing, wrklist empties and algrithm terminates. If lattice has finite chain prperty, algrithm terminates - Algrithm terminates fr finite lattices 8

Abstract Interpretatin 15

Histry POPL 77 paper by Patrick Cust and Radhia Cust - Brings tgether ideas frm the cmpiler ptimizatin cmmunity with ideas in verificatin - Prvides a clean and general recipe fr building analyses and reasning abut their crrectness 16

Cllecting Semantics We are interested in the states a prgram may have at a given prgram pint - Can x ever be null at prgram pint i - Can n be greater than 1000 at pint j Given a labeling f prgram pints, we are interested in a functin - C: Labels P Σ - Fr each prgram label, we want t knw the set f pssible states the prgram may have at that pint. This is the cllecting semantics - Instead f defining the state f the prgram at a given pint, define the set f all states up t that given pint. 17

Defining the Cllecting Semantics x := n L1 L2 C L2 = σ x n σ C L1 Lt t e L1 f Lf C Lt = C Lf = σ σ C L1, e σ = true σ σ C L1, e σ = false L1 L2 C L3 = C L1 C L2 L3 18

Cmputing the cllecting semantics Cmputing the cllecting semantics is undecidable - Just like cmputing weakest precnditins Hwever, we can cmpute an apprximatin A - Apprximatin is sund as lng as C[Li] A Li. 20

Abstract Dmain An abstract dmain is a lattice *Sme analysis relax this restrictin. - Elements in the lattice are called Abstract Values Need t relate elements in the lattice with states in the prgram - Abstractin Functin: α: P(V) Abs Maps a value in the prgram t the best abstract value - Cncretizatin Functin: γ: Abs P(V) Maps an abstract value t a set f values in the prgram Example: - Parity Lattice 21

Galis Cnnectins Defines the relatinship between P V and Abs - In general define relatinship between tw cmplete lattices Galis Cnnectin: A pair f functins (Abstractin) α: P V Abs a and (Cncretizatin) γ: Abs P(V) such that Abs, V P V. V γ a α(v) a 22

Galis Cnnectins γ a V α P(V) Abs 23

Galis Cnnectins: Prperties Bth abstractin and cncretizatin functins are mntnic. V V α(v) α(v ) a a γ(a) γ(a ) Lemma: α(γ a ) a 24

Crrectness Cnditins What is the relatinship between γ a1 p a2 γ a1 p γ a2 Abstractin Functin: - α: P V Abs, α(s) = s S β(s) We can define - a1 p a2 = α(γ a1 p γ a2 ) 25

Abstract Dmains: Examples - Cnstant dmain - Sign dmain - Interval dmain 26

Abstract Interpretatin Simple recipe fr arguing crrectness f an analysis - Define an abstract dmain Abs - Define α and γ and shw they frm a Gallis Cnnectin - Define the semantics f prgram cnstructs fr the abstract dmain and shw that they are crrect 27

Sme useful dmains Ranges - Useful fr detecting ut-f-bunds errrs, ptential verflws Linear relatinships between variables - a 1 x 1 + a 2 x 2 + + a k x k c Prblem: Bth f these dmains have infinite chains! 28

Widening Key idea: - Yu have been running yur analysis fr a while - A value keeps getting bigger and bigger but refuses t cnverge - Just declare it t be (r sme ther big value) This lses precisin - but it s always sund Widening peratr: : Abs Abs Abs - a1 a2 a1, a2 29

MIT OpenCurseWare http://cw.mit.edu 6.820 Fundamentals f Prgram Analysis Fall 2015 Fr infrmatin abut citing these materials r ur Terms f Use, visit: http://cw.mit.edu/terms.