© 2015 Carnegie Mellon University Parametric Symbolic Reachability Software Engineering Institute Carnegie Mellon University Pittsburgh, PA 15213 Arie.

Slides:



Advertisements
Similar presentations
SMELS: Sat Modulo Equality with Lazy Superposition Christopher Lynch – Clarkson Duc-Khanh Tran - MPI.
Advertisements

The behavior of SAT solvers in model checking applications K. L. McMillan Cadence Berkeley Labs.
A practical and complete approach to predicate abstraction Ranjit Jhala UCSD Ken McMillan Cadence Berkeley Labs.
Quantified Invariant Generation using an Interpolating Saturation Prover Ken McMillan Cadence Research Labs TexPoint fonts used in EMF: A A A A A.
Automated Theorem Proving Lecture 1. Program verification is undecidable! Given program P and specification S, does P satisfy S?
Carnegie Mellon University Software Engineering Institute CERT® Knowledgebase Copyright © 1997 Carnegie Mellon University VU#14202 UNIX rlogin with stack.
© 2013 Carnegie Mellon University UFO: From Underapproximations to Overapproximations and Back! Arie Gurfinkel (SEI/CMU) with Aws Albarghouthi and Marsha.
Satisfiability Modulo Theories (An introduction)
SMT Solvers (an extension of SAT) Kenneth Roe. Slide thanks to C. Barrett & S. A. Seshia, ICCAD 2009 Tutorial 2 Boolean Satisfiability (SAT) ⋁ ⋀ ¬ ⋁ ⋀
© Anvesh Komuravelli Quantified Invariants in Rich Domains using Model Checking and Abstract Interpretation Anvesh Komuravelli, CMU Joint work with Ken.
© 2011 Carnegie Mellon University System of Systems V&V John B. Goodenough October 19, 2011.
Logic as the lingua franca of software verification Ken McMillan Microsoft Research TexPoint fonts used in EMF: A A A A A Joint work with Andrey Rybalchenko.
© 2010 Carnegie Mellon University B OXES : A Symbolic Abstract Domain of Boxes Arie Gurfinkel and Sagar Chaki Software Engineering Institute Carnegie Mellon.
© Anvesh Komuravelli IC3/PDR Overview of IC3/PDR Anvesh Komuravelli Carnegie Mellon University.
© 2015 Carnegie Mellon University The SeaHorn Verification Framework Software Engineering Institute Carnegie Mellon University Pittsburgh, PA Arie.
Panel on Decision Procedures Panel on Decision Procedures Randal E. Bryant Lintao Zhang Nils Klarlund Harald Ruess Sergey Berezin Rajeev Joshi.
© 2013 Carnegie Mellon University Academy for Software Engineering Education and Training, 2013 Session Architect: Tony Cowling Session Chair: Nancy Mead.
© 2013 Carnegie Mellon University Measuring Assurance Case Confidence using Baconian Probabilities Charles B. Weinstock John B. Goodenough Ari Z. Klein.
© 2012 Carnegie Mellon University UFO: Verification with Interpolants and Abstract Interpretation Arie Gurfinkel and Sagar Chaki Software Engineering Institute.
© 2010 Carnegie Mellon University Acquisition Implications of SOA Adoption Software Engineering Institute Carnegie Mellon University Pittsburgh, PA
© 2015 Carnegie Mellon University Property Directed Polyhedral Abstraction Nikolaj Bjørner and Arie Gurfinkel VMCAI 2015.
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:
© 2011 Carnegie Mellon University Binary Decision Diagrams Part Bug Catching: Automated Program Verification and Testing Sagar Chaki September.
Constraint Logic Programming Ryan Kinworthy. Overview Introduction Logic Programming LP as a constraint programming language Constraint Logic Programming.
Nikolaj Bjørner Microsoft Research Lecture 3. DayTopicsLab 1Overview of SMT and applications. SAT solving, Z3 Encoding combinatorial problems with Z3.
© 2011 Carnegie Mellon University Should-Cost: A Use for Parametric Estimates Additional uses for estimation tools Presenters:Bob Ferguson (SEMA) Date:November.
Sanjit A. Seshia and Randal E. Bryant Computer Science Department
© 2011 Carnegie Mellon University QUELCE: Quantifying Uncertainty in Early Lifecycle Cost Estimation Presenters:Dave Zubrow PhD Bob Ferguson (SEMA) Date:November.
Pruning techniques for the SAT-based Bounded Model-Checking problem Ofer Shtrichman Weizmann Institute of Science & IBM - HRL.
Invisible Invariants: Underapproximating to Overapproximate Ken McMillan Cadence Research Labs TexPoint fonts used in EMF: A A A A A.
Ofer Strichman, Technion Deciding Combined Theories.
1 First order theories. 2 Satisfiability The classic SAT problem: given a propositional formula , is  satisfiable ? Example:  Let x 1,x 2 be propositional.
Ipek Ozkaya, COCOMO Forum © 2012 Carnegie Mellon University Affordability and the Value of Architecting Ipek Ozkaya Research, Technology.
Deciding a Combination of Theories - Decision Procedure - Changki pswlab Combination of Theories Daniel Kroening, Ofer Strichman Presented by Changki.
© 2015 Carnegie Mellon University Building Program Verifiers from Compilers and Theorem Provers Software Engineering Institute Carnegie Mellon University.
Constraint-based Invariant Inference. Invariants Dictionary Meaning: A function, quantity, or property which remains unchanged Property (in our context):
© 2015 Carnegie Mellon University Interpolating Property Directed Reachability Software Engineering Institute Carnegie Mellon University Pittsburgh, PA.
© 2015 Carnegie Mellon University Building Program Verifiers from Compilers and Theorem Provers Software Engineering Institute Carnegie Mellon University.
© 2013 Carnegie Mellon University Verifying Periodic Programs with Priority Inheritance Locks Sagar Chaki 1, Arie Gurfinkel 1, Ofer Strichman 2 FMCAD,
SAT and SMT solvers Ayrat Khalimov (based on Georg Hofferek‘s slides) AKDV 2014.
1 Automatic Non-interference Lemmas for Parameterized Model Checking Jesse Bingham, Intel DEG FMCAD 2008.
© 2015 Carnegie Mellon University Algorithmic Logic-Based Verification with SeaHorn Software Engineering Institute Carnegie Mellon University Pittsburgh,
© 2014 Carnegie Mellon University Synthesizing Safe Bit-Precise Invariants Arie Gurfinkel (SEI / CMU) Anton Belov (UCD / Synopsys) Joao Marques-Silva (UCD)
Proving Non-Termination Gupta, Henzinger, Majumdar, Rybalchenko, Ru-Gang Xu presentation by erkan.
Author Software Engineering Institute
Symbolic and Concolic Execution of Programs Information Security, CS 526 Omar Chowdhury 10/7/2015Information Security, CS 5261.
1 Reasoning with Infinite stable models Piero A. Bonatti presented by Axel Polleres (IJCAI 2001,
© 2015 Carnegie Mellon University COCOMO 2015 November 17, 2015 Distribution Statement A: Approved for Public Release; Distribution is Unlimited Causal.
Daniel Kroening and Ofer Strichman Decision Procedures An Algorithmic Point of View Deciding Combined Theories.
CS357 Lecture 13: Symbolic model checking without BDDs Alex Aiken David Dill 1.
© Anvesh Komuravelli Spacer Compositional Verification of Procedural Programs using Horn Clauses over Integers and Arrays Anvesh Komuravelli work done.
© Anvesh Komuravelli Spacer Model Checking with Proofs and Counterexamples Anvesh Komuravelli Carnegie Mellon University Joint work with Arie Gurfinkel,
1 CERT BFF: From Start To PoC June 09, 2016 © 2016 Carnegie Mellon University This material has been approved for public release and unlimited distribution.
Satisfiability Modulo Theories and DPLL(T) Andrew Reynolds March 18, 2015.
Secure Software Workforce Development Panel Session
David Svoboda & Aaron Ballman
Author Software Engineering Institute
Michael Spiegel, Esq Timothy Shimeall, Ph.D.
Opeoluwa Matthews, Jesse Bingham, Daniel Sorin
Solving Constrained Horn Clauses by Property Directed Reachability
Interpolating Property Directed Reachability
SMT-Based Verification of Parameterized Systems
Solving Linear Arithmetic with SAT-based MC
Parametric Symbolic Reachability
Automating Induction for Solving Horn Clauses
Introduction to Software Verification
Metrics-Focused Analysis of Network Flow Data
Lifting Propositional Interpolants to the Word-Level
QUELCE: Quantifying Uncertainty in Early Lifecycle Cost Estimation
Verifying Periodic Programs with Priority Inheritance Locks
Presentation transcript:

© 2015 Carnegie Mellon University Parametric Symbolic Reachability Software Engineering Institute Carnegie Mellon University Pittsburgh, PA Arie Gurfinkel ongoing work with Sharon Shoham-Buchbinder

2 Parametric Symbolic Reachability Gurfinkel, 2015 © 2015 Carnegie Mellon University Copyright 2015 Carnegie Mellon University This material is based upon work funded and supported by the Department of Defense under Contract No. FA C-0003 with Carnegie Mellon University for the operation of the Software Engineering Institute, a federally funded research and development center. Any opinions, findings and conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the United States Department of Defense. NO WARRANTY. THIS CARNEGIE MELLON UNIVERSITY AND SOFTWARE ENGINEERING INSTITUTE MATERIAL IS FURNISHED ON AN “AS-IS” BASIS. CARNEGIE MELLON UNIVERSITY MAKES NO WARRANTIES OF ANY KIND, EITHER EXPRESSED OR IMPLIED, AS TO ANY MATTER INCLUDING, BUT NOT LIMITED TO, WARRANTY OF FITNESS FOR PURPOSE OR MERCHANTABILITY, EXCLUSIVITY, OR RESULTS OBTAINED FROM USE OF THE MATERIAL. CARNEGIE MELLON UNIVERSITY DOES NOT MAKE ANY WARRANTY OF ANY KIND WITH RESPECT TO FREEDOM FROM PATENT, TRADEMARK, OR COPYRIGHT INFRINGEMENT. This material has been approved for public release and unlimited distribution. This material may be reproduced in its entirety, without modification, and freely distributed in written or electronic form without requesting formal permission. Permission is required for any other use. Requests for permission should be directed to the Software Engineering Institute at DM

3 Parametric Symbolic Reachability Gurfinkel, 2015 © 2015 Carnegie Mellon University SYMBOLIC REACHABILITY

4 Parametric Symbolic Reachability Gurfinkel, 2015 © 2015 Carnegie Mellon University Symbolic Reachability Problem P = (V, Init, Tr, Bad) P is UNSAFE if and only if there exists a number N s.t. P is SAFE if and only if there exists a safe inductive invariant Inv s.t. Inductive Safe

5 Parametric Symbolic Reachability Gurfinkel, 2015 © 2015 Carnegie Mellon University Constrained Horn Clauses (CHC) A Constrained Horn Clause (CHC) is a FOL formula of the form 8 V. (Á Æ p 1 [X 1 ] Æ…Æ p n [X n ]  h[X]), where Á is a constrained in the background theory A A is a combined theory of Linear Arithmetic, Arrays, Bit- Vectors, … p 1, …, p n, h are n-ary predicates p i [X] is an application of a predicate to first-order terms

6 Parametric Symbolic Reachability Gurfinkel, 2015 © 2015 Carnegie Mellon University CHC Terminology Ruleh[X] à p 1 [X 1 ],…, p n [X n ], Á. Queryfalse à p 1 [X 1 ],…, p n [X n ], Á. Facth[X] à Á. Linear CHCh[X] à p[X 1 ], Á. Non-Linear CHC h[X] à p 1 [X 1 ],…, p n [X n ], Á. for n > 1 head body constraint

7 Parametric Symbolic Reachability Gurfinkel, 2015 © 2015 Carnegie Mellon University Example Horn Encoding

8 Parametric Symbolic Reachability Gurfinkel, 2015 © 2015 Carnegie Mellon University CHC Satisfiability A model of a set of clauses ¦ is an interpretation of each predicate p i that makes all clauses in ¦ valid A set of clauses is satisfiable if it has a model, otherwise unsatisfiable A model is A-definable, it each p i is definable by a formula à i in A In the context of program verification a program satisfies a property iff corresponding CHCs are satisfiable verification certificates correspond to models of CHC counterexamples correspond to derivations of false

9 Parametric Symbolic Reachability Gurfinkel, 2015 © 2015 Carnegie Mellon University Spacer: Solving CHC in Z3 Spacer: a solver for SMT-constrained Horn Clauses stand-alone implementation in a fork of Z3 Support for Non-Linear CHC model procedure summaries in inter-procedural verification conditions model assume-guarantee reasoning uses MBP to under-approximate models for finite unfoldings of predicates uses MAX-SAT to decide on an unfolding strategy Supported SMT-Theories Best-effort support for arbitrary SMT-theories – data-structures, bit-vectors, non-linear arithmetic Full support for Linear arithmetic (rational and integer) Quantifier-free theory of arrays – only quantifier free models with limited applications of array equality

10 Parametric Symbolic Reachability Gurfinkel, 2015 © 2015 Carnegie Mellon University

11 Parametric Symbolic Reachability Gurfinkel, 2015 © 2015 Carnegie Mellon University PARAMETRIC SYMBOLIC REACHABILITY

12 Parametric Symbolic Reachability Gurfinkel, 2015 © 2015 Carnegie Mellon University What we want to do … A. Cohen, K. S. Namjoshi: Local proofs for global safety properties. FMSD 34(2): (2009)

13 Parametric Symbolic Reachability Gurfinkel, 2015 © 2015 Carnegie Mellon University What we want to do …

14 Parametric Symbolic Reachability Gurfinkel, 2015 © 2015 Carnegie Mellon University Parametric Symbolic Reachability Problem T = ( v, Init(v), Tr(i, N, v, v’), Bad (v) ) v is a set of state variables – each v k 2 v is a map Nat  Rat – v is partitioned into Local(v) and Global(v) Init(v) and Bad(v) are initial and bad states, respectively Tr(i, N, v, v’) is a transition relation, parameterized by a process identifier i and total number of processes N All formulas are over the combined theories of arrays and LRA Init(v) and Bad(v) contain at most 2 quantifiers Init(v) = 8 x,y.  Init (x, y, v), where  Init is quantifier free (QF) Bad(v) = 8 x,y.  Bad (x, y, v), where  Bad is QF Tr contains at most 1 quantifier Tr(i, N, v, v’) = 8 j. ½ (i, j, N, v, v’)

15 Parametric Symbolic Reachability Gurfinkel, 2015 © 2015 Carnegie Mellon University A State of a Parametric System

16 Parametric Symbolic Reachability Gurfinkel, 2015 © 2015 Carnegie Mellon University Extra restrictions on the transition relation Parametricity Tr depends only on first N entries of each state variable Locality Tr does not modify local variables of other proceses (Optional) Single-writer Every state-variable (including global) is written by exactly one process

17 Parametric Symbolic Reachability Gurfinkel, 2015 © 2015 Carnegie Mellon University Parametric Symbolic Reachability T = (v, Init, Tr, Bad) T is UNSAFE if and only if there exists a number K s.t. T is SAFE if and only if there exists a safe inductive invariant Inv s.t. Safe(T)

18 Parametric Symbolic Reachability Gurfinkel, 2015 © 2015 Carnegie Mellon University Parametric vs Non-Parametric Reachability Init, Bad, and Tr might contain quantifiers e.g., “ALL processes start in unique locations” e.g., “only make a step if ALL other processes are ok” e.g., “EXIST two distinct process in a critical section” Inv cannot be assumed to be quantifier free QF Inv is either non-parametric or trivial Decide existence of quantified models for CHC stratify search by the number of quantifiers models with 1 quantifier, 2 quantifiers, 3 quantifiers, etc… Safe(T)

19 Parametric Symbolic Reachability Gurfinkel, 2015 © 2015 Carnegie Mellon University ONE QUANTIFIER TWO QUANTIFIER

20 Parametric Symbolic Reachability Gurfinkel, 2015 © 2015 Carnegie Mellon University One Quantifier (Solution) Claim If Safe 1 (T) is QF-SAT then Safe(T) is SAT If Tr does not contain functions that range over PIDs, then Safe 1 (T) is QF- SAT only if Safe(T) admits a model definable with a single quantifier Safe 1 (T) is essentially Owicki-Gries for 2 processes i and j If Tr is single-writer then the 3 rd rule is not needed get linear CHC Safe 1 (T)

21 Parametric Symbolic Reachability Gurfinkel, 2015 © 2015 Carnegie Mellon University One Quantifier explained (induction rule) ( plug 8j.Inv 1 (j, v) for Inv(v) ) ( instantiate j by k and i ) Unless Tr contains other PIDs, no other instantiations are possible Split into two rules using i=k If Tr contains quantifiers, they can be instantiated using i and k as well

22 Parametric Symbolic Reachability Gurfinkel, 2015 © 2015 Carnegie Mellon University Two Quantifier (Solution) Claim assume that Tr satisfies single-writer, then If Safe 2 (T) is QF-SAT then Safe(T) is SAT If Tr does not contain functions that range over PIDs, then Safe 2 (T) is QF- SAT only if Safe(T) admits a model definable with at most two quantifier Single-writer => linear CHC still working out good solution for general case Safe 2 (T)

23 Parametric Symbolic Reachability Gurfinkel, 2015 © 2015 Carnegie Mellon University Symmetric Models Definition A formula  (x,y) is symmetric in (x,y) iff  (x,y),  (y,x) Claim A set of CHC S admits a quantified model of the form 8 x, y. M(x, y) iff S admits a quantified model of the form 8 x, y. x  y ) H(x,y), where H(x,y) is symmetric in (x, y) (assuming that the sort of x,y is ¸ 2)

24 Parametric Symbolic Reachability Gurfinkel, 2015 © 2015 Carnegie Mellon University Two Quantifier Explained (induction rule) (plug 8x,y.x  y ) Inv 2 (x,y,v) for Inv(v) ) (by symmetry, only need 3 instantiations (h,j), (i, h), (i, j)) (split based on i  hÆi  j, i  h, i  j )

25 Parametric Symbolic Reachability Gurfinkel, 2015 © 2015 Carnegie Mellon University Two quantifiers explained (cont’d) single-writer duplicate symmetry

26 Parametric Symbolic Reachability Gurfinkel, 2015 © 2015 Carnegie Mellon University Two Quantifiers (repeated) Claim assume that Tr satisfies single-writer, then If Safe 2 (T) is QF-SAT then Safe(T) is SAT If Tr does not contain functions that range over PIDs, then Safe 2 (T) is QF- SAT only if Safe(T) admits a model definable with at most two quantifier Single-writer => linear CHC still working out good solution for general case Safe 2 (T)

27 Parametric Symbolic Reachability Gurfinkel, 2015 © 2015 Carnegie Mellon University What we can do now Peterson’s protocol and similar small protocols Input problem T Init, Transition, and Bad in (extension of) SMT-LIB format over combined theory of Linear Arithmetic and Arrays Generate Constrained Horn Clauses Safe 1 (T) or Safe 2 (T) Solve using QF CHC solver Spacer works for small protocols

28 Parametric Symbolic Reachability Gurfinkel, 2015 © 2015 Carnegie Mellon University Related Work Kedar Namjoshi et al. Local Proofs for Global Safety Properties, and many other papers systematic derivation of proof rules for concurrent systems finite state and fixed number of processes Andrey Rybalchenko et al. Compositional Verification of Multi-Threaded Programs, and others compositional proof rules for concurrent systems are CHC infinite state and fixed number of processes Lenore Zuck et al. Invisible Invariants finite state and parametric number of processes finite model theorem for special classes of parametric systems Nikolaj Bjørner, Kenneth L. McMillan, and Andrey Rybalchenko On Solving Universally Quantified Horn Clauses. SAS 2013:

29 Parametric Symbolic Reachability Gurfinkel, 2015 © 2015 Carnegie Mellon University Conclusion Parametric Verification == Quantified Models for CHC Quantifier instantiation to systematically derive proof rules for verification of safety properties of parametric systems parametric systems definable with SMT-LIB syntax Lazy vs Eager Quantifier Instantiation eager instantiation in this talk “easy” to extend to lazy / dynamic / model-based instantiation Connections with other work in parametric verification complete instantiation = decidability ? relative completeness …

30 Parametric Symbolic Reachability Gurfinkel, 2015 © 2015 Carnegie Mellon University

31 Parametric Symbolic Reachability Gurfinkel, 2015 © 2015 Carnegie Mellon University Contact Information Arie Gurfinkel, Ph. D. Sr. Researcher CSC/SSD Telephone: U.S. Mail Software Engineering Institute Customer Relations 4500 Fifth Avenue Pittsburgh, PA USA Web Customer Relations Telephone: SEI Phone: SEI Fax: