History. One breakthrough paper Cousot & Cousot 77 (?) Abstract Interpretation. Inspired by. Lecture 16. Enthusiastically embraced by the community

Similar documents
Abstract Interpretation. Lecture 5. Profs. Aiken, Barrett & Dill CS 357 Lecture 5 1

Abstract Interpretation: concrete and abstract semantics

Lucas Test is based on Euler s theorem which states that if n is any integer and a is coprime to n, then a φ(n) 1modn.

Heisenberg Model. Sayed Mohammad Mahdi Sadrnezhaad. Supervisor: Prof. Abdollah Langari

8-node quadrilateral element. Numerical integration

10/7/14. Mixture Models. Comp 135 Introduction to Machine Learning and Data Mining. Maximum likelihood estimation. Mixture of Normals in 1D

Soft k-means Clustering. Comp 135 Machine Learning Computer Science Tufts University. Mixture Models. Mixture of Normals in 1D

te Finance (4th Edition), July 2017.

The Hyperelastic material is examined in this section.

September 27, Introduction to Ordinary Differential Equations. ME 501A Seminar in Engineering Analysis Page 1. Outline

Higher order derivatives

Lecture 3: Phasor notation, Transfer Functions. Context

A Note on Estimability in Linear Models

Homework #3. 1 x. dx. It therefore follows that a sum of the

CHAPTER 7d. DIFFERENTIATION AND INTEGRATION

External Equivalent. EE 521 Analysis of Power Systems. Chen-Ching Liu, Boeing Distinguished Professor Washington State University

Epistemic Foundations of Game Theory. Lecture 1

Basic Polyhedral theory

ON THE COMPLEXITY OF K-STEP AND K-HOP DOMINATING SETS IN GRAPHS

Discrete Shells Simulation

u x v x dx u x v x v x u x dx d u x v x u x v x dx u x v x dx Integration by Parts Formula

Journal of Theoretical and Applied Information Technology 10 th January Vol. 47 No JATIT & LLS. All rights reserved.

Jones vector & matrices

SCRIBE: JAKE LEVINSON

UNTYPED LAMBDA CALCULUS (II)

Analyzing Frequencies

ST 524 NCSU - Fall 2008 One way Analysis of variance Variances not homogeneous

COHORT MBA. Exponential function. MATH review (part2) by Lucian Mitroiu. The LOG and EXP functions. Properties: e e. lim.

cycle that does not cross any edges (including its own), then it has at least

The Fourier Transform

A general N-dimensional vector consists of N values. They can be arranged as a column or a row and can be real or complex.

First derivative analysis

Minimum Spanning Trees

Optimal Ordering Policy in a Two-Level Supply Chain with Budget Constraint

Folding of Regular CW-Complexes

Lecture 14. Relic neutrinos Temperature at neutrino decoupling and today Effective degeneracy factor Neutrino mass limits Saha equation

Math 656 March 10, 2011 Midterm Examination Solutions


1 Minimum Cut Problem

Electrochemical Equilibrium Electromotive Force. Relation between chemical and electric driving forces

Decision-making with Distance-based Operators in Fuzzy Logic Control

Group Codes Define Over Dihedral Groups of Small Order

Introduction to Arithmetic Geometry Fall 2013 Lecture #20 11/14/2013

Outlier-tolerant parameter estimation

Search sequence databases 3 10/25/2016

Propositional Logic. Combinatorial Problem Solving (CPS) Albert Oliveras Enric Rodríguez-Carbonell. May 17, 2018

Linear Non-Gaussian Structural Equation Models

Objective Mathematics

Review - Probabilistic Classification

nd the particular orthogonal trajectory from the family of orthogonal trajectories passing through point (0; 1).

Hardy-Littlewood Conjecture and Exceptional real Zero. JinHua Fei. ChangLing Company of Electronic Technology Baoji Shannxi P.R.

Chapter 6 Student Lecture Notes 6-1

Aim To manage files and directories using Linux commands. 1. file Examines the type of the given file or directory

Deift/Zhou Steepest descent, Part I

JEE-2017 : Advanced Paper 2 Answers and Explanations

Physics 256: Lecture 2. Physics

Fakultät III Univ.-Prof. Dr. Jan Franke-Viebach

Dealing with quantitative data and problem solving life is a story problem! Attacking Quantitative Problems

Background: We have discussed the PIB, HO, and the energy of the RR model. In this chapter, the H-atom, and atomic orbitals.

The van der Waals interaction 1 D. E. Soper 2 University of Oregon 20 April 2012

Problem Set 6 Solutions

Α complete processing methodology for 3D monitoring using GNSS receivers

Section 6.1. Question: 2. Let H be a subgroup of a group G. Then H operates on G by left multiplication. Describe the orbits for this operation.

Consider a system of 2 simultaneous first order linear equations

Addition of angular momentum

Roadmap. XML Indexing. DataGuide example. DataGuides. Strong DataGuides. Multiple DataGuides for same data. CPS Topics in Database Systems

4 x 4, and. where x is Town Square

6.1 Integration by Parts and Present Value. Copyright Cengage Learning. All rights reserved.

Einstein Equations for Tetrad Fields

Function Spaces. a x 3. (Letting x = 1 =)) a(0) + b + c (1) = 0. Row reducing the matrix. b 1. e 4 3. e 9. >: (x = 1 =)) a(0) + b + c (1) = 0

INTEGRATION BY PARTS

Math 34A. Final Review

The second condition says that a node α of the tree has exactly n children if the arity of its label is n.

CS 361 Meeting 12 10/3/18

CPSC 665 : An Algorithmist s Toolkit Lecture 4 : 21 Jan Linear Programming

ECE602 Exam 1 April 5, You must show ALL of your work for full credit.

FEFF and Related Codes

u r du = ur+1 r + 1 du = ln u + C u sin u du = cos u + C cos u du = sin u + C sec u tan u du = sec u + C e u du = e u + C

An Application of Hardy-Littlewood Conjecture. JinHua Fei. ChangLing Company of Electronic Technology Baoji Shannxi P.R.China

On spanning trees and cycles of multicolored point sets with few intersections

Introduction to logistic regression

Grand Canonical Ensemble

Addition of angular momentum

Differentiation of Exponential Functions

Quasi-Classical States of the Simple Harmonic Oscillator

perm4 A cnt 0 for for if A i 1 A i cnt cnt 1 cnt i j. j k. k l. i k. j l. i l

A NEW GENERALISATION OF SAM-SOLAI S MULTIVARIATE ADDITIVE GAMMA DISTRIBUTION*

Week 3: Connected Subgraphs

Convergence Theorems for Two Iterative Methods. A stationary iterative method for solving the linear system: (1.1)

The Equitable Dominating Graph

Economics 201b Spring 2010 Solutions to Problem Set 3 John Zhu

ANALYSIS IN THE FREQUENCY DOMAIN

Questions k 10k 100k 1M Speaker. output

COMPLEX NUMBER PAIRWISE COMPARISON AND COMPLEX NUMBER AHP

Derangements and Applications

Lecture 10 Support Vector Machines II

MA 262, Spring 2018, Final exam Version 01 (Green)

Differential Equations

EEO 401 Digital Signal Processing Prof. Mark Fowler

Section 11.6: Directional Derivatives and the Gradient Vector

Transcription:

Hstory Abstract Intrprtaton On brakthrough papr Cousot & Cousot 77 (?) Insprd by Dataflow analyss Dnotatonal smantcs 1 Enthusastcally mbracd by th communty At last th functonal communty... At last th frst half of th papr... A Tny Languag Consdr a languag wth only ntgrs and multplcaton. = µ : Ep Int µ () = µ ( ) = µ ( ) µ ( ) 1 1 An Abstracton Dfn an abstract smantcs that computs only th sgn of th rsult. σ:ep { +,-,0} + f > 0 + 0 σ ( ) = 0 f = 0 + + 0 f 0 < 0 0 0 0 σ( ) = σ( ) σ( ) 0 + 1 1 3 4 Soundnss W can show that ths abstracton s corrct n th sns that t corrctly prdcts th sgn of an prsson. Proof s by structural nducton on. µ ( ) > 0 σ( ) = + µ ( ) = 0 σ( ) = 0 µ ( ) < 0 σ( ) = Anothr Vw of Soundnss Th soundnss proof s clunky ach cas rpats th sam da. Instad, drctly assocat ach abstract valu wth th st of concrt valus t rprsnts. γ :{ +,0, } { } { } { } γ ( + ) = > 0 γ (0) = 0 Int γ ( ) = < 0 5 6 1!

Anothr Vw (Cont.) Abstract Intrprtaton Th concrtzaton functon Mappng from abstract valus to (sts of) concrt valus Lt D b th concrt doman, A th abstract doman. µ ( ) γ( σ( )) Ep σ µ A γ Ths s an abstract ntrprtaton. Computaton n an abstract doman In ths cas {+,0,-}. Th abstract smantcs s sound appromats th standard smantcs. Th concrtzaton functon stablshs th conncton btwn th two domans. D 7 8 Addng - Etnd our languag wth unary - Addng + Addng addton s not so asy. Th abstract valus ar not closd undr addton. µ ( ) = µ ( ) + 0 σ( ) = σ( ) 0 + µ µ µ ( 1 + ) = ( 1) + ( ) + + +? 1 1 + + 0 σ( + ) = σ( ) + σ( ) 0 + 0? 9 10 Soluton W nd anothr abstract valu to rprsnt a rsult that can b any ntgr. Fndng a doman closd undr all th abstract opratons s oftn a ky dsgn problm. + + 0 T + + + T T γ (T) = Int 0 + 0 T T T T T T T T Etndng Othr Opratons W also nd to tnd th othr abstract opratons to work wth T. + 0 T + + 0 T 0 0 0 0 0 0 + T T T 0 T T + 0 T 0 + T 11 1!

Eampls Addng / (Intgr Dvson) Abstract computaton loss nformaton µ ((1 + ) + 3) = 0 σ ((1 + ) + 3) = ( + + + ) + ( + ) = T No loss of nformaton µ ((5 5) + 6) = 31 σ ((5 5) + 6) = ( + + ) + + = + 13 Addng / s straghtforward cpt for th cas of dvson by 0. If w dvd ach ntgr n a st by 0, what st of ntgrs rsults? Th mpty st. γ ( ) = / + 0 T + + 0 T 0 0 + T T T 0 T T 14 Addng / (Cont.) Th Abstract Doman As bfor w nd to tnd th othr abstract opratons. In ths cas, vry ntry nvolvng bottom s bottom all opratons ar strct n bottom + = = = 15 Our abstract doman forms a lattc. A partal ordr y γ( ) γ( y) Evry fnt subst has a last uppr bound (lub) & gratst lowr bound (glb). W wrt A for an abstract doman a st of valus + an ordrng T + 0 16 Lattc Lngo Th Abstracton Functon A lattc s complt f vry subst (fnt or nfnt) has lub s and glb s. Evry fnt lattc s complt Thus vry lattc has a top/bottom lmnt. Usually ndd n abstract ntrprtatons. Th abstracton functon maps concrt valus to abstract valus. Th dual of concrtzaton. Th smallst valu of A that s th abstracton of a st of concrt valus. α Int : A ({ } { } { }) α( S) = lub < 0 S, 0 0 S, + > 0 S 17 18 3!

A Gnral Dfnton An abstract ntrprtaton conssts of An abstract doman A and concrt doman D Concrtzaton and abstracton functons formng a Galos nsrton. A (sound) abstract smantc functon. Galos Insrtons Th abstract doman can b thought of as dvdng th concrt doman nto substs (not dsjont). Th abstracton functon maps a subst of th doman to th smallst contanng abstract valu. Galos nsrton: D. γα ( ( )) a A. = αγ ( ( )) or d γα d = αγ 19 d γα d = αγ 0 Pctur Gnral Condtons for Corrctnss In corrct abstract ntrprtatons, w pct th followng dagram to commut. Ep σ µ A D γ α 1 Thr condtons guarant corrctnss n gnral: α and γ form a Galos nsrton d γ oα, d = α oγ α and γ ar monotonc y α( ) α( y) Abstract opratons op ar locally corrct: γ(op( s,..., s )) op( γ( s ),..., γ( s )) 1 n 1 n Gnrc Corrctnss Proof A Scond Noton of Corrctnss Proof by nducton on th structur of : µ ( ) γ( σ( )) = = µ ( op ) 1 µ ( ) op µ ( ) df. of µ 1 γσ ( ( )) op γσ ( ( )) by nducton 1 γσ ( ( ) op σ( )) local corrctnss 1 γ( σ( op )) df of σ 1 W can dfn corrctnss usng abstracton nstad of concrtzaton. µ ( ) γ( σ( )) α ({ µ ( )}) σ( ) drcton µ ( ) γ( σ( )) α ({ µ ( )}) α( γ( σ( ))) monotoncty α ({ µ ( )}) σ( ) α oγ = d 3 4 4!

Corrctnss (Cont.) Th othr drcton... µ ( ) γ( σ( )) α ({ µ ( )}) σ( ) A Languag wth Input Th nt stp s to add languag faturs bsds nw opratons. W bgn wth nput, modld as a sngl fr varabl n prssons. drcton α ({ µ ( )}) σ( ) γα ( ({ µ ( )})) γσ ( ( )) monotoncty µ ( ) γ( σ( )) d γ oα =... 5 6 Smantcs Th manng functon now has typ µ : Ep Int Int W wrt th functon currd wth th prsson as a subscrpt. µ ( j) µ ( j) = = µ ( j) = µ ( j) µ ( j) 1 1 µ ( j) = µ ( j) + µ ( j) 1+ 1... =... j Abstract Smantcs Abstract smantc functon: σ : Ep A A Also wrt ths smantcs currd. σ ( j) = σ ( j) = j σ ( j) = σ ( j) σ ( j) 1 1 σ ( j) = σ ( j) + σ ( j) 1+ 1... =... = α({ }) 7 8 Corrctnss Local Corrctnss Th corrctnss condton nds to b gnralzd. Ths s th frst ral us of th abstracton functon. Th followng ar all quvalnt:. µ ( ) γ( σ ( α({ }))) D µ γ oσ oα A α oµ σ oα A α σ µ D A D γ α 9 W also nd a modfd local corrctnss condton. ( γσ ( ( )),..., ( ( )) ) ( ( ( ),..., ( )) γσ ) 1 γ σ n σ 1 n op j j op j j 30 5!

Proof of Corrctnss If-Thn-Els Thm µ ( j) γ( σ ( j)) Proof (by nducton) Bass. µ ( j) = γ( ) = γ( σ ( j)) Stp µ µ ( j) = j γ( j) = γ( σ ( j)) op ( 1,..., n ) 1 1 ( j ) = op( µ ( j ),..., µ ( j )) df. of µ n op( γσ ( ( j )),..., γσ ( ( j )) nducton n γ( op( σ ( j),..., σ ( j))) local corrctnss 1 op ( 1,..., n ) n = γ( σ ( j )) df. of σ =... f = thn ls... µ f 1= thn 3 ls 4 f 1= thn 3 ls 4 µ ( ) f µ ( ) ( ) 3 = µ 1 () = µ ( ) f µ ( ) ( ) 4 µ 1 σ () = σ () 7 σ () 3 4 Not th lub opraton n th abstract functon; ths s why w nd lattcs as domans. 31 3 Corrctnss of If-Thn-Els Assum th tru branch s takn. (Th argumnt for th fals branch s symmtrc.) Rcurson Add rcursv dfntons of a sngl varabl for smplcty Th smantc functon s µ () 3 γσ ( ( )) by nducton 3 γσ ( ( )) 7 γσ ( ( )) 3 4 ( 7 ) 3 4 γ σ ( ) σ ( ) monotoncty of γ µ : Ep Int Int program = df f ( ) = =... f( ) 33 34 Rvsd Manng Functon Manng of Rcursv Functons Dfn an aulary smantcs takng a functon (for th fr varabl f) and an ntgr (for ). µ : Ep Int Int µ ʹ : Ep (Int Int ) Int Int µ ʹ : Ep (Int Int ) Int Int µ ʹ ( g)( j) = g( µ ʹ ( g)( j)) f ( ) µ ʹ ( g)( j) = j µ ʹ ( g)( j) = µ ʹ ( g)( j) + µ ʹ ( g)( j) 1+ 1 35 Consdr a functon Dfn an ascndng chan f, f,... n Int Int f = λ. 0 f = µ ʹ ( f) + 1 Dfn µ = f f U df f = 0 1 36 6!

Abstract Smantcs Rvsd Dfn an analogous aulary functon for th abstract smantcs. Abstract Smantcs Rvsd II W nd on mor condton for th abstract smantcs. σ ʹ : Ep (A A) A A σʹ f ( ) ( g)( ) = g( σʹ ( g)( )) σ ʹ ( g)( ) = σʹ ( g)( ) = σʹ ( g)( ) + σʹ ( g)( ) 1+ Profs. Akn, Barrtt 1 & Dll CS 357 37 All abstract functons ar rqurd to b monotonc. Thm. Any monotonc functon on a complt lattc has a last fd pont. 38 Abstract Manng of Rcurson Corrctnss σ : Ep A A σ ': Ep ( A A) A A Consdr a functon df f = Dfn an ascndng chan f 0, f 1,... n A A f 0 = λa. f + 1 = σ ʹ ( f ) f ( j) f( j) 1 f ( j) 0 γ γ γ f ( j) f 1( j) f 0( j) Dfn σ = f f U Corrspondng lmnts of th chan stand n th corrct rlatonshp. 39 40 Corrctnss (Cont.) Eampl. f( j) γ ( f ( j)) f( j) γ ( f ( j)) chans stablz 0 0 Uf ( j) γ Uf ( j) monotoncty of γ 0 0 U µ ( j) γ( σ ( j)) by dfnton f U f df f() = f = 0 thn 1 ls f( + -1) Abstracton: ( σ ʹ ( = + )) lfp f 0 thn 1 ls f( -1) Smplfd: ( λ λ + ( + )) lfp f.. f( ) 41 4 7!

Strctnss W wll assum our languag s strct. Maks lttl dffrnc n qualty of analyss for ths ampl. Assum that f ( ) = Thrfor t s sound to dfn f ( ) = Calculatng th LFP ( λ λ + ( + )) lfp f.. f( ) 0 + T f 0 = 0 + T f 1 = + + + + 0 + T f = T T + T 0 + T f 3 = T T T T 43 44 Nots In ths cas, th abstracton ylds no usful nformaton! Not that squnc of functons forms a strctly ascndng chan untl stablzaton f0 < f1 < f < f3 = f4 = f5 =... But th squnc of valus at partcular ponts may not b strctly ascndng: f ( + ) < f( + ) = f ( + ) < f ( + ) = f ( + ) = f ( + ) =... 0 1 3 4 5 Nots (Cont.) Lsson: Th fd pont s bng computd n th doman (A A) A A Th fd pont s not bng computd n A A Mak sur you chck th doman of th fd pont oprator. 45 46 Strctnss Analyss Ovrvw In lazy functonal languags, t may b dsrabl to chang call-by-nd (lazy valuaton) to call-by-valu. Strctnss Analyss CBN rqurs buldng thunks (closurs) to captur th lcal nvronmnt of unvaluatd prssons. CBV valuats ts argumnt mmdatly, whch s wastful (or vn wrong) f th argumnt s nvr valuatd undr CBN. 47 48 8!

Corrctnss Substtutng CBV for CBN s always corrct f w somhow know that a functon valuats ts argumnt(s). A functon f s strct f f ( ) = Obsrvaton: f f s strct, thn t s corrct to pass argumnts to f by valu. Outln Dcdng whthr a functon s strct s undcdabl. Mycroft s da: Us abstract ntrprtaton. Corrctnss condton: If f s non-strct, w must rport that t s non-strct. 49 50 Th Abstract Doman Concrtzaton/Abstracton Contnu workng wth th sam languag (1 rcursv functon of 1 varabl). Nw abstract doman : 1 0 Th concrtzaton/abstracton functons say 0 mans th computaton dfntly dvrgs 1 mans nothng s known about th computaton D s th concrt doman γ(0) = { } α( { }) = 0 γ(1) = D α( S) = 1 f S { } 51 5 Abstract Smantcs Abstract Smantcs (Cont.) Nt stp s to dfn an abstract smantcs Transform f:int Int to f: Transform valus v:int To tst strctnss chck f to v: f(0) = 0 An a stands for an abstract valu (0 or 1). Trat 0,1 as fals, tru rspctvly. σ ʹ ( g)( a) = a σ ʹ ( g)( a) = 1 σʹ ( g)( a) = σʹ ( g)( a) σʹ ( )( ) ( )( ) ( )( ) 1 g a = σʹ g a σʹ 1 g a σ' ( g)( a) = g( σʹ ( g)( a)) f ( ) 53 54 9!

Th Rst of th Ruls An Eampl σʹ 1 ( g)( a) = σʹ ( g)( a) σʹ ( )( ) 1 g a + σʹ ( g)( a) = σʹ ( g)( a) σʹ ( g)( a) 1/ = f 1 thn 3 ls 4 df f 1 ( ) σʹ ( g)( a) = σʹ ( g)( a) σʹ ( g)( a) σʹ ( g)( a) σʹ ( g)( a) σ = 1 3 4 = lfp σʹ df f() = f = 0 thn 1 ls f( + -1) ( σ ʹ ( = + )) lfp f 0 thn 1 ls f( -1) ( ) lfp λf. λ. = λaa. ( λaa. ) 0 = 0 Th functon s strct n. 55 56 Calculatng th LFP Anothr Eampl ( λ λ ( )) lfp f.. 1 1 ( f( 1)) 0 1 f 0 = 0 0 0 1 f 1 = 0 1 0 1 f = 0 1 Gnralz to rcursv functons of two varabls. df f(,y) = f = 0 thn 0 ls f( + -1,f(,y)) ( σ ( )) lfp ʹ f = 0 thn 0 ls f( + -1,f(,y)) = lfp( λf. λ(, y). 1 (1...)) = λ(,y). 57 58 Eampl (Cont.) Summary of Strctnss Analyss For mult-argumnt functons, chck ach argumnt combnaton of th form (1,,1,0,1,,1). ( λ ) ( λ ) (, y). (0,1) = 0 (, y). (1,0) = 1 X can b passd by valu. Unsaf to pass Y by valu. Mycroft s tchnqu s sound and practcal. Wdly mplmntd for lazy functonal languags. Maks modst mprovmnt n prformanc (a fw %). Th thory of abstract ntrprtaton s crtcal hr. Mycroft s tchnqu trats all valus as atomc. No rfnmnt for componnts of lsts, tupls, tc. Many rsarch paprs tak up mprovmnts for data typs, hghr-ordr functons, tc. Most of ths ar vry slow. 59 60 10!

Conclusons Th Cousot&Cousot papr(s) gnratd an normous amount of othr rsarch. Abstract ntrprtaton as a thory and abstract ntrprtaton as a mthod of constructng tools ar oftn confusd. Slogan of most rsarchrs: Whr s Abstract Intrprtaton Wak? Thory s compltly gnral Th part of th orgnal papr popl undrstand s lmtd Fnt domans + monotonc functons Fnt Lattcs + Monotonc Functons = Program Analyss 61 6 Data Structurs and th Hap Sz of Domans Rqurs a fnt abstracton Whch may b tund to th program Mor oftn s mpty lst, lst of lngth 1, unknown lngth Smlar commnts apply to analyzng hap proprts E.g., a cll has 0 rfrncs, 1 rfrncs, many rfrncs Larg domans = slow analyss In practc, domans ar forcd to b small Chan hght s th crtcal masur Th focus n abstract ntrprtaton s on corrctnss Not much nsght nto ffcnt algorthms 63 64 Contt Snstvty Hghr-Ordr Functons No partcular nsght nto contt snstvty Any rasonabl tchnqu s an abstract ntrprtaton Maks clar how to handl hghr-ordr functons Modl as abstract, fnt functons Ordrng on functons s pontws Problm: hug domans Brak wth th dpndnc on control-flow graphs 65 66 11!

Forwards vs. Backwards Th forwards vs. backwards mntalty prmats much of th abstract ntrprtaton ltratur But nothng n th thory says t has to b that way 67 1!