Model Checking for Embedded Systems Edmund Clarke, CMU High-Confidence Embedded Systems Workshop, May 1 st.

Slides:



Advertisements
Similar presentations
1 Verification by Model Checking. 2 Part 1 : Motivation.
Advertisements

Automated Theorem Proving Lecture 1. Program verification is undecidable! Given program P and specification S, does P satisfy S?
Masahiro Fujita Yoshihisa Kojima University of Tokyo May 2, 2008
CS 267: Automated Verification Lecture 8: Automata Theoretic Model Checking Instructor: Tevfik Bultan.
Verification of Evolving Software Natasha Sharygina Joint work with Sagar Chaki and Nishant Sinha Carnegie Mellon University.
Automatic Verification Book: Chapter 6. What is verification? Traditionally, verification means proof of correctness automatic: model checking deductive:
Abstraction and Modular Reasoning for the Verification of Software Corina Pasareanu NASA Ames Research Center.
1 Regression-Verification Benny Godlin Ofer Strichman Technion.
Timed Automata.
Model Checker In-The-Loop Flavio Lerda, Edmund M. Clarke Computer Science Department Jim Kapinski, Bruce H. Krogh Electrical & Computer Engineering MURI.
Verification of Hybrid Systems An Assessment of Current Techniques Holly Bowen.
ECE 720T5 Fall 2012 Cyber-Physical Systems Rodolfo Pellizzoni.
Symmetry-Aware Predicate Abstraction for Shared-Variable Concurrent Programs Alastair Donaldson, Alexander Kaiser, Daniel Kroening, and Thomas Wahl Computer.
Software Reliability CIS 640 Adapted from the lecture notes by Doron Pelel (
SAT and Model Checking. Bounded Model Checking (BMC) A.I. Planning problems: can we reach a desired state in k steps? Verification of safety properties:
The Design and Implementation of a Certifying Compiler [Necula, Lee] A Certifying Compiler for Java [Necula, Lee et al] David W. Hill CSCI
Formal Methods in Software Engineering Credit Hours: 3+0 By: Qaisar Javaid Assistant Professor Formal Methods in Software Engineering1.
CSEP590 – Model Checking and Software Verification University of Washington Department of Computer Science and Engineering Summer 2003.
Using Statically Computed Invariants Inside the Predicate Abstraction and Refinement Loop Himanshu Jain Franjo Ivančić Aarti Gupta Ilya Shlyakhter Chao.
State-Event Software Verification for Branching-Time Specifications Sagar Chaki, Ed Clarke, Joel Ouaknine, Orna Grumberg Natasha Sharygina, Tayssir Touili,
1 Carnegie Mellon UniversitySPINFlavio Lerda SPIN An explicit state model checker.
1 Predicate Abstraction of ANSI-C Programs using SAT Edmund Clarke Daniel Kroening Natalia Sharygina Karen Yorav (modified by Zaher Andraus for presentation.
1 Completeness and Complexity of Bounded Model Checking Ed Clarke Daniel Kroening Joel Ouaknine Carnegie Mellon University, Pittsburgh, USA Ofer Strichman.
Predicate Abstraction for Software and Hardware Verification Himanshu Jain Model checking seminar April 22, 2005.
A Type System for Expressive Security Policies David Walker Cornell University.
The Rare Glitch Project: Verification Tools for Embedded Systems Carnegie Mellon University Pittsburgh, PA Ed Clarke, David Garlan, Bruce Krogh, Reid Simmons,
1 Regression Verification: Proving the equivalence of similar programs Benny Godlin Ofer Strichman Technion, Haifa, Israel (This presentation is a subset.
Computing Over­Approximations with Bounded Model Checking Daniel Kroening ETH Zürich.
1 Formal Engineering of Reliable Software LASER 2004 school Tutorial, Lecture1 Natasha Sharygina Carnegie Mellon University.
Formal verification Marco A. Peña Universitat Politècnica de Catalunya.
Formal Verification of SpecC Programs using Predicate Abstraction Himanshu Jain Daniel Kroening Edmund Clarke Carnegie Mellon University.
272: Software Engineering Fall 2012 Instructor: Tevfik Bultan Lecture 4: SMT-based Bounded Model Checking of Concurrent Software.
MCAI 2.0 Model Checking in Ten Minutes Edmund Clarke School of Computer Science Carnegie Mellon University.
Thread-modular Abstraction Refinement Thomas A. Henzinger, et al. CAV 2003 Seonggun Kim KAIST CS750b.
Grand Challenge Problem: Model Check Concurrent Software Edmund M. Clarke Department of Computer Science Carnegie Mellon University.
ECE 720T5 Winter 2014 Cyber-Physical Systems Rodolfo Pellizzoni.
Benjamin Gamble. What is Time?  Can mean many different things to a computer Dynamic Equation Variable System State 2.
Proof Carrying Code Zhiwei Lin. Outline Proof-Carrying Code The Design and Implementation of a Certifying Compiler A Proof – Carrying Code Architecture.
1 New Development Techniques: New Challenges for Verification and Validation Mats Heimdahl Critical Systems Research Group Department of Computer Science.
B. Fernández, D. Darvas, E. Blanco Formal methods appliedto PLC code verification Automation seminar CERN – IFAC (CEA) 02/06/2014.
Inferring Specifications to Detect Errors in Code Mana Taghdiri Presented by: Robert Seater MIT Computer Science & AI Lab.
Dynamic Component Substitutability Analysis Edmund Clarke Natasha Sharygina* Nishant Sinha Carnegie Mellon University The University of Lugano.
Predicate Abstraction of ANSI-C Programs Using SAT By Edmund Clarke, Daniel Kroening, Natalia Sharygina, Karen Yorav Presented by Yunho Kim Provable Software.
Introduction to Problem Solving. Steps in Programming A Very Simplified Picture –Problem Definition & Analysis – High Level Strategy for a solution –Arriving.
Writing Systems Software in a Functional Language An Experience Report Iavor Diatchki, Thomas Hallgren, Mark Jones, Rebekah Leslie, Andrew Tolmach.
A Framework on Synchronization Verification in System-Level Design Thanyapat Sakunkonchak Satoshi Komatsu Masahiro Fujita Fujita Laboratory University.
1 CSEP590 – Model Checking and Automated Verification Lecture outline for August 6, 2003.
1 Predicate Abstraction and Refinement for Verifying Hardware Designs Himanshu Jain Joint work with Daniel Kroening, Natasha Sharygina, Edmund M. Clarke.
1 Model Checking of Robotic Control Systems Presenting: Sebastian Scherer Authors: Sebastian Scherer, Flavio Lerda, and Edmund M. Clarke.
Author: Alex Groce, Daniel Kroening, and Flavio Lerda Computer Science Department, Carnegie Mellon University Pittsburgh, PA Source: R. Alur and.
Verification & Validation By: Amir Masoud Gharehbaghi
SAFE KERNEL EXTENSIONS WITHOUT RUN-TIME CHECKING George C. Necula Peter Lee Carnegie Mellon U.
ECE/CS 584: Verification of Embedded Computing Systems Model Checking Timed Automata Sayan Mitra Lecture 09.
© 2006 Carnegie Mellon University Introduction to CBMC: Part 1 Software Engineering Institute Carnegie Mellon University Pittsburgh, PA Arie Gurfinkel,
Introduction to Hardware Verification ECE 598 SV Prof. Shobha Vasudevan.
Automated Formal Verification of PLC (Programmable Logic Controller) Programs
Research Heaven, West Virginia 1 Translation Validation of Compilers for Model-based Programming Supratik Mukhopadhyay Research Heaven,
CHARME’03 Predicate abstraction with Minimum Predicates Sagar Chaki*, Ed Clarke*, Alex Groce*, Ofer Strichman** * Carnegie Mellon University ** Technion.
Verifying Component Substitutability Nishant Sinha Sagar Chaki Edmund Clarke Natasha Sharygina Carnegie Mellon University.
© 2006 Carnegie Mellon University Introduction to CBMC: Part 1 Software Engineering Institute Carnegie Mellon University Pittsburgh, PA Arie Gurfinkel,
Symbolic Model Checking of Software Nishant Sinha with Edmund Clarke, Flavio Lerda, Michael Theobald Carnegie Mellon University.
© Anvesh Komuravelli Spacer Model Checking with Proofs and Counterexamples Anvesh Komuravelli Carnegie Mellon University Joint work with Arie Gurfinkel,
Sub-fields of computer science. Sub-fields of computer science.
Presentation Title 2/4/2018 Software Verification using Predicate Abstraction and Iterative Refinement: Part Bug Catching: Automated Program Verification.
Types for Programs and Proofs
Over-Approximating Boolean Programs with Unbounded Thread Creation
An explicit state model checker
Abstraction, Verification & Refinement
Predicate Abstraction
Rich Model Toolkit – An Infrastructure for Reliable Computer Systems
Presentation transcript:

Model Checking for Embedded Systems Edmund Clarke, CMU High-Confidence Embedded Systems Workshop, May 1 st

Embedded Software verification projects 1.Bridging the gap between legacy code and formal specification 2.Verification of a real-time operating system 3.Verifying concurrent embedded C programs 4.Certifying compilation with proof-carrying code

More Efficient Model Checking Algorithms 5.Counterexample-Guided Abstraction Refinement for Hybrid Systems 6.Making Bounded Model Checking complete

1. Bridging the Gap between Legacy Code and Formal Specification Daniel Kroening

Legacy Software Software is the most complex part of today's safety critical embedded systems Most embedded systems are legacy designs Written in a low level language such as ANSI-C or even assembly language Existing tools do not address the verification problem Goal: Verify legacy code with respect to –a formal specification –A high level design –Safety properties

Verification of Legacy Code ANSI-C Source =? Formal Specification (PVS) Other Design (State Charts, …) Bug Hunting for Security & Safety Functional Verification Safety problems because of pointers and arrays Run time guarantees (WCET) Program bugs (exceptions)

ANSI-C Bounded Model Checking Problem: Fixpoint computation is too expensive for software Idea: –Unwind program into equation –Check equation using SAT Advantages: –Completely automated –Allows full set of ANSI-C, including full treatment of pointers and dynamic memory Properties: –Simple assertions –Security (Pointers/Arrays) –Run time guarantees (WECT)

Current Project Verify Safety Properties of a part of a train controller provided by GE –Termination / WCET –Correctness of pointer constructs –The code uses two channels for redundancy: Check that they compute the same result –Arithmetic consistency checks, involving multiplication and division The code contains x86 assembly language

Future Work Interval abstraction for floating point aritmetic Concurrent ANSI-C programs (SpecC) Object oriented languages (C++, Java) Statechart-like specification language

2. Verification of a Real-Time Operating Systems Flavio Lerda

Real-Time Operating System Present in many embedded systems –Handles main functionalities Correctness is crucial –Affects the safety of the whole system Two type of properties –Timing properties –Functional properties Embedded System Real-Time OS Application Software Hardware

Timing Properties Worst Case Execution Time Analysis –For ANSI-C –Based on existing low-level analysis –Uses bounded model checking C SourceAnnotated C Source WCET for Basic blocks WCET Estimate CBMC WCET estimate is valid or not Estimation Algorithm Updated estimate Initial estimate Termination threshold Final WCET estimate

Functional Properties Does the system behave as expected? Apply to different components of the OS Check behavioral properties Embedded System Real-Time OS Application Software Hardware Scheduler Memory Management Inter-Process Communication Interface to the hardware

Results Case study: MicroC/OS –Real-Time Operating System –Freely available –Written in ANSI-C Prototype tools –For both type of properties Preliminary Results –On small subsystems

3. Verifying Embedded Concurrent C programs Sagar Chaki Joel Ouaknine Karen Yorav

Overview Based on the counterexample guided abstraction refinement paradigm –Completely automated State explosion avoid by abstraction techniques like predicate abstraction –Predicate minimization Can handle concurrency –Two-level abstraction refinement

Schematic Abstraction Theorem Prover Verification Model Checker Reachability Analyzer Simulation Checker Yes System OK Counterexample Valid? C ProgramModel Yes Abstraction Refinement Abstraction Guidance Improved Abstraction Guidance No

Case Study Metal casting controller 30,000 lines of C –No recursion or dynamic memory allocation Verified sequential properties –10 minutes CPU time, 300 MB memory Attempting concurrent properties –About 25 threads –No dynamic thread creation

4. Certifying Compilation with Proof- Carrying Code Joint work Clarke/Lee Student: Stephen Magill

Certifying Compilation Certifying Compiler CPU Source code Proof Object code Proof Checker Reasonable in size (0-10%). Simple, small (<52KB), and fast. Trusted Computing Base

Certifying Compilation Certifying Compiler CPU Source code Proof Object code Proof Checker Trusted Computing Base Type directed. -Requires sound, decidable type system for the property of interest +Automatic

Adding Model Checking Certifying Compiler CPU Source code Proof Object code Proof Checker Trusted Computing Base Do model checking here Generate an explicit proof +Properties handled in a uniform manner +Still automatic +Great opportunities for integration of the two approaches

Adding Model Checking Certifying Compiler CPU Source code Proof Object code Proof Checker Trusted Computing Base Do model checking here Generate an explicit proof Proof size?

5. Counterexample-Guided Abstraction Refinement for Hybrid Systems Joint project Clarke/Krogh: Students: A. Fehnker, Z. Han, J. Ouaknine, O. Stursberg, M. Theobald

Hybrid Systems: – Include continuous and discrete state variables – Model embedded systems – Applications: cars, robots, chemical plants,... Key Challenge: – Verification of properties of Hybrid System models Common Approach: – Employ abstraction to reduce complexity – Finding a good abstraction is difficult … Our Approach: – Automated search for a good abstraction – Based on Counterexample-Guided Abstraction Refinement

Verification Problem:Given: initial location + set and bad location Verify: bad location can never be reached CEGAR: Abstraction, Validation and Refinement STEP1: Build initial abstraction STEP2: Model check abstraction no CE  DONE (safe) STEP3: For each transition in CE: validate transition refine abstraction Case 1: S 2 is not reachable S2S2 S1S1 Case 2: Part of S 2 not reachable Concrete Model: Abstract Model: Case 3: All of S 2 reachable Case 2,3  next transition Case 1  GOTO STEP 2 STEP4: DONE (unsafe)

Summary and Results Car Steering Example Common reachability analysis:185 sec CEGAR with multiple over-approximations:69 sec As before, with considering fragments:20 sec following leading Adaptive Cruise Control Common reachability analysis:728 sec CEGAR with multiple over- approximations:495 sec As before, with considering fragments:43 sec Main Ideas of CEGAR for Hybrid Systems explore dynamics only in part of the system relevant to the property local refinement within a location framework for different over-approximation methods consider fragments of counterexamples

6. Making Bounded Model Checking Complete Daniel Kroening Joel Ouaknine Ofer Strichman

Bounded Model Checking A technique for incremental search for logical design errors Competes with traditional Model Checkers Often finds errors orders of magnitude faster than traditional model checkers. Widely adopted by the chip-design industry in the last 3 years. Applicable to high confidence embedded systems such as embedded controllers and communication protocols.

The Bounded Model Checking loop k = 0 yes k++ k ¸ CT no Counterexample Bug found No counter example Design correct The Completeness Threshold BMC(M, ,k)

How deep should we look for bugs ? In order to prove systems correct, a pre- computed “completeness threshold” must be known. The completeness threshold is a number CT such that, if no bug is found of length CT or less, then there is no bug at all The value of CT depends on the model M and the property Computing CT for general Linear Temporal Logic formulas has so far been an open problem

Computing the completeness threshold Our solution is based on a graph-theoretic analysis of the automaton  where –M is the automaton representing the verified system – is the (Buchi) automaton representing the negation of the property The completeness threshold (CT) is a function of the diameter and the Recurrence-diameter of the product automaton