Localization and Register Sharing for Predicate Abstraction Himanshu Jain Franjo Ivančić Aarti Gupta Malay Ganai.

Slides:



Advertisements
Similar presentations
Introduction to Formal Methods for SW and HW Development 09: SAT Based Abstraction/Refinement in Model-Checking Roberto Sebastiani Based on work and slides.
Advertisements

SAT Based Abstraction/Refinement in Model-Checking Based on work by E. Clarke, A. Gupta, J. Kukula, O. Strichman (CAV’02)
50.530: Software Engineering Sun Jun SUTD. Week 10: Invariant Generation.
Abstraction and Modular Reasoning for the Verification of Software Corina Pasareanu NASA Ames Research Center.
© Anvesh Komuravelli Spacer Automatic Abstraction in SMT-Based Unbounded Software Model Checking Anvesh Komuravelli Carnegie Mellon University Joint work.
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.
Symmetry-Aware Predicate Abstraction for Shared-Variable Concurrent Programs Alastair Donaldson, Alexander Kaiser, Daniel Kroening, and Thomas Wahl Computer.
BLAST-A Model Checker for C Developed by Thomas A. Henzinger (EPFL) Rupak Majumdar (UC Los Angeles) Ranjit Jhala (UC San Diego) Dirk Beyer (Simon Fraser.
The Software Model Checker BLAST by Dirk Beyer, Thomas A. Henzinger, Ranjit Jhala and Rupak Majumdar Presented by Yunho Kim Provable Software Lab, KAIST.
Software Verification via Refinement Checking Sagar Chaki, Edmund Clarke, Alex Groce, CMU Somesh Jha, Wisconsin.
Thread-modular Abstraction Refinement Tom Henzinger Ranjit Jhala Rupak Majumdar Shaz Qadeer.
Using Statically Computed Invariants Inside the Predicate Abstraction and Refinement Loop Himanshu Jain Franjo Ivančić Aarti Gupta Ilya Shlyakhter Chao.
Lazy Abstraction Thomas A. Henzinger Ranjit Jhala Rupak Majumdar Grégoire Sutre UC Berkeley.
Scalable Error Detection using Boolean Satisfiability 1 Yichen Xie and Alex Aiken Stanford University.
Interpolants [Craig 1957] G(y,z) F(x,y)
Counterexample-Guided Focus TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: AAA A A A AA A A Thomas Wies Institute of.
Thread-modular Abstraction Refinement Tom Henzinger Ranjit Jhala Rupak Majumdar [UC Berkeley] Shaz Qadeer [Microsoft Research]
Lazy Predicate Abstraction in BLAST John Gallagher CS4117.
1 Predicate Abstraction of ANSI-C Programs using SAT Edmund Clarke Daniel Kroening Natalia Sharygina Karen Yorav (modified by Zaher Andraus for presentation.
Counter Example Guided Refinement CEGAR Mooly Sagiv.
CS 267: Automated Verification Lectures 14: Predicate Abstraction, Counter- Example Guided Abstraction Refinement, Abstract Interpretation Instructor:
Automatically Validating Temporal Safety Properties of Interfaces Thomas Ball and Sriram K. Rajamani Software Productivity Tools, Microsoft Research Presented.
Bounded Model Checking EECS 290A Sequential Logic Synthesis and Verification.
Race Checking by Context Inference Tom Henzinger Ranjit Jhala Rupak Majumdar UC Berkeley.
Predicate Abstraction for Software and Hardware Verification Himanshu Jain Model checking seminar April 22, 2005.
Synthesis of Interface Specifications for Java Classes Rajeev Alur University of Pennsylvania Joint work with P. Cerny, G. Gupta, P. Madhusudan, W. Nam,
Finding the Weakest Characterization of Erroneous Inputs Dzintars Avots and Benjamin Livshits.
Software Verification with BLAST Tom Henzinger Ranjit Jhala Rupak Majumdar.
Computing Over­Approximations with Bounded Model Checking Daniel Kroening ETH Zürich.
1 Abstraction Refinement for Bounded Model Checking Anubhav Gupta, CMU Ofer Strichman, Technion Highly Jet Lagged.
Word Level Predicate Abstraction and Refinement for Verifying RTL Verilog Himanshu Jain Daniel Kroening Natasha Sharygina Edmund Clarke Carnegie Mellon.
Lazy Abstraction Tom Henzinger Ranjit Jhala Rupak Majumdar Grégoire Sutre.
Formal Verification of SpecC Programs using Predicate Abstraction Himanshu Jain Daniel Kroening Edmund Clarke Carnegie Mellon University.
By D. Beyer et. al. Simon Fraser University (Spring 09) Presentation By: Pashootan Vaezipoor.
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.
Grand Challenge Problem: Model Check Concurrent Software Edmund M. Clarke Department of Computer Science Carnegie Mellon University.
50.530: Software Engineering
1 Testing, Abstraction, Theorem Proving: Better Together! Greta Yorsh joint work with Thomas Ball and Mooly Sagiv.
272: Software Engineering Fall 2012 Instructor: Tevfik Bultan Lecture 3: Modular Verification with Magic, Predicate Abstraction.
Inferring Specifications to Detect Errors in Code Mana Taghdiri Presented by: Robert Seater MIT Computer Science & AI Lab.
Race Checking by Context Inference Tom Henzinger Ranjit Jhala Rupak Majumdar UC Berkeley.
Predicate Abstraction of ANSI-C Programs Using SAT By Edmund Clarke, Daniel Kroening, Natalia Sharygina, Karen Yorav Presented by Yunho Kim Provable Software.
Lazy Abstraction Jinseong Jeon ARCS, KAIST CS750b, KAIST2/26 References Lazy Abstraction –Thomas A. Henzinger et al., POPL ’02 Software verification.
1 Predicate Abstraction and Refinement for Verifying Hardware Designs Himanshu Jain Joint work with Daniel Kroening, Natasha Sharygina, Edmund M. Clarke.
Author: Alex Groce, Daniel Kroening, and Flavio Lerda Computer Science Department, Carnegie Mellon University Pittsburgh, PA Source: R. Alur and.
11 Counter-Example Based Predicate Discovery in Predicate Abstraction Satyaki Das and David L. Dill Computer Systems Lab Stanford University
Reachability for Linear Hybrid Automata Using Iterative Relaxation Abstraction Sumit K. Jha, Bruce H. Krogh, James E. Weimer, Edmund M. Clarke Carnegie.
Error Explanation with Distance Metrics Authors: Alex Groce, Sagar Chaki, Daniel Kroening, and Ofer Strichman International Journal on Software Tools for.
Counter Example Guided Refinement CEGAR Mooly Sagiv.
CHARME’03 Predicate abstraction with Minimum Predicates Sagar Chaki*, Ed Clarke*, Alex Groce*, Ofer Strichman** * Carnegie Mellon University ** Technion.
1 Alan Mishchenko Research Update June-September 2008.
Chair of Software Engineering Software Verification Lecture 12: Software Model Checking Carlo A. Furia.
Finding bugs with a constraint solver daniel jackson. mandana vaziri mit laboratory for computer science issta 2000.
#1 Having a BLAST with SLAM. #2 Software Model Checking via Counter-Example Guided Abstraction Refinement Topic: Software Model Checking via Counter-Example.
© Anvesh Komuravelli Spacer Model Checking with Proofs and Counterexamples Anvesh Komuravelli Carnegie Mellon University Joint work with Arie Gurfinkel,
The software model checker BLAST Dirk Beyer, Thomas A. Henzinger, Ranjit Jhala, Rupak Majumdar Presented by Yunho Kim TexPoint fonts used in EMF. Read.
Presentation Title 2/4/2018 Software Verification using Predicate Abstraction and Iterative Refinement: Part Bug Catching: Automated Program Verification.
Induction in CEGAR for Detecting Counterexamples
Lifting Propositional Interpolants to the Word-Level
Logic Coverage for Source Code CS 4501 / 6501 Software Testing
50.530: Software Engineering
CSC-682 Advanced Computer Security
Abstractions from Proofs
Predicate Abstraction
BLAST: A Software Verification Tool for C programs
SAT Based Abstraction/Refinement in Model-Checking
Presentation transcript:

Localization and Register Sharing for Predicate Abstraction Himanshu Jain Franjo Ivančić Aarti Gupta Malay Ganai

Introduction Predicate abstraction  Abstracts data by keeping track of certain predicates  Each predicate given a boolean variable in abstract model  Scalability depends on choice and usage of predicates

Counterexample Guided Abstraction and Refinement Property Monitor C programs Static Analysis Abstraction Model check (DiVer) Analysis & Refinement  Discovered bug in software Certified code F-Soft

Motivation Computing predicate relationships is expensive Localization of predicates  Identify important predicates at each program location  Identify important predicate relationships

Some notation Spurious trace  Infeasible sequence of statements Predicate relationships  Example: (p1 Æ : p2), (p1’ $ p3) 1. x = m; 2. y = m; 3. assume (x != y);

Related work BLAST uses interpolation to find important predicates at each statement in spurious trace [Jhala et al., 04]  Localization of predicates  Interpolation produces “good” predicates? Syntactic program transformations for automatic abstraction [Namjoshi et al.] MAGIC tool [Chaki et al.]

Given a spurious trace s 1 ;….;s k Use weakest pre-conditions to identify important predicates at each statement s i Most predicate relationships obtained from refinement itself Our approach

Outline Introduction Localization of predicates Register Sharing Dedicated State Variables Experimental results

Abstraction 1 : x = ctr; 2 : y = ctr + 1; 3 : if (x = i-1){ 4 : if (y != i){ ERROR: } 1 : skip; 2 : skip; 3 : if (*){ 4 : if (*){ ERROR: } Abstract C programNo predicates available currently

Checking the abstract model 1 : skip; 2 : skip; 3 : if (*){ 4 : if (*){ ERROR: } No predicates available currently Is ERROR reachable? yes Abstract model has a path leading to error state

Concretization of abstract counterexample 1 : x = ctr; 2 : y = ctr + 1; 3 : assume(x == i-1) 4 : assume (y != i) 1 : skip; 2 : skip; 3 : if (*){ 4 : if (*){ ERROR: } Concrete trace

Simulation Does this correspond to a real bug? Spurious trace We use a SAT solver 1 : x = ctr; 2 : y = ctr + 1; 3 : assume(x == i-1) 4 : assume (y != i) Concrete trace Spurious Counterexample

Refinement 1 : x = ctr; 2 : y = ctr + 1; 3 : assume(x == i-1) 4 : assume (y != i) Spurious Counterexample y != i ctr + 1 != i x == i -1 ctr == i - 1 Localization information

Predicate relationships 1 : x = ctr; 2 : y = ctr + 1; 3 : assume(x == i-1) 4 : assume (y != i) Spurious Counterexample y != i ctr + 1 != i x == i -1 ctr == i - 1 Localization information ?

1: x = ctr; 2: y = ctr + 1; 3: if (x = i-1){ 4: if (y != i){ ERROR: } What happened so far 1: skip; 2: skip; 3: if (*){ 4: if (*){ ERROR: } Initial abstraction 1: x = ctr; 2: y = ctr + 1; 3: assume(x == i-1) 4: assume (y != i) Spurious counterexample y != i x == i -1 ctr + 1 != i x == i - 1 ctr + 1 != ictr == i - 1 Localization information

Computing new abstraction 1: x = ctr; 2: y = ctr + 1; 3: if (x = i-1){ 4: if (y != i){ ERROR: } Computing new abstraction 1: 2: 3: if ( ){ 4: if ( ){ ERROR: } y != i x == i -1 ctr + 1 != i x == i - 1 ctr + 1 != ictr == i - 1 Localization information y != i x == i -1ctr + 1 != i x == i - 1 ctr + 1 != ictr == i - 1 Localization information

1: x = ctr; 2: y = ctr + 1; 3: if (x = i-1){ 4: if (y != i){ ERROR: } Computing new abstraction 1: 2: 3: if ( ){ 4: if (b0){ ERROR: } Computing new abstraction y != i x == i -1ctr + 1 != i x == i - 1 ctr + 1 != ictr == i - 1 Localization information Boolean b0 : y != i

1: x = ctr; 2: y = ctr + 1; 3: if (x = i-1){ 4: if (y != i){ ERROR: } Computing new abstraction 1: 2: 3: if (b1){ 4: if (b0){ ERROR: } Computing new abstraction y != i x == i -1ctr + 1 != i x == i - 1 ctr + 1 != ictr == i - 1 Localization information Boolean b1 : x==i-1 Boolean b0 : y != i

1: x = ctr; 2: y = ctr + 1; 3: if (x = i-1){ 4: if (y != i){ ERROR: } Computing new abstraction 1: 2: b0 = b2; 3: if (b1){ 4: if (b0){ ERROR: } Computing new abstraction y != i x == i -1ctr + 1 != i x == i - 1 ctr + 1 != ictr == i - 1 Localization information Boolean b2 : ctr+1 != i Boolean b1 : x == i-1 Boolean b0 : y != i

1: x = ctr; 2: y = ctr + 1; 3: if (x = i-1){ 4: if (y != i){ ERROR: } Computing new abstraction 1: b1 = b3; 2: b0 = b2; 3: if (b1){ 4: if (b0){ ERROR: } Computing new abstraction y != i x == i -1 ctr + 1 != i x == i - 1 ctr + 1 != ictr == i - 1 Localization information Boolean b3 : ctr == i -1 Boolean b2 : ctr+1 != i Boolean b1 : x == i - 1 Boolean b0 : y != i No decision procedure used so far

1: x = ctr; 2: y = ctr + 1; 3: if (x = i-1){ 4: if (y != i){ ERROR: } Computing new abstraction 1: b1 = b3; 2: b0 = b2; 3: if (b1){ 4: if (b0){ ERROR: } Computing new abstraction y != i x == i -1 ctr + 1 != i x == i - 1 ctr + 1 != ictr == i - 1 Localization information Boolean b3 : ctr == i -1 Boolean b2 : ctr+1 != i Boolean b1 : x == i - 1 Boolean b0 : y != i What about initial values of b2 and b3? SAT-based predicate abstraction Kroening et al. Lahiri et al. ?

1: x = ctr; 2: y = ctr + 1; 3: if (x = i-1){ 4: if (y != i){ ERROR: } Computing new abstraction 1: b1 = b3; 2: b0 = b2; 3: if (b1){ 4: if (b0){ ERROR: } Computing new abstraction Boolean b3 : ctr == i -1 Boolean b2 : ctr+1 != i Boolean b1 : x == i - 1 Boolean b0 : y != i Global constraint: (b2 $ : b3) y != i x == i -1 ctr + 1 != i x == i - 1 ctr + 1 != ictr == i - 1 Localization information

Abstraction without register sharing 1: b1 = b3; 2: b0 = b2; 3: if (b1){ 4: if (b0){ ERROR: } Computing new abstraction Boolean b3 : ctr == i -1 Boolean b2 : ctr+1 != i Boolean b1 : x == i - 1 Boolean b0 : y != i Global constraint: (b2 $ : b3)

Model check 1: b1 = b3; 2: b0 = b2; 3: if (b1){ 4: if (b0){ ERROR: } Computing new abstraction Boolean b3 : ctr == i -1 Boolean b2 : ctr+1 != i Boolean b1 : x == i - 1 Boolean b0 : y != i Global constraint: (b2 $ : b3) ERROR is not reachable!

What have we covered so far Localize predicates using weakest pre-conditions Utilizing weakest pre-condition relationships Bottleneck  Model checking of abstraction without register sharing

Due to localization many predicates are useful only at a few program locations Reuse state variables for representing other predicates  Similar to register allocation Register sharing

Abstraction with register sharing y != i x == i -1 ctr + 1 != i x == i - 1 ctr + 1 != ictr == i - 1 Localization information y != i x == i -1 ctr + 1 != i x == i - 1 ctr + 1 != ictr == i - 1 Localization information b0 b2 b1 b3 Do we need 4 Boolean variables?

Abstraction with register sharing y != i x == i -1 ctr + 1 != i x == i - 1 ctr + 1 != ictr == i - 1 Localization information y != i x == i -1 ctr + 1 != i x == i - 1 ctr + 1 != ictr == i - 1 Localization information c0 c1 1: b1 = b3; 2: b0 = b2; 3: if (b1){ 4: if (b0){ ERROR: } Global constraint: (b2 $ : b3) 1: skip; 2: skip; 3: if (c1){ 4: if (c0){ ERROR: } Local constraint: (PC = 1) ! (c0 $ : c1) Without With b0 b2 b1 b3

Register sharing Reduces Boolean variables in the abstract model by register sharing Speeds up model checking of abstractions What’s next  Reducing number of refinement iterations

Problem with register sharing p p L1 L20 L2 L19 b1 b2 = 0 = 1 Spurious

Dedicated state variable p p L1 L20 L2 L19 b b

Dedicated state variables Initially each predicate is assigned a Boolean variable, which can be reused If a predicate is localized at many statements,  |{s: p 2 local(s)}| > TH for some threshold TH  p is assigned a dedicated state variable (not reused)  By having a low value of TH, we can discover globally useful predicates early Why this works?

Experimental Results TCAS (Traffic Alert and Collision Avoidance System)  Lines of code 1652  We checked 10 different safety properties  Non-trivial number of predicates needed for each property both by F-Soft and BLAST

F-Soft versus BLAST (craig 2 + predH7) F-Soft

Summary Localize predicates using weakest pre-conditions  Most predicate relationships obtained as by product  Faster and less coarse abstractions  Comparable to interpolation based techniques Model checking abstractions  Exploit localization information for reducing Boolean variables Reducing refinement iterations  Predict globally useful predicates early in abstraction refinement process

Questions?