Abstractions. Outline Informal intuition Why do we need abstraction? What is an abstraction and what is not an abstraction A framework for abstractions.

Slides:



Advertisements
Similar presentations
The behavior of SAT solvers in model checking applications K. L. McMillan Cadence Berkeley Labs.
Advertisements

Automated Theorem Proving Lecture 1. Program verification is undecidable! Given program P and specification S, does P satisfy S?
Automatic Verification Book: Chapter 6. How can we check the model? The model is a graph. The specification should refer the the graph representation.
Modeling issues Book: chapters 4.12, 5.4, 8.4, 10.1.
Continuing Abstract Interpretation We have seen: 1.How to compile abstract syntax trees into control-flow graphs 2.Lattices, as structures that describe.
CS 267: Automated Verification Lecture 8: Automata Theoretic Model Checking Instructor: Tevfik Bultan.
Partial Order Reduction: Main Idea
Introduction to Formal Methods for SW and HW Development 09: SAT Based Abstraction/Refinement in Model-Checking Roberto Sebastiani Based on work and slides.
Introducing Formal Methods, Module 1, Version 1.1, Oct., Formal Specification and Analytical Verification L 5.
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.
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.
Program correctness The State-transition model A global state S  s 0 x s 1 x … x s m {s k = local state of process k} S0  S1  S2  … Each state transition.
1 PROPERTIES OF A TYPE ABSTRACT INTERPRETATER. 2 MOTIVATION OF THE EXPERIMENT § a well understood case l type inference in functional programming à la.
Chair of Software Engineering From Program slicing to Abstract Interpretation Dr. Manuel Oriol.
Rigorous Software Development CSCI-GA Instructor: Thomas Wies Spring 2012 Lecture 13.
Verification of Hybrid Systems An Assessment of Current Techniques Holly Bowen.
1 Formal Methods in SE Qaisar Javaid Assistant Professor Lecture 05.
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:
Thread-modular Abstraction Refinement Tom Henzinger Ranjit Jhala Rupak Majumdar Shaz Qadeer.
1 Formal Methods in SE Qaisar Javaid Assistant Professor Lecture # 11.
1 Basic abstract interpretation theory. 2 The general idea §a semantics l any definition style, from a denotational definition to a detailed interpreter.
1 Model Checking, Abstraction- Refinement, and Their Implementation Based on slides by: Orna Grumberg Presented by: Yael Meller June 2008.
Specification Formalisms Book: Chapter 5. Properties of formalisms Formal. Unique interpretation. Intuitive. Simple to understand (visual). Succinct.
Thread-modular Abstraction Refinement Tom Henzinger Ranjit Jhala Rupak Majumdar [UC Berkeley] Shaz Qadeer [Microsoft Research]
Synergy: A New Algorithm for Property Checking
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.
Enhancing The Fault-Tolerance of Nonmasking Programs Sandeep S. Kulkarni and Ali Ebnenasir Software Engineering and Network Systems Laboratory Computer.
Modeling Software Systems Lecture 2 Book: Chapter 4.
CS 267: Automated Verification Lectures 14: Predicate Abstraction, Counter- Example Guided Abstraction Refinement, Abstract Interpretation Instructor:
Formal Verification Group © Copyright IBM Corporation 2008 IBM Haifa Labs SAT-based unbounded model checking using interpolation Based on a paper “Interpolation.
Abstract Interpretation Part I Mooly Sagiv Textbook: Chapter 4.
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.
Program Analysis Mooly Sagiv Tel Aviv University Sunday Scrieber 8 Monday Schrieber.
272: Software Engineering Fall 2012 Instructor: Tevfik Bultan Lecture 4: SMT-based Bounded Model Checking of Concurrent Software.
Regular Model Checking Ahmed Bouajjani,Benget Jonsson, Marcus Nillson and Tayssir Touili Moran Ben Tulila
7/13/2003BMC A SAT-Based Approach to Abstraction Refinement in Model Checking Bing Li, Chao Wang and Fabio Somenzi University of Colorado at Boulder.
1 Automatic Non-interference Lemmas for Parameterized Model Checking Jesse Bingham, Intel DEG FMCAD 2008.
Specifying and Verifying Event-based Fairness Enhanced Systems 1 ICFEM 2008 Specifying and Verifying Event-based Fairness Enhanced Systems Jun SUN, Yang.
Type Systems CS Definitions Program analysis Discovering facts about programs. Dynamic analysis Program analysis by using program executions.
Lecture 10 Abstract Interpretation using Fixpoints.
1 Bisimulations as a Technique for State Space Reductions.
Lazy Abstraction Jinseong Jeon ARCS, KAIST CS750b, KAIST2/26 References Lazy Abstraction –Thomas A. Henzinger et al., POPL ’02 Software verification.
Model construction and verification for dynamic programming languages Radu Iosif
Convergence of Model Checking & Program Analysis Philippe Giabbanelli CMPT 894 – Spring 2008.
Symbolic Execution with Abstract Subsumption Checking Saswat Anand College of Computing, Georgia Institute of Technology Corina Păsăreanu QSS, NASA Ames.
1 Predicate Abstraction and Refinement for Verifying Hardware Designs Himanshu Jain Joint work with Daniel Kroening, Natasha Sharygina, Edmund M. Clarke.
Predicate Abstraction. Abstract state space exploration Method: (1) start in the abstract initial state (2) use to compute reachable states (invariants)
CSCI1600: Embedded and Real Time Software Lecture 11: Modeling IV: Concurrency Steven Reiss, Fall 2015.
Properties Incompleteness Evaluation by Functional Verification IEEE TRANSACTIONS ON COMPUTERS, VOL. 56, NO. 4, APRIL
SAT-Based Model Checking Without Unrolling Aaron R. Bradley.
Concrete Model Checking with Abstract Matching and Refinement Corina Păsăreanu QSS, NASA Ames Research Center Radek Pelánek Masaryk University, Brno, Czech.
CS357 Lecture 13: Symbolic model checking without BDDs Alex Aiken David Dill 1.
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
1 Iterative Program Analysis Abstract Interpretation Mooly Sagiv Tel Aviv University Textbook:
3-Valued Abstraction and 3-Valued Model-Checking.
Today’s Agenda  Quiz 4  Temporal Logic Formal Methods in Software Engineering1.
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.
29/06/2016Verification Synchronous Languages Verification.
Complexity Relief Techniques for Model Checking METU, Aug SOFTWARE VERIFICATION WORKSHOP Hüsnü Yenigün Sabanci University Informatics Institute,
Counterexample-Guided Abstraction Refinement By Edmund Clarke, Orna Grumberg, Somesh Jha, Yuan Lu, and Helmut Veith Presented by Yunho Kim Provable Software.
Formal methods: Lecture
CPE555A: Real-Time Embedded Systems
Automatic Verification
Over-Approximating Boolean Programs with Unbounded Thread Creation
An explicit state model checker
Predicate Abstraction
Presentation transcript:

Abstractions

Outline Informal intuition Why do we need abstraction? What is an abstraction and what is not an abstraction A framework for abstractions Commonly used abstractions

Limitations of model checking Finite state technique Cannot deal with general data integers, lists, etc. unbounded message queues Cannot deal with parameterized systems Suffers from state explosion Concurrency Data domains

Abstraction Represent the program using a smaller model. Pay attention to preserving the checked properties. Do not affect the flow of control.

Example Use smaller data objects. X:= f(m) Y:=g(n) if X*Y>0 then … else … X, Y never used again.

How to abstract? Assign values {-1, 0, 1} to X and Y. Based on the following connection: sgn(X) = 1 if X>0, 0 if X=0, and -1 if X<0. sgn(X)*sgn(Y)=sgn(X*Y). Change f and g to produce abstract values for X and Y

Abstraction vs. simplification Not every simplified system is an abstraction The key question is: If we prove or disprove a property of the simplified system, what have we learned about the original system?

Example False positive Can sender overwrite a value? True in the simplified system, false in original False negative Can receiver deadlock? False in the simplified system, true in the original

Precise abstractions Accept neither false positives nor false negatives Minimizations up to an equivalence Elimination of unreachable states Very restrictive!

Precise abstractions int i = 0 while i < 2 do i = i + 1 Replace integer type with enumerated type {0,1,2} Requires a deductive step With “on-the-fly” model construction, this abstraction is free – but may not terminate if you “miss”

Over-approximations Throw in more behaviors Also called conservative approximations Accept false positives but not false negatives If the property proved in the abstract system, it also holds in the concrete system If the property fails in the abstract system, may or may not fail in the concrete system

Abstraction w.r.t. properties A conservative approximation is always with respect to a set of properties If your set of properties is closed under negation, you have precise abstraction Why? Commonly used sets of properties: Reachability, safety ACTL

Abstract LTL verification Concrete correctness condition: L(ConcreteModel)  L(Spec) Over-approximation: L(ConcreteModel)  L(AbstractModel) Abstract correctness condition: L(AbstractModel)  L(Spec) Implies concrete correctness condition!

What is a good abstraction? We want an abstraction that is as compact as possible, but preserves the properties we are interested in An abstraction that is “too loose” is not useful: too many false alarms

Conservative analysis Iterative process of model checking and abstraction refinement Verification is now semi-decidable!

Under-approximations Is under-approximation a useful abstraction technique? Yes, but not as common Testing Abstract the set of executions to the (equivalence class of) tested executions Found a bug – it is real! There is always one more bug…

Abstract interpretation A framework for abstraction P. Cousot and R. Cousot ( ) NOT constructive Offers means of proving an abstraction Does not help finding an abstraction Mathematically captured as Galois connections

Galois connections A and C are partially ordered sets α is the abstraction function γ is the concretization function Always an over-approximation:

Classical example Abstract sets of integers as intervals C : Sets of integers ordered by inclusion A : Intervals with integer boundaries [i 1,i 2 ] (i 1 ≤i 2 ) ordered by “lies within” relation α : Set M  [min(M),max(M)] γ : [i 1,i 2 ]  {i 1,i 1 +1,…,i 2 } {1,4,5} {1,2,3,4,5} [1,5] C A α γ ∩

Fixpoint abstraction In behavioral models, concrete and abstract domains are often sets of states Most analysis algorithms involve fixpoint computation We want to compute abstract fixpoints and make concrete conclusions C and A are complete lattices F is a monotonic function on C Abstract fixpoint is an overapproximation

State-to-state abstraction Partition concrete states into disjoint sets Map sets of states to abstract states α : s  [s] Initial abstract states: an abstract state contains a concrete initial state Abstract transition: s  t implies [s]  [t]

go stop go stop Example Map “yellow” and “red” to “stop” Map “green” to “go” Transitions: go  stop stop  go stop  stop

What do we preserve? go stop go stop Every execution of the full model can be simulated by an execution of the reduced one. Every LTL property that holds in the reduced model hold in the full one.

Properties Preserved: [](go->O stop) Not preserved: []<>go go stop go stop

Predicate abstraction The concrete state space is partitioned according to a set of predicates. Example: Is the right state reachable? Predicates: x<5,x==5

Predicate abstraction Predicates define partitioning of the state space Add transitions according to predicates Property fails!

Predicate abstraction Counterexample is fake! Refine abstraction: add predicates New predicate: x is even Property is true!

Symmetry A permutation is a one-one and onto function p:A->A. For example, 1->3, 2->4, 3->1, 4->5, 5->2. One can combine permutations, e.g., p1: 1->3, 2->1, 3->2 p2: 1->2, 2->1, 3->3 1->3, 2->2, 3->1 A set of permutations is called a symmetry group.

Using symmetry in analysis Want to find some symmetry group such that for each permutation p in it, R(s,t) if and only if R(p(s), p(t)) and L(p(s))=L(s). Let K(s) be all the states that can be permuted to s. This is a set of states such that each one can be permuted to the other.

Turn=0 L0,L1 Turn=0 L0,NC1 Turn=0 NC0,L1 Turn=0 CR0,NC1 Turn=0 NC0,NC1 Turn=0 CR0,L1 Turn=1 L0,CR1 Turn=1 NC0,CR1 Turn=1 L0,NC1 Turn=1 NC0,NC1 Turn=1 NC0,L1 Turn=1 L0,L1 init

Turn=0 L0,L1 Turn=0 L0,NC1 Turn=0 NC0,L1 Turn=0 CR0,NC1 Turn=0 NC0,NC1 Turn=0 CR0,L1 init The quotient model

Partial order reduction With independent transitions, you do not have to explore all transitions to prove a property