SMT-Based Verification of Parameterized Systems

Slides:



Advertisements
Similar presentations
Model Checking Base on Interoplation
Advertisements

SMELS: Sat Modulo Equality with Lazy Superposition Christopher Lynch – Clarkson Duc-Khanh Tran - MPI.
Functional Decompositions for Hardware Verification With a few speculations on formal methods for embedded systems Ken McMillan.
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?
Quantified Invariant Generation using an Interpolating Saturation Prover Ken McMillan Cadence Research Labs TexPoint fonts used in EMF: A A A A A.
Software Model Checking with SMT Ken McMillan Microsoft Research TexPoint fonts used in EMF: A A A A A.
50.530: Software Engineering
N-Consensus is the Second Strongest Object for N+1 Processes Eli Gafni UCLA Petr Kuznetsov Max Planck Institute for Software Systems.
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) ⋁ ⋀ ¬ ⋁ ⋀
Automatic Verification Book: Chapter 6. What is verification? Traditionally, verification means proof of correctness automatic: model checking deductive:
Hybrid Systems Presented by: Arnab De Anand S. An Intuitive Introduction to Hybrid Systems Discrete program with an analog environment. What does it mean?
© Anvesh Komuravelli Quantified Invariants in Rich Domains using Model Checking and Abstract Interpretation Anvesh Komuravelli, CMU Joint work with Ken.
Panel on Decision Procedures Panel on Decision Procedures Randal E. Bryant Lintao Zhang Nils Klarlund Harald Ruess Sergey Berezin Rajeev Joshi.
Weizmann Institute Deciding equality formulas by small domain instantiations O. Shtrichman The Weizmann Institute Joint work with A.Pnueli, Y.Rodeh, M.Siegel.
Constraint Logic Programming Ryan Kinworthy. Overview Introduction Logic Programming LP as a constraint programming language Constraint Logic Programming.
Solving Partial Order Constraints for LPO termination.
Induction Sections 4.1 and 4.2 of Rosen Fall 2010
Sanjit A. Seshia and Randal E. Bryant Computer Science Department
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.
Methods of Proof & Proof Strategies
Deciding a Combination of Theories - Decision Procedure - Changki pswlab Combination of Theories Daniel Kroening, Ofer Strichman Presented by Changki.
Induction and recursion
Constraint-based Invariant Inference. Invariants Dictionary Meaning: A function, quantity, or property which remains unchanged Property (in our context):
MATH 224 – Discrete Mathematics
SAT and SMT solvers Ayrat Khalimov (based on Georg Hofferek‘s slides) AKDV 2014.
The Relational Model: Relational Calculus
1 Automatic Non-interference Lemmas for Parameterized Model Checking Jesse Bingham, Intel DEG FMCAD 2008.
Declarative vs Procedural Programming  Procedural programming requires that – the programmer tell the computer what to do. That is, how to get the output.
Inferring Synchronization under Limited Observability Martin Vechev, Eran Yahav, Greta Yorsh IBM T.J. Watson Research Center (work in progress)
Predicate Abstraction. Abstract state space exploration Method: (1) start in the abstract initial state (2) use to compute reachable states (invariants)
1 First order theories (Chapter 1, Sections 1.4 – 1.5) From the slides for the book “Decision procedures” by D.Kroening and O.Strichman.
© 2015 Carnegie Mellon University Parametric Symbolic Reachability Software Engineering Institute Carnegie Mellon University Pittsburgh, PA Arie.
DEDUCTION PRINCIPLES AND STRATEGIES FOR SEMANTIC WEB Chain resolution and its fuzzyfication Dr. Hashim Habiballa University of Ostrava.
1 Reasoning with Infinite stable models Piero A. Bonatti presented by Axel Polleres (IJCAI 2001,
Daniel Kroening and Ofer Strichman Decision Procedures An Algorithmic Point of View Deciding Combined Theories.
AN INTERPOLATING THEOREM PROVER K.L. McMillan Cadence Berkley Labs.
CS357 Lecture 13: Symbolic model checking without BDDs Alex Aiken David Dill 1.
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
Daniel Kroening and Ofer Strichman 1 Decision Procedures An Algorithmic Point of View Basic Concepts and Background.
1 Simulating Reachability using First-Order Logic with Applications to Verification of Linked Data Structures Tal Lev-Ami 1, Neil Immerman 2, Tom Reps.
Satisfiability Modulo Theories and DPLL(T) Andrew Reynolds March 18, 2015.
Mostly-Automated Verification of Low-Level Programs in Computational Separation Logic Adam Chlipala Harvard University PLDI 2011.
Logical path planning Róbert Baláž Technical University of Košice
Logical Inference 2 Rule-based reasoning
Hybrid BDD and All-SAT Method for Model Checking
Opeoluwa Matthews, Jesse Bingham, Daniel Sorin
Learning Invariants using Decision Trees and Implication Counterexamples Pranav Garg Amazon India.
(State) Model-Based Approaches I Software Specification Lecture 35
Solving Constrained Horn Clauses by Property Directed Reachability
SS 2017 Software Verification Software Model Checking 2 - Parallelism
Revisiting Predicate Logic LN chapters 3,4
Solving Linear Arithmetic with SAT-based MC
Parametric Symbolic Reachability
Logical Inference 2 Rule-based reasoning
Automating Induction for Solving Horn Clauses
Satisfiability Modulo Theories
Lifting Propositional Interpolants to the Word-Level
Inferring Simple Solutions to Recursion-free Horn Clauses via Sampling
Property Directed Reachability with Word-Level Abstraction
Over-Approximating Boolean Programs with Unbounded Thread Creation
A Brief Summary for Exam 1
Advanced consistency methods Chapter 8
Search techniques.
This Lecture Substitution model
Representations & Reasoning Systems (RRS) (2.2)
Invertibility Conditions for Floating Point Formulas
Presentation transcript:

SMT-Based Verification of Parameterized Systems Author Software Engineering Institute 9/4/2018 SMT-Based Verification of Parameterized Systems Arie Gurfinkel, Sharon Shoham, and Yuri Mesham Title Slide Title and Subtitle text blocks should not be moved from their position if at all possible.

Parameterized Verification System(s) P1, P2, … PN ∀ i . Pi⊧ φ Parameterized Model Checker Property φ ¬(∀ i . Pi ⊧ φ)

Our Contributions Verification Condition for Safety Properties of Parameterized Systems expressed as Constrained Horn Clauses (CHC) infinite state transition relation expressed in SMT (arithmetic + arrays) invariants/models expressed as (universally) quantified first order formulae Proof-rules for inferring Universally Quantified Invariants generalizes Owicki-Gries proof scheme to k processes systematically derived from the VC above Decision procedure for specialized finite-data sub-classes Prototype implementation in Python verification of small (in code) infinite state protocols with no finite state abs. bakery, ticket, dining philosophers,…

Symbolic reachability

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

Constrained Horn Clauses (CHC) A Constrained Horn Clause (CHC) is a FOL formula of the forms ∀ V . (φ ∧ p1[X1] ∧ … ∧ pn[Xn] → pn+1[X]) ∀ V . (φ ∧ p1[X1] ∧ … ∧ pn[Xn] → false) where φ is a constraint in a background theory A usually, A is the combined theory of Linear Arithmetic, Arrays, Bit-Vectors, … p1, …, pn+1 are n-ary predicates pi[X] is an application of a predicate to first-order terms

Spacer: Solving SMT-constrained CHC Spacer: a solver for SMT-constrained Horn Clauses stand-alone implementation in a fork of Z3 http://bitbucket.org/spacer/code 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

Parametrized Symbolic reachability

Motivation: Collision Avoidance Protocol

Parameterized Symbolic Reachability Problem T = ( v, Init(N,v), Tr(i, N, v, v’), Bad (N,v) ) v is a set of state variables each vk ∈ v is a map Nat→Rat v is partitioned into Local(v) and Global(v) Init(N,v) and Bad(N,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(N,v) and Bad(N,v) contain at most 2 quantifiers Init(N,v) = ∀ x,y . φInit(N, x, y, v), where φInit is quantifier free (QF) Bad(N,v) = ∀ x,y . φBad(N, x, y, v), where φBad is QF Tr contains at most 1 quantifier Tr(i, N, v, v’) = ∀ j . ρ (i, j, N, v, v’)

A State of a Parameterized System Global v0 v1 v2 v3 PID Local v4 v5 v6 v7 1 2 3 4 5 6 … N

Parameterized 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. VC(T)

Parameterized vs Non-Parameterized Reachability VC(T) 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 solution for CHC stratify search by the number of quantifiers solutions with 1 quantifier, 2 quantifiers, 3 quantifiers, etc…

One quantifier two quantifier

One Quantifier (Solution) VC1(T) Theorem If VC1(T) is QF-SAT then VC(T) is SAT If Tr does not contain functions that range over PIDs, then VC1(T) is QF-SAT only if VC(T) admits a solution definable by a simple single quantifier formula simple == quantified id variables do not appear as arguments to functions VC1(T) is essentially Owicki-Gries for 2 processes i and j If there are no global variables then (3) is unnecessary VC1(T) is linear

How do we get it 1. Restrict Inv to a fixed number of quantifiers e.g., replace Inv(N, v) with ∀k.Inv1(k, N, v) 2. Case split consecution Horn clause based on the process that makes the move w+1 cases for w-quantifiers one for each quantified id variable one for interference by “other” process (only for global variables) 3. Instantiate the universal quantifier in ∀k.Inv1(k, N, v) use symmetry to reduce the space of instantiations 4. Other instantiations might be needed for quantifiers if id variables appear as arguments to functions

How do we get it Restrict Cases Instantiate

Two Quantifier Solution Theorem If VC2(T) is QF-SAT then VC(T) is SAT If Tr does not contain functions that range over PIDs, then VC2(T) is QF-SAT only if VC(T) admits a solution definable by a simple two quantifier formula At least 2 quantifiers are “needed” for systems with global guards Extends to k-quantifiers

Ticket Protocol Thinking Hungry Eating self.t:=ticket ticket:=ticket+1 [self.t=serving] serving:=self.t+1 INIT: pc=Thinking, ticket=0, serving=0 BAD: self.pc=Eating, other.pc=Eating

Discovered Invariant

Putting it all together Solve for Inductive Invariant Look for bugs

Finite vs Infinite Number of Processes Init b[i] and move to pc=D Move to pc=E when all distinctly init Tr does not depend on N (number of processes) Safe for infinitely many processes. Invariant is: Unsafe for N = 2!

Conclusion Parameterized Verification == Quantified solutions for CHC Quantifier instantiation to systematically derive proof rules for verification of safety properties of parameterized systems Parameterized systems definable with SMT-LIB syntax Lazy vs Eager Quantifier Instantiation eager instantiation in this talk would be good to extend to lazy / dynamic / model-based instantiation Connections with other work in parameterized verification complete instantiation = decidability ? relative completeness …

? ?