Ken McMillan Microsoft Research

Slides:



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

An Introduction to Calculus. Calculus Study of how things change Allows us to model real-life situations very accurately.
Evaluation and Validation
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.
Consequence Generation, Interpolants, and Invariant Discovery Ken McMillan Cadence Berkeley Labs.
Demand-driven inference of loop invariants in a theorem prover
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.
Maximal Independent Subsets of Linear Spaces. Whats a linear space? Given a set of points V a set of lines where a line is a k-set of points each pair.
Modeling issues Book: chapters 4.12, 5.4, 8.4, 10.1.
Rule Learning – Overview Goal: learn transfer rules for a language pair where one language is resource-rich, the other is resource-poor Learning proceeds.
Abstraction in Model Checking Nishant Sinha. Model Checking Given a: –Finite transition system M –A temporal property p The model checking problem: –Does.
Sublinear Algorithms … Lecture 23: April 20.
Weighted Matching-Algorithms, Hamiltonian Cycles and TSP
PROLOG MORE PROBLEMS.
Bank Accounts Management System - p. 448
Complexity Theory Lecture 6
CS 473Lecture X1 CS473-Algorithms I Lecture X Dynamic Tables.
CSci 4011 INHERENT LIMITATIONS OF COMPUTER PROGRAMS.
Error-Correcting codes
Outcome: Determine the square root of perfect squares.
1 Decision Procedures An algorithmic point of view Equality Logic and Uninterpreted Functions.
Boolean Satisfiability The most fundamental NP-complete problem, and now a powerful technology for solving many real world problems.
Software Model Checking with SMT Ken McMillan Microsoft Research TexPoint fonts used in EMF: A A A A A.
Shortest Vector In A Lattice is NP-Hard to approximate
2 x0 0 12/13/2014 Know Your Facts!. 2 x1 2 12/13/2014 Know Your Facts!
2 x /18/2014 Know Your Facts!. 11 x /18/2014 Know Your Facts!
2 x /10/2015 Know Your Facts!. 8 x /10/2015 Know Your Facts!
C&O 355 Mathematical Programming Fall 2010 Lecture 6 N. Harvey TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: AA A A.
1 Lecture 5 PRAM Algorithm: Parallel Prefix Parallel Computing Fall 2008.
A man-machine human interface for a special device of the pervasive computing world B. Apolloni, S. Bassis, A. Brega, S. Gaito, D. Malchiodi, A.M. Zanaboni.
5 x4. 10 x2 9 x3 10 x9 10 x4 10 x8 9 x2 9 x4.
1 The Restaurant Domain Will they wait, or not?. 2 Decision Trees Patrons? NoYesWaitEst? No Alternate?Hungry?Yes Reservation?Fri/Sat?Alternate?Yes NoYesBar?Yes.
MS 101: Algorithms Instructor Neelima Gupta
RSES – reducts and discretization of attributes presented by Zbigniew W. Ras University of North Carolina, Charlotte, NC & Warsaw University of Technology,
The Problem of K Maximum Sums and its VLSI Implementation Sung Eun Bae, Tadao Takaoka University of Canterbury Christchurch New Zealand.
Multiplication Facts Practice
Spatial Information Systems (SIS) COMP Spatial data structures (1)
Constraint Optimization We are interested in the general non-linear programming problem like the following Find x which optimizes f(x) subject to gi(x)
Variational Inference Amr Ahmed Nov. 6 th Outline Approximate Inference Variational inference formulation – Mean Field Examples – Structured VI.
Chapter 8: The Solver and Mathematical Programming Spreadsheet-Based Decision Support Systems Prof. Name Position (123) University.
COMP9314Xuemin Continuously Maintaining Order Statistics Over Data Streams Lecture Notes COM9314.
Graeme Henchel Multiples Graeme Henchel
Low Power and Low Area Transform–Quant & Inverse Quant–Inverse Transform Hardware Design for H.264 Encoder.
The Project Problem formulation (one page) Literature review –“Related work" section of final paper, –Go to writing center, –Present paper(s) to class.
0 x x2 0 0 x1 0 0 x3 0 1 x7 7 2 x0 0 9 x0 0.
Introduction to Formal Methods for SW and HW Development 09: SAT Based Abstraction/Refinement in Model-Checking Roberto Sebastiani Based on work and slides.
Program Verification -- new recipe for old problem Zhou Chaochen Institute of Software, CAS
1 How to transform an analyzer into a verifier. 2 OUTLINE OF THE LECTURE a verification technique which combines abstract interpretation and Park’s fixpoint.
Timed Automata.
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.
Chapter 10: Estimating with Confidence
Rigorous Software Development CSCI-GA Instructor: Thomas Wies Spring 2012 Lecture 13.
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:
1 Basic abstract interpretation theory. 2 The general idea §a semantics l any definition style, from a denotational definition to a detailed interpreter.
Counterexample-Guided Focus TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: AAA A A A AA A A Thomas Wies Institute of.
Near-Optimal Network Design with Selfish Agents By Elliot Anshelevich, Anirban Dasgupta, Eva Tardos, Tom Wexler STOC’03 Presented by Mustafa Suleyman CIFTCI.
Prof. Aiken CS 294 Lecture 21 Abstract Interpretation Part 2.
Invisible Invariants: Underapproximating to Overapproximate Ken McMillan Cadence Research Labs TexPoint fonts used in EMF: A A A A A.
Chapter 10: Estimating with Confidence
1 Automatic Non-interference Lemmas for Parameterized Model Checking Jesse Bingham, Intel DEG FMCAD 2008.
February 18, 2015CS21 Lecture 181 CS21 Decidability and Tractability Lecture 18 February 18, 2015.
Verification & Validation By: Amir Masoud Gharehbaghi
Predicate Abstraction. Abstract state space exploration Method: (1) start in the abstract initial state (2) use to compute reachable states (invariants)
Compositionality Entails Sequentializability Pranav Garg, P. Madhusudan University of Illinois at Urbana-Champaign.
The NP class. NP-completeness Lecture2. The NP-class The NP class is a class that contains all the problems that can be decided by a Non-Deterministic.
Lifting Propositional Interpolants to the Word-Level
Symbolic Characterization of Heap Abstractions
Model Checking Graph Grammars
Presentation transcript:

Ken McMillan Microsoft Research Under-approximating to Over-approximate Invisible Invariants and Abstract Interpretation Lenore Zuck University of Illinois Chicago Ken McMillan Microsoft Research TexPoint fonts used in EMF: AAAAA

Overview For some abstract domains, computation of the best abstract transformer can be very costly (Indexed) Predicate Abstraction Canonical shape graphs In these cases we may under-approximate the best transformer using finite-state methods, by restricting to a representative finite subset of the state space. In practice, this can be a close under-approximation or even yield the exact abstract least fixed point In some cases, finite-state under-approximations can yield orders-of-magnitude run-time reductions by reducing evaluation of the true abstract transformer. In this talk, we'll consider some generic strategies of this type, suggested by Pnueli and Zuck's Invisible Invariants method (viewed as Abstract Interpretation).

Parameterized Systems Suppose we have a parallel composition of N (finite state) processes, where N is unknown P1 P2 P3 PN ... Proofs require auxiliary constructs, parameterized on N For safety, an inductive invariant For liveness, say, a ranking Pnueli, et al., 2001: derive these constructs for general N by abstracting from the mechanical proof of a particular N. Surprising practical result: under-approximations can yield over-approximations at the fixed point.

Recipe for an invariant 1. Compute the reachable states RN for fixed N (say, N=5) ● ● ● ● ● 2. Project onto a small subset of processes (say 2) ● ●  = {(s1,s2) | 9 (s1,s2,...) 2 RN}

Recipe for an invariant 2. Project onto a small subset of processes (say 2) ● ●  = {(s1,s2) | 9 (s1,s2,...) 2 RN} 3. Generalize from 2 to N, to get GN N N ● ● ....... ● ● ● ....... ● GN = Æ i  j 2 [1..N]  (si,sj) ● ● ....... ● ● ● ....... ● ● ● ....... ● ● ● ....... ● ... ... 4. Test whether GN is inductive invariant for all N 8 N. GN ) X GN

Checking inductiveness Inductiveness is equivalent to validity of this formula: GN Æ T ) G’N Transition relation Small model theorem: If there is a countermodel with N>M, there is a countermodel with N=M Suffices to check inductiveness for N·M In this case both the invariant generation and invariant checking amount to finite-state model checking. If no small model result is available, however, we can rely on a theorem prover to check inductiveness.

preserves conjunctions Abstraction setting 𝐿 Abstract language 𝛾:𝐿→ 2 𝑆 preserves conjunctions 𝛼: 2 𝑆 →𝐿 (s) = Æ {  2 L | s µ () } 𝑆 𝜏 concrete transformer Concrete state space

Parameterized systems Concrete state space 𝑆 is set of valuations of variables Special variable 𝑵: Nat represents system parameter Ranges of other variables depend on 𝑁. Example: 𝑎:1…𝑵→1…𝑵 For fixed 𝑁, all ranges are finite: 𝑆 𝑁 = {𝑠∈𝑆 𝑠 𝑵 =𝑁 Concrete transition system defined in FOL: 𝜏 𝑠 =𝐼∪𝑇(𝑠) Abstract domain is Indexed Predicate Abstraction Fixed set of 𝐽 of index variables (say {𝑖,𝑗}) Fixed set of atomic predicates 𝑃. A matrix is a Boolean combination over 𝑃 (in some normal form) 𝐿 is the set of formulas ∀𝐽. 𝑀 where 𝑀 is a matrix. Example: 8 i,j: i  j ) :(q[i] Æ q[j]) Small model results: M depends mainly on quantifier structure of GN and T Example: if T has one universal and GN has two, then M = 2b+3

Invariant by AI Abstract transformer #    𝜏 # # is difficult to compute (exponential TP calls) Compute strongest inductive invariant in L = lfp    𝜏 #    𝜏 #    𝜏 # ⊥ For our abstraction, this computation can be quite expensive!

Restricted abstraction 𝐿 Abstract language Restricted concretization: 𝛾 𝑁 𝜙 =𝛾 𝜙 ∩ 𝑆 𝑁 𝛼 𝑁 𝑠 =𝛼(𝑠) 𝛾:𝐿→ 2 𝑆 𝛼: 2 𝑆 →𝐿 𝛾 𝑁 :𝐿→ 2 𝑆 𝑁 𝛼 𝑁 : 2 𝑆 𝑁 →𝐿 "generalize" "project" Galois connection: 2 𝑆 𝑁 ⇋ 𝐿 𝛾 𝑁 𝛼 𝑁 computable! 𝑆 Concrete state space 𝑆 is a union of finite spaces 𝑆 1 … for each value of 𝑁 𝑆 1 𝑆 2 𝑆 3 ... 𝑆 𝑁 𝜏 𝑁 : 2 𝑆 𝑁 → 2 𝑆 𝑁

Invisible invariant construction We construct the invariant guess by reachability and abstraction = lfp N 𝜋N    t# N N N N RN Testing the invariant guess ¶   𝜋N N ¶ N 𝜋N SMT if N >= M GN

Under-approximation The idea of generalizing from finite instances suggests we can under-approximate the best abstract transformer #    t# N N N t#N 𝜏 𝑁 # is an under-approximation of 𝜏 # that we can compute with finite-state methods.

Three methods A B C   𝜏 #    𝜏 #    𝜏 # lfp( 𝜏 # )  =? 𝜏 𝑁 # 𝜏 𝑁 # lfp( 𝜏 𝑁 # ) N N N    𝜏 # B N N N N N N ... =? lfp( 𝜏 𝑁 # ) 𝜏 𝑁 𝛾 𝑁 𝛼 𝑁 𝜏 𝑁 # C N N N ... N N N lfp

Experiments Evaluate three approaches Strategy C wins in two cases Strategy A: compute 𝜏 # using UCLID PA (eager reduction to ALL-SAT) Strategy B: compute 𝜏 𝑁 # by TLV with BDD's and 𝜏 # using UCLID Strategy C: compute 𝜏 𝑁 and 𝜏 𝑁 # by TLV and 𝜏 # using UCLID Strategy C wins in two cases Fewer computations of 𝛼 𝑁 and 𝛾 𝑁 Strategy B wins in one case More abstraction reduces BDD size and iterations In all cases, only one theorem prover call is needed.

Related Work Yorsh, Ball, Sagiv 2006 Bingham 2008 Combines testing and abstract interpretation Does not compute abstract fixed-points for finite sub-spaces as here Here we apply model checking aggressively to reduce 𝜏 # computation Bingham 2008 Essentially applies Strategy B with small model theorem to verify FLASH cache coherence protocol Compare to interactive proof with PVS with 111 lemmas (776 lines) and extensive proof script! Static analysis with finite domains can replace very substantial hand proof efforts.

Conclusion Invisible invariants suggest a general approach to minimizing computation of the best transformer, based on two ideas: Under-approximations can yield over-approximations at the fixed point This is a bit mysterious, but observationally true Computing the fixed point with under-approximations can use more light-weight methods For example, BDD-based model checking instead of a theorem prover Using under-approximations can reduce the number of theorem prover calls to just one in the best case. We can apply this idea whenever we can define finite sub-spaces that are representative of the whole space. Parametricity and symmetry are not required For example, could be applied to heap-manipulating programs by bounding the heap size.

Example: Peterson ME N-process version from Pnueli et al. 2001. 𝑵 : 1… pc : 1…𝑵→ 𝑙 0 … 𝑙 6 in : 1…𝑁→0…𝑁 last : 1…𝑁→0…𝑁 Initially ∀𝑖∈1…𝑁 𝑖𝑛 𝑖 =0∧𝑙𝑎𝑠𝑡 𝑖 =0∧𝑝𝑐 𝑖 =𝑙_0 in 𝑙 0 : <non-critical>; goto 𝑙 1 𝑙 1 : 𝑖𝑛 𝑖 ,𝑙𝑎𝑠𝑡 𝑖 ≔ 1,𝑖 ; goto 𝑙 2 𝑙 2 : if 𝑖𝑛 𝑖 <𝑁 goto 𝑙 3 else goto 𝑙 5 𝑙 3 : if ∀𝑗≠𝑖. 𝑖𝑛 𝑗 <𝑖𝑛 𝑖 ∨𝑙𝑎𝑠𝑡 𝑖𝑛 𝑖 ≠𝑖 then goto 𝑙 4 else goto 𝑙 3 𝑙 4 : 𝑖𝑛 𝑖 ≔𝑖𝑛 𝑖 +1;𝑙𝑎𝑠𝑡 𝑖𝑛 𝑖 ≔𝑖; goto 𝑙 2 𝑙 5 : <Critical>; goto 𝑙 6 𝑙 6 : 𝑖𝑛 𝑖 ≔0; goto 𝑙 0 || 𝑖=1…𝑁

Peterson invariant Hand-made invariant for N-process Peterson (m.ZERO < m.in(i) & m.in(i) < m.N => m.in(m.last(m.in(i))) = m.in(i)) & (m.in(i) = m.in(j) & m.ZERO < l & l < m.in(i) => m.in(m.last(l)) = l) & (m.pc(i) = L4 => (m.last(m.in(i)) != i | m.in(j) < m.in(i))) & ((m.pc(i) = L5 | m.pc(i) = L6) => m.in(i) = m.N) & ((m.pc(i) = L0 | m.pc(i) = L1) => m.in(i) = m.ZERO) & (m.pc(i) = L2 => m.in(i) > m.ZERO) & ((m.pc(i) = L3 | m.pc(i) = L4) => m.in(i) < m.N & m.in(i) > m.ZERO) & (~(m.in(i) = m.N & m.in(j) = m.N)) Required a few hours of trial-and error with a theorem prover

Peterson Invariant (cont.) Machine generated by TLV in 6.8 seconds X18 := ~levlty1 & y1ltN & ~y1eqN & ~y2eqN & ~y1gtz & y1eqz & (~ysy1eqy1 => ~sy1eq1); X15 := ~y1eqN & ~y2eqN & y1gtz & ~y1eqz & ysy1eqy1; X5 := (~levlty1 => y1ltN & X15); X1 := ysy1eqy1 & ~sy1eq1; X0 := ysy1eqy1 & sy1eq1; X16 := y1eqN & y2eqN & y1gtz & ~y1eqz & ysleveqlev & X0; X14 := y1eqN & y2eqN & y1gtz & ~y1eqz & X0; X13 := ~y1eqN & ~y2eqN & y1gtz & ~y1eqz & (ysleveqlev => ysy1eqy1) & (~ysleveqlev => X0); X7 := (levlty1 => y1ltN & ~y1eqN & ~y2eqN & y1gtz & ~y1eqz & ysleveqlev & ysy1eqy1) & X5; X6 := ~y1eqy2 & X7; X4 := (levlty1 => y1ltN & X13) & X5; X3 := (levlty1 => y1ltN & ~y1eqN & ~y2eqN & y1gtz & ~y1eqz & ysleveqlev & X1) & (~levlty1 => y1ltN & ~y1eqN & ~y2eqN & y1gtz & ~y1eqz & X1); X2 := ~y1eqy2 & X3; X17 := (levlty1 => (y1ltN => X13) & (~y1ltN => X14)) & (~levlty1 => (y1ltN => X15) & (~y1ltN => X16)); X12 := (y1eqy2 => X7); X11 := (y1lty2 => X6); X10 := y1lty2 & X6; X9 := ~y1lty2 & ~y1eqy2 & X4; X8 := (~y1eqy2 => X4); matrix := ((loc1 = L5 | loc1 = L6) => (loc2 = L0 | loc2 = L1 | loc2 = L2 | loc2 = L3 | loc2 = L4) & ~y1lty2 & ~y1eqy2 & (levlty1 => ~y1ltN & X14) & (~levlty1 => ~y1ltN & X16)) & (loc1 = L4 => ((loc2 = L5 | loc2 = L6) => y1lty2 & X2) & ((loc2 = L2 | loc2 = L3 | loc2 = L4) => (y1lty2 => X2) & (~y1lty2 => (y1eqy2 => X3) & X8)) & ((loc2 = L0 | loc2 = L1) => X9)) & (loc1 = L3 => ((loc2 = L5 | loc2 = L6) => X10) & ((loc2 = L2 | loc2 = L3 | loc2 = L4) => X11 & (~y1lty2 => X12 & X8)) & ((loc2 = L0 | loc2 = L1) => X9)) & (loc1 = L2 => ((loc2 = L5 | loc2 = L6) => X10) & ((loc2 = L2 | loc2 = L3 | loc2 = L4) => X11 & (~y1lty2 => X12 & (~y1eqy2 => X17))) & ((loc2 = L0 | loc2 = L1) => ~y1lty2 & ~y1eqy2 & X17)) & ((loc1 = L0 | loc1 = L1) => (~(loc2 = L1 | loc2 = L0) => y1lty2 & ~y1eqy2 & X18) & ((loc2 = L0 | loc2 = L1) => ~y1lty2 & y1eqy2 & X18));