Convergence of Model Checking & Program Analysis Philippe Giabbanelli CMPT 894 – Spring 2008.

Slides:



Advertisements
Similar presentations
Chapter 22 Implementing lists: linked implementations.
Advertisements

Data-Flow Analysis II CS 671 March 13, CS 671 – Spring Data-Flow Analysis Gather conservative, approximate information about what a program.
P3 / 2004 Register Allocation. Kostis Sagonas 2 Spring 2004 Outline What is register allocation Webs Interference Graphs Graph coloring Spilling Live-Range.
Context-Sensitive Interprocedural Points-to Analysis in the Presence of Function Pointers Presentation by Patrick Kaleem Justin.
Compilation 2011 Static Analysis Johnni Winther Michael I. Schwartzbach Aarhus University.
Analysis of programs with pointers. Simple example What are the dependences in this program? Problem: just looking at variable names will not give you.
Data-Flow Analysis Framework Domain – What kind of solution is the analysis looking for? Ex. Variables have not yet been defined – Algorithm assigns a.
CS412/413 Introduction to Compilers Radu Rugina Lecture 37: DU Chains and SSA Form 29 Apr 02.
Lecture #21 Software Model Checking: predicate abstraction Thomas Ball Testing, Verification and Measurement Microsoft Research.
By Dirk Beyer, Alessandro Cimatti, Alberto Griggio, Erkan Keremoglu and Roberto Sebastiani Simon Fraser University (Spring 09) Presentation By: Pashootan.
Rigorous Software Development CSCI-GA Instructor: Thomas Wies Spring 2012 Lecture 13.
Introducing BLAST Software Verification John Gallagher CS4117.
A survey of techniques for precise program slicing Komondoor V. Raghavan Indian Institute of Science, Bangalore.
The Software Model Checker BLAST by Dirk Beyer, Thomas A. Henzinger, Ranjit Jhala and Rupak Majumdar Presented by Yunho Kim Provable Software Lab, KAIST.
1 Basic abstract interpretation theory. 2 The general idea §a semantics l any definition style, from a denotational definition to a detailed interpreter.
Abstractions. Outline Informal intuition Why do we need abstraction? What is an abstraction and what is not an abstraction A framework for abstractions.
Program analysis Mooly Sagiv html://
Lazy Predicate Abstraction in BLAST John Gallagher CS4117.
1 Carnegie Mellon UniversitySPINFlavio Lerda SPIN An explicit state model checker.
CS 536 Spring Global Optimizations Lecture 23.
1 Predicate Abstraction of ANSI-C Programs using SAT Edmund Clarke Daniel Kroening Natalia Sharygina Karen Yorav (modified by Zaher Andraus for presentation.
4/25/08Prof. Hilfinger CS164 Lecture 371 Global Optimization Lecture 37 (From notes by R. Bodik & G. Necula)
Program analysis Mooly Sagiv html://
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.
Prof. Fateman CS 164 Lecture 221 Global Optimization Lecture 22.
Prof. Bodik CS 164 Lecture 16, Fall Global Optimization Lecture 16.
Thread-modular Abstraction Refinement Thomas A. Henzinger, et al. CAV 2003 Seonggun Kim KAIST CS750b.
CSC2108 Lazy Abstraction on Software Model Checking Wai Sum Mong.
Software Systems Verification and Validation Laboratory Assignment 3
Verification and Validation Yonsei University 2 nd Semester, 2014 Sanghyun Park.
Imperative Programming
Unit III : Introduction To Data Structures and Analysis Of Algorithm 10/8/ Objective : 1.To understand primitive storage structures and types 2.To.
Program Analysis with Dynamic Change of Precision Dirk Beyer Tom Henzinger Grégory Théoduloz Presented by: Pashootan Vaezipoor Directed Reading ASE 2008.
Dataflow Analysis Topic today Data flow analysis: Section 3 of Representation and Analysis Paper (Section 3) NOTE we finished through slide 30 on Friday.
Type Systems CS Definitions Program analysis Discovering facts about programs. Dynamic analysis Program analysis by using program executions.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 22 Slide 1 Software Verification, Validation and Testing.
Static Program Analyses of DSP Software Systems Ramakrishnan Venkitaraman and Gopal Gupta.
Lazy Abstraction Jinseong Jeon ARCS, KAIST CS750b, KAIST2/26 References Lazy Abstraction –Thomas A. Henzinger et al., POPL ’02 Software verification.
Λλ Fernando Magno Quintão Pereira P ROGRAMMING L ANGUAGES L ABORATORY Universidade Federal de Minas Gerais - Department of Computer Science P ROGRAM A.
Mark Marron 1, Deepak Kapur 2, Manuel Hermenegildo 1 1 Imdea-Software (Spain) 2 University of New Mexico 1.
Program analysis with dynamic change of precision. Philippe Giabbanelli CMPT 894 – Spring 2008.
Mark Marron IMDEA-Software (Madrid, Spain) 1.
Symbolic Execution with Abstract Subsumption Checking Saswat Anand College of Computing, Georgia Institute of Technology Corina Păsăreanu QSS, NASA Ames.
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
Pointers in C Computer Organization I 1 August 2009 © McQuain, Feng & Ribbens Memory and Addresses Memory is just a sequence of byte-sized.
CS412/413 Introduction to Compilers Radu Rugina Lecture 18: Control Flow Graphs 29 Feb 02.
1 Control Flow Graphs. 2 Optimizations Code transformations to improve program –Mainly: improve execution time –Also: reduce program size Can be done.
Quantified Data Automata on Skinny Trees: an Abstract Domain for Lists Pranav Garg 1, P. Madhusudan 1 and Gennaro Parlato 2 1 University of Illinois at.
GC Assertions: Using the Garbage Collector To Check Heap Properties Samuel Z. Guyer Tufts University Edward Aftandilian Tufts University.
Dynamic White-Box Testing What is code coverage? What are the different types of code coverage? How to derive test cases from control flows?
24 September 2002© Willem Visser Program Model Checking Enabling Technology Abstraction void add(Object o) { buffer[head] = o; head = (head+1)%size;
Abstraction and Abstract Interpretation. Abstraction (a simplified view) Abstraction is an effective tool in verification Given a transition system, we.
Complexity Relief Techniques for Model Checking METU, Aug SOFTWARE VERIFICATION WORKSHOP Hüsnü Yenigün Sabanci University Informatics Institute,
A Static Analyzer for Large Safety-­Critical Software Presented by Dario Bösch, ETH Zürich Research Topics in Software Engineering Dario.
The software model checker BLAST Dirk Beyer, Thomas A. Henzinger, Ranjit Jhala, Rupak Majumdar Presented by Yunho Kim TexPoint fonts used in EMF. Read.
Software Testing.
Types for Programs and Proofs
Spring 2016 Program Analysis and Verification
Structural testing, Path Testing
G. Ramalingam Microsoft Research, India & K. V. Raghavan
Symbolic Implementation of the Best Transformer
Software Testing (Lecture 11-a)
What Are They? Who Needs ‘em? An Example: Scoring in Tennis
Trace-based Just-in-Time Type Specialization for Dynamic Languages
Abstraction, Verification & Refinement
Predicate Abstraction
CSE P 501 – Compilers SSA Hal Perkins Autumn /31/2019
BLAST: A Software Verification Tool for C programs
Software Testing and QA Theory and Practice (Chapter 5: Data Flow Testing) © Naik & Tripathy 1 Software Testing and Quality Assurance Theory and Practice.
Presentation transcript:

Convergence of Model Checking & Program Analysis Philippe Giabbanelli CMPT 894 – Spring 2008

Some of you know more than me on the topic… …do not hesitate to point out my mistakes at the end ! 1 Overview Convergence Customization

Toward customization Formalism Analysis Results 2 We are doing static analysis: we want the properties of programs without having to execute them. We have the code of a program, and we want to be guaranteed that there are no errors. We don’t work with the raw code but with higher representations of it like the Control Flow Graph (CFG). Basic example from the CFG: if there are too many nested control flow instructions, it is a bad pattern in the complexity.

Toward customization FormalismAnalysis Results 3 Model Checking I╞ S ? Given an implementation of the system, does it satisfy the specifications ? Program Analysis The implementation is represented as an automaton. If we represent all states, it will be huge… thus we have sets of states (OBDD). Accurate analysis but very costly: small programs! If we have big programs, we cannot afford too costly operations: we use approximations. The aim is an efficient calculus of more or less basic properties. Graphs from Patrick Clousot

Toward customization Formalism Analysis Results 4 Model CheckingProgram Analysis There are different paths through the states of the program. They define a « reachability tree » (i.e. states that ‘can happen’). Not every path can happen: we want to be accurate, we keep the paths well separate. We consider that every path of the CFG can be executed: we are doing an approximation by ignoring things such as conditional statements. → Two nodes are merged if they refer to the same control location. → Nodes are never merged. The merge operator is a bit different.

Toward customization Formalism Analysis Results 5 The merge operator is a bit different. Model CheckingProgram Analysis We don’t explore the reachability tree forever: we stop at some point. That’s what we call the « termination » : when we stop at a node. We stop when the set of states computed for the next step is included in the current. We stop when the abstract state does not represent new concrete states (it is a fixpoint). The termination operator is a bit different.

Toward customization Formalism Analysis Results 6 The merge operator is a bit different. The termination operator is a bit different. The model checker BLAST has been extended to allow customized program analyses. We have a set of abstract interpreters. Let’s call the overall engine the meta-engine. We configure the meta-engine by defining a composite merge operator and a composite terminator operator (composite as several interpreters).

Toward customization Formalism Analysis Results 7 So, what do we have here? It is neither stricly a model checker nor a program analyzer. The difference between a model checker and a program analyzer is a somehow a parameter of our configurable model. This illustrates the convergence: we have a bit of both approaches!

Toward customization Formalism Analysis Results 8 We consider simple imperative programming languages. What do we have in a program ? ∙ Lines, the current one being indicated by Pc. ∙ The control flow is transfered from one location to another. ∙ A set X of variables. The ways to move in a program are already given by a CFG. If we add information about variables, we are turning it into an automaton (CFA). ∙ L is the set of program locations (values taken by Pc). ∙ are the control-flow edges ∙ A concrete state c associates all variables X and Pc to a value. ∙ C is the set of all possible concrete states. ∙ A subset r of C is called a region.

Toward customization Formalism Analysis Results 9 We have the automaton, but how do we move in it? ∙ G is the set of transitions (or edges). g is a transition if it belongs to G. ∙ c → c’: we can go from the concrete state c to the concrete state c’ if there exists a transition from c to c’ by some g ∙ A state c n is reachable from r if there is a path from r to c n. This path is defined as a set of transitions: c n belongs to Reach(r) if there exists (r, c 1,…, c n ) such that c i-1 → c i for all 1 ≤ i ≤ n.

Toward customization Formalism Analysis Results 10 Let see what an abstract domain is through an example… ∙ What is the result of * * ?  ∙ What is the sign of * * ? ∙ We replaced the domain of integers by the domain of sign. ∙ As we said in abstract interpretation, we are simplifying a bit the problem. Here, we consider an abstract domain of signs: we still compute something relevant, but a bit less ambitious. ∙ We take the problem, we abstract its domain and we get an answer in a reasonable time. To get back from the abstract domain to the concrete one, we use a concretization function. C(negative) = [-∞, -1]C(positive) = [0, +∞]

Toward customization Formalism Analysis Results 11 Schemes from Patrick Cousot, « Abstract Interpretation Based Formal Methods and Future Challengeces » (Springer-Verlag 2001)

Toward customization Formalism Analysis Results 12 Now that we’ve got the basis, what is configurable program analysis? ∙ An abstract domain, determines the objective of the analysis. ∙ A transfer relation, assigns to each abstract state its successors. ∙ The merge operator, combines two abstract states. ∙ The termination check : if the abstract state given as first parameter is covered by the states of abstract state given as second parameter, then we stop. The way we define covered is where the customization happens. Each of the four components independently influences precision&cost.

Toward customization Formalism Analysis Results 13 Among the program analysis used in the experiments, we have: location analysis, predicate abstraction and shape analysis. ∙ In location analysis, we track the reachability of program locations. Can we go there? ∙ The predicate abstraction defined by Ball, Podeslki and Rajamani considers programs where the only type is boolean. Their programs c2bp turned a program P with predicates E into a boolean program B(P, E), and then they launched the model checker bebop. Developped between ∙ There might be destructive updating on dynamically allocated storage. Shape analysis keeps tracks of the data structures stored on the heap (i.e. dynamic allocation).

Toward customization Formalism Analysis Results 14 The authors have developped the reachability algorithm CPA. Given a configurable program analysis and an initial abstract state, it gives the set of reachable abstract states that over-approximates the set of reachable concrete states. ∙ Let see what an over-approximation is through an example. int i = 0; for(int j=0; j 0.3) tttttttttti++ At the end, i is in [0, 10]. An over-approximation of those concrete states would be [-5,15]. ∙ If we set the merge operator to combine, then it considers that x might be equal to z and declares that it is unsafe. This is not possible in the concrete program: false-alarm! ∙ Now, we configure the merge to keep things separated, and we find that x and y will have different values: no division by 0, the program is safe, hurray! ∙ Why don’t we always go for the accurate analysis? Because if he have n if, it might lead to 2^n abstract states and the algorithm might not terminate because of loops…

Toward customization Formalism Analysis Results 15 We have many tools, some being accurate but quite slow, other converging faster but loosing in accuracy… Let’s combine them! ∙ For example, predicate abstraction and shape analysis can be combined. The shape graph can become more accurate by using information from the predicate abstraction. The accuracy of the combination is the degree of sharpness. Three composite program analysis are used in the experiments. ∙ Basic BLAST’s. The components are the configurable program analysis for program locations and the configurable program analysis for predicate. Merge/Step are separated. ∙ We can add to it a third component: shape analysis. ∙ We can also add to it pointer analysis as a third component (tracks pointer aliases, memory allocations, etc.)

Toward customization Formalism Analysis Results 16 Let’s consider BLATS’s + shape analysis. We want an efficient configuration for it. Let see what we’ve got from the experiments… ∙ A. Stop is on separate and merge is on join. Bad: many highly expensive operations. ∙ B. Stop is on separate and merge is on separate (lazy shape analysis). Better cost as operations on small sets of shape graphs are much more efficient than on large one (like in A). ∙ C. Stop is on separate and merge is on separate and we use the predicate to sharpen the shape information. This sharpening has a small cost and gives a more precise analysis! ∙ D. To do better than B, let’s turn stop on join. On the examples, it doesn’t do well: the time spent on termination checks was very small, and as there is an overhead for the join then we are loosing in performances. ∙ E. Turning both on join looses precision and has a high cost.

Toward customization Formalism Analysis Results 17 Source for this presentation. Configurable Software Verification: concretizing the convergence of model checking and program analysis, Dirk Beyer, Thomas A. Henzinger and Grégory Théoduloz Thanks For Your Time