Verification of Evolving Software Natasha Sharygina Joint work with Sagar Chaki and Nishant Sinha Carnegie Mellon University.

Slides:



Advertisements
Similar presentations
Automated Theorem Proving Lecture 1. Program verification is undecidable! Given program P and specification S, does P satisfy S?
Advertisements

Abstraction in Model Checking Nishant Sinha. Model Checking Given a: –Finite transition system M –A temporal property p The model checking problem: –Does.
CS 267: Automated Verification Lecture 8: Automata Theoretic Model Checking Instructor: Tevfik Bultan.
Translation-Based Compositional Reasoning for Software Systems Fei Xie and James C. Browne Robert P. Kurshan Cadence Design Systems.
Partial Order Reduction: Main Idea
1 Model checking. 2 And now... the system How do we model a reactive system with an automaton ? It is convenient to model systems with Transition systems.
50.530: Software Engineering Sun Jun SUTD. Week 10: Invariant Generation.
Enforcing Concurrent Temporal Behaviors Doron Peled, Dept. of CS University of Warwick.
© 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.
Chair of Software Engineering Software Verification Stephan van Staden Lecture 10: Model Checking.
Automated assume-guarantee reasoning for component verification Dimitra Giannakopoulou (RIACS), Corina Păsăreanu (Kestrel) Automated Software Engineering.
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.
Formal Methods in Software Engineering Credit Hours: 3+0 By: Qaisar Javaid Assistant Professor Formal Methods in Software Engineering1.
Software Verification via Refinement Checking Sagar Chaki, Edmund Clarke, Alex Groce, CMU Somesh Jha, Wisconsin.
Termination Proofs for Systems Code Andrey Rybalchenko, EPFL/MPI joint work with Byron Cook, MSR and Andreas Podelski, MPI PLDI’2006, Ottawa.
A … Framework for Verifying Concurrent C Programs Sagar Chaki Thesis Defense Talk.
1 Model Checking, Abstraction- Refinement, and Their Implementation Based on slides by: Orna Grumberg Presented by: Yael Meller June 2008.
1 Learning Assumptions for Compositional Verification J. M. Cobleigh, D. Giannakopoulou and C. S. Pasareanu Presented by: Sharon Shoham.
State-Event Software Verification for Branching-Time Specifications Sagar Chaki, Ed Clarke, Joel Ouaknine, Orna Grumberg Natasha Sharygina, Tayssir Touili,
Thread-modular Abstraction Refinement Tom Henzinger Ranjit Jhala Rupak Majumdar [UC Berkeley] Shaz Qadeer [Microsoft Research]
1 Carnegie Mellon UniversitySPINFlavio Lerda SPIN An explicit state model checker.
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.
Predicate Abstraction for Software and Hardware Verification Himanshu Jain Model checking seminar April 22, 2005.
© 2007 Carnegie Mellon University Optimized L*-based Assume-Guarantee Reasoning Sagar Chaki, Ofer Strichman March 27, 2007.
Word Level Predicate Abstraction and Refinement for Verifying RTL Verilog Himanshu Jain Daniel Kroening Natasha Sharygina Edmund Clarke Carnegie Mellon.
1 Formal Engineering of Reliable Software LASER 2004 school Tutorial, Lecture1 Natasha Sharygina Carnegie Mellon University.
Lazy Abstraction Tom Henzinger Ranjit Jhala Rupak Majumdar Grégoire Sutre.
Compositional Verification of Evolving Component-based Systems Nishant Sinha ECE, CMU PhD Proposal Presentation.
Formal Verification of SpecC Programs using Predicate Abstraction Himanshu Jain Daniel Kroening Edmund Clarke Carnegie Mellon University.
Model Checking for Embedded Systems Edmund Clarke, CMU High-Confidence Embedded Systems Workshop, May 1 st.
272: Software Engineering Fall 2012 Instructor: Tevfik Bultan Lecture 4: SMT-based Bounded Model Checking of Concurrent Software.
Thread-modular Abstraction Refinement Thomas A. Henzinger, et al. CAV 2003 Seonggun Kim KAIST CS750b.
Verification technique on SA applications using Incremental Model Checking 컴퓨터학과 신영주.
Formal Methods 1. Software Engineering and Formal Methods  Every software engineering methodology is based on a recommended development process  proceeding.
Grand Challenge Problem: Model Check Concurrent Software Edmund M. Clarke Department of Computer Science Carnegie Mellon University.
Cheng/Dillon-Software Engineering: Formal Methods Model Checking.
50.530: Software Engineering
Verifying Concurrent Message- Passing C Programs with Recursive Calls Sagar Chaki, Edmund Clarke, Nicholas Kidd, Thomas Reps, and Tayssir Touili.
Learning Based Assume-Guarantee Reasoning Corina Păsăreanu Perot Systems Government Services, NASA Ames Research Center Joint work with: Dimitra Giannakopoulou.
Lifecycle Verification of the NASA Ames K9 Rover Executive Dimitra Giannakopoulou Mike Lowry Corina Păsăreanu Rich Washington.
Automatic Assumption Generation for Compositional Verification Dimitra Giannakopoulou (RIACS), Corina Păsăreanu (Kestrel) Automated Software Engineering.
272: Software Engineering Fall 2012 Instructor: Tevfik Bultan Lecture 3: Modular Verification with Magic, Predicate Abstraction.
Dynamic Component Substitutability Analysis Edmund Clarke Natasha Sharygina* Nishant Sinha Carnegie Mellon University The University of Lugano.
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.
A Framework on Synchronization Verification in System-Level Design Thanyapat Sakunkonchak Satoshi Komatsu Masahiro Fujita Fujita Laboratory University.
Towards a Compositional SPIN Corina Păsăreanu QSS, NASA Ames Research Center Dimitra Giannakopoulou RIACS/USRA, NASA Ames Research Center.
1 Predicate Abstraction and Refinement for Verifying Hardware Designs Himanshu Jain Joint work with Daniel Kroening, Natasha Sharygina, Edmund M. Clarke.
Learning Symbolic Interfaces of Software Components Zvonimir Rakamarić.
Formal Verification of Synchronization Issues of SpecC Description with Automatic Abstraction Thanyapat Sakunkonchak Masahiro Fujita Department of Electronics.
Lecture 5 1 CSP tools for verification of Sec Prot Overview of the lecture The Casper interface Refinement checking and FDR Model checking Theorem proving.
11 Counter-Example Based Predicate Discovery in Predicate Abstraction Satyaki Das and David L. Dill Computer Systems Lab Stanford University
Model Checking for Simple Java Programs Taehoon Lee, Gihwon Kwon Department of Computer Science Kyonggi University, Korea IWFST, Shanghai, China,
Formal Verification. Background Information Formal verification methods based on theorem proving techniques and model­checking –To prove the absence of.
Presented by: Belgi Amir Seminar in Distributed Algorithms Designing correct concurrent algorithms Spring 2013.
CHARME’03 Predicate abstraction with Minimum Predicates Sagar Chaki*, Ed Clarke*, Alex Groce*, Ofer Strichman** * Carnegie Mellon University ** Technion.
Compositional Verification for System-on-Chip Designs SRC Student Symposium Paper 16.5 Nishant Sinha Edmund Clarke Carnegie Mellon University.
Compositional Verification part II Dimitra Giannakopoulou and Corina Păsăreanu CMU / NASA Ames Research Center.
Verifying Component Substitutability Nishant Sinha Sagar Chaki Edmund Clarke Natasha Sharygina Carnegie Mellon University.
© 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.
Bernhard Steffen, Falk Howar, Malte Isberner TU Dortmund /CMU
Formal methods: Lecture
Over-Approximating Boolean Programs with Unbounded Thread Creation
Predicate Abstraction
Presentation transcript:

Verification of Evolving Software Natasha Sharygina Joint work with Sagar Chaki and Nishant Sinha Carnegie Mellon University

Motivation Component-based Software –Software modules shipped by separate developers –Undergo several updates/bug-fixes during their lifecycle Component assembly verification –Necessary on update of any component –High verification costs of global properties

Contribution Assembly A Component C Component C’ P ?

Contribution Automated substitutability check –Preserving all old behaviors –Allowing new behaviors Focus on components that have been modified Allow multiple upgrades simultaneously

Substitutability Check Given old and new components C i, C’ i and assembly A –For each i check if C’ i is substitutable for C i in A Two phases: –Containment check Ensures that behaviors of the old component are contained in its substitutable counterpart –Compatibility check Safety with respect to other components in assembly: all global specifications are satisfied Approach: –Obtain a finite behavioral model of all components by abstraction: Labeled Kripke Structures (LKS) –Use model checkers to solve both phases automatically

Abstraction into LKS Labeled Kripke Structures – State-event traces – Composition semantics –Synchronize on shared actions Two types of abstraction: –Predicate abstraction (over-approximations: existential transitions) –Modified predicate abstraction (under-approximations: universal transitions) p !q q    !p

Labelled Kripke Structures Directed graph with labels on edges and states, (S,Init,P,L,T, ,E) –Every state is labeled with a set of atomic propositions, P, true in the state –Every LKS comes with an alphabet of actions,  State labeling function : L: S  2 P Transition labeling function : E : T  (2  \ {}) –Assumption: LKSs are deadlock-free [cf. MEMOCODE 04] a bc b a 0,1 1,11,0 0,0

Surge Protector : State/Event State/Event model of the Surge Protector (example is given for m: [0..2], c: [0..2])

Surge Protector : State Only Kripke structure of the Surge Protector (example is given for m: [0..2], c: [0..2])

Abstraction into LKS Program Statements, States Control flow, Transitions Transitions depict observable behavior Automated

Predicate Abstraction into LKS L1 lock = 0 if (x < y) lock=1 x < y void OSSemPend(…) { L1: lock = 1; if (x < y) { L2: lock = 0; … } if (x >= y) { … L3: lock = 0; … } else { … } L2   L3   if (x >= y) lock = 0 x < y

Verification L1 if (P) L2 L3 unlock lock Model ERROR unlock lock if (!P) Specification

Predicate Abstraction into LKS L1 lock = 0 if (x < y) lock=1 x < y if (x >= y) lock = 0 x < y if (x < y) x >= y lock=1 void OSSemPend(…) { L1: lock = 1; if (x < y) { L2: lock = 0; … } if (x >= y) { … L3: lock = 0; … } else { … } L2  if (x >= y) x >= y   L3 

Verification L1 if (*) L2 L3 unlock lock Model ERROR unlock lock if (*) Specification

ComFoRT: Component Formal Verification Framework Verification Yes System OK Abstraction Model Counterexample Valid? Components Assembly Yes No Counterexample Counter Example Guided Abstraction Refinement Abstraction Refinement Improved Abstraction Guidance No Spurious Counterexample

CEGAR Process Abstraction / Model Creation Theorem Prover Verification Safety/Liveness Checker Yes System OK Counterexample Valid? ComponentsLKSs Yes Abstraction Refinement Abstraction Guidance No Candidate Counterexample

Containment Step 1. Construct LKSs M’ and M such that (C1) C µ M and (C2) M’ µ C’ Step 2. Verify if M µ M’ If yes then from (C1) and (C2) C µ C’ and we terminate Else CE is produced Step 3. Validate CE 1. Check if CE  C. If yes proceed to next step. Otherwise refine M and repeat from Step Check if CE  C’. If yes than CE  C \ C’, Feedback  CE and stop. Else refine M’ (by adding the valid CE) and repeat from Step 2.

Containment (contd.) In contrast to Refinement-based approaches –Containment ensures that all behaviors of M are present in M’ –However, containment allows new behaviors in M’ which could be possibly erroneous Containment check is not sufficient since new components –may not be safe with respect to other components –must satisfy the global behavioral specifications

L* learner Learning Regular languages: L* Forms the basis of the compatibility check L* proposed by D. Angluin Polynomial in the number of states and length of counterexample Minimally adequate Teacher IsMember( trace  ) IsCandidate( DFA D ) a b a b Unknown Regular Language ±Counterexample/ Yes Model checker Yes/No Minimum DFA

Compatibility check Recursive Assume-guarantee to verify assembly properties Generate a (smaller) environment assumption A –A: most general environment so that P holds –Constructed iteratively using L* and R 1, R 2 –Recursion for the R2 rule R 1 : M 1 || A ² P R 2 : M 2 || … || M n ² A M 1 || … || M n ² P

Compatibility check R 1 : M 1 || A i ² P R 2 : M 2 || … || M n ² A i true L* Assumption Generation AiAi true CE CE Analysis True CE False CE -CE for A i +CE for A i

Compatibility check (contd.) Generate a most general assumption for each M’ –M 1 = M’ –M 2 = Mn M (all other component LKSs) Membership queries: –M’ || CE µ P Candidate queries: –M’ || A µ P –M 2 µ A

Compatibility check (contd.) CE analysis: M’ || CE µ P –Yes ) False CE –No ) True CE Compatibility check infers –Either M’ is substitutable –Or counterexample CE CE may be spurious wrt. C’ due to the predicate abstraction –CE is present in component LKS M’ –Must refine M’ –Repeat substitutability check

Compatibility check (contd.) Dynamic compatibility check –Restarts learning using information from a previously learned candidate –Account for incremental changes between successive assumptions The dynamic nature is critical for 1) checking evolving software; 2) during abstraction refinement where a single component is updated at a time.

Feedback to Developers Feedback - collection of CEs  C identified during containment check Feedback Delivery: Given a trace   Feedback, and Rep(  ) – representation of  in terms of program control locations, predicate valuations and actions, the levels of feedback are 1) Rep(Prefix(  )) – to denote the divergence point of  2) Rep(Suffix(  )) – to show what exact behavior (exact code) of C is missing in C’ 3) Rep’(Pref(  )) – to denote location in Ci where changes are to be made

Experiments Prototype implementation in ComFoRT framework ABB IPC Module –Deployed by a world leader in robotics engineering systems – LOC –modified WriteMessageToQueue component –checked for substitutability inside the assembly of four components (read, write, queue, critical section) –Over 30 billion states after predicate abstraction Discovered synchronization bug –Process can incorrectly block while writing to a queue

Related Work Learning Assumptions: Cobleigh. et. al. –Do not consider state labeling of abstract models –Do not incorporate a CEGAR framework for AG Compatibility of Component Upgrades: Ernst et. al. –Do not consider temporal sequence of actions in generating invariants Interface Automata: Henzinger et. al. –Do not have CEGAR, AG

ComFoRT framework:

Questions?