Writing Model-Checkers for Boolean Recursive Programs using a Fixed-Point Calculus Gennaro Parlato - UIUC Joint work with Madhusudan - UIUC Salvatore La.

Slides:



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

A SAT characterization of boolean-program correctness K. Rustan M. Leino Microsoft Research, Redmond, WA 14 Nov 2002 IFIP WG 2.4 meeting, Schloβ Dagstuhl,
Model Checking Lecture 4. Outline 1 Specifications: logic vs. automata, linear vs. branching, safety vs. liveness 2 Graph algorithms for model checking.
Global Value Numbering using Random Interpretation Sumit Gulwani George C. Necula CS Department University of California, Berkeley.
Bounded Model Checking of Concurrent Data Types on Relaxed Memory Models: A Case Study Sebastian Burckhardt Rajeev Alur Milo M. K. Martin Department of.
Technologies for finding errors in object-oriented software K. Rustan M. Leino Microsoft Research, Redmond, WA Lecture 1 Summer school on Formal Models.
Automated Theorem Proving Lecture 1. Program verification is undecidable! Given program P and specification S, does P satisfy S?
1 Verification of Parameterized Systems Reducing Model Checking of the Few to the One. E. Allen Emerson, Richard J. Trefler and Thomas Wahl Junaid Surve.
Reliable Scripting Using Push Logic Push Logic David Greaves, Daniel Gordon University of Cambridge Computer Laboratory Reliable Scripting.
Processes Management.
CS 267: Automated Verification Lecture 8: Automata Theoretic Model Checking Instructor: Tevfik Bultan.
A Program Transformation For Faster Goal-Directed Search Akash Lal, Shaz Qadeer Microsoft Research.
Automatic Verification Book: Chapter 6. What is verification? Traditionally, verification means proof of correctness automatic: model checking deductive:
Compilation 2011 Static Analysis Johnni Winther Michael I. Schwartzbach Aarhus University.
An Introduction to the Model Verifier verds Wenhui Zhang September 15 th, 2010.
Budapest University of Technology and EconomicsDagstuhl 2004 Department of Measurement and Information Systems 1 Towards Automated Formal Verification.
ECE Synthesis & Verification - L271 ECE 697B (667) Spring 2006 Synthesis and Verification of Digital Systems Model Checking basics.
1 1 Regression Verification for Multi-Threaded Programs Sagar Chaki, SEI-Pittsburgh Arie Gurfinkel, SEI-Pittsburgh Ofer Strichman, Technion-Haifa Originally.
1/20 Generalized Symbolic Execution for Model Checking and Testing Charngki PSWLAB Generalized Symbolic Execution for Model Checking and Testing.
Bebop: A Symbolic Model Checker for Boolean Programs Thomas Ball Sriram K. Rajamani
Hybrid Systems Presented by: Arnab De Anand S. An Intuitive Introduction to Hybrid Systems Discrete program with an analog environment. What does it mean?
Reducing Context-bounded Concurrent Reachability to Sequential Reachability Gennaro Parlato University of Illinois at Urbana-Champaign Salvatore La Torre.
SYMBOLIC MODEL CHECKING: STATES AND BEYOND J.R. Burch E.M. Clarke K.L. McMillan D. L. Dill L. J. Hwang Presented by Rehana Begam.
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
Review of topics Final exam : -May 2nd to May 7 th - Projects due on May 7th.
The Language Theory of Bounded Context-Switching Gennaro Parlato (U. of Illinois, U.S.A.) Joint work with: Salvatore La Torre (U. of Salerno, Italy) P.
CMPT 354, Simon Fraser University, Fall 2008, Martin Ester 52 Database Systems I Relational Algebra.
On Sequentializing Concurrent Programs Ahmed Bouajjani LIAFA, University of Paris 7, France LIAFA, University of Paris 7, France Michael Emmi LIAFA, University.
Constraint Logic Programming Ryan Kinworthy. Overview Introduction Logic Programming LP as a constraint programming language Constraint Logic Programming.
Chapter 2: Algorithm Discovery and Design
ECE Synthesis & Verification1 ECE 667 Spring 2011 Synthesis and Verification of Digital Systems Verification Introduction.
Automatically Validating Temporal Safety Properties of Interfaces Thomas Ball and Sriram K. Rajamani Software Productivity Tools, Microsoft Research Presented.
Programming Language Semantics Mooly SagivEran Yahav Schrirber 317Open space html://
ECE Synthesis & Verification - L211 ECE 697B (667) Spring 2006 Synthesis and Verification of Digital Systems Verification Equivalence checking.
Semantics with Applications Mooly Sagiv Schrirber html:// Textbooks:Winskel The.
1 Relational Algebra and Calculus Yanlei Diao UMass Amherst Feb 1, 2007 Slides Courtesy of R. Ramakrishnan and J. Gehrke.
Program Analysis Mooly Sagiv Tel Aviv University Sunday Scrieber 8 Monday Schrieber.
Chapter 2: Algorithm Discovery and Design
Chapter 2: Algorithm Discovery and Design
1.3 Executing Programs. How is Computer Code Transformed into an Executable? Interpreters Compilers Hybrid systems.
272: Software Engineering Fall 2012 Instructor: Tevfik Bultan Lecture 4: SMT-based Bounded Model Checking of Concurrent Software.
Created by, Author Name, School Name—State FLUENCY WITH INFORMATION TECNOLOGY Skills, Concepts, and Capabilities.
Chapter 1 Introduction Dr. Frank Lee. 1.1 Why Study Compiler? To write more efficient code in a high-level language To provide solid foundation in parsing.
Chapter 2: Algorithm Discovery and Design Invitation to Computer Science, C++ Version, Third Edition.
Invitation to Computer Science, Java Version, Second Edition.
Scope-bounded Multistack Pushdown Systems: - fixed-point - sequentialization - tree-width 1 Salvatore La Torre Gennaro Parlato (U. Salerno, Italy) (U.
Chapter 13 Recursion. Learning Objectives Recursive void Functions – Tracing recursive calls – Infinite recursion, overflows Recursive Functions that.
CSIS 123A Lecture 9 Recursion Glenn Stevenson CSIS 113A MSJC.
1 Relational Algebra and Calculas Chapter 4, Part A.
19 Aug 2002EXPRESS On the Expressive Power of Temporal Concurrent Constraint Programming Languages Mogens Nielsen, BRICS Catuscia Palamidessi, INRIA.
MT311 Java Application Development and Programming Languages Li Tak Sing( 李德成 )
Lecture 5 1 CSP tools for verification of Sec Prot Overview of the lecture The Casper interface Refinement checking and FDR Model checking Theorem proving.
Constraints Assisted Modeling and Validation Presented in CS294-5 (Spring 2007) Thomas Huining Feng Based on: [1]Constraints Assisted Modeling and Validation.
Compositionality Entails Sequentializability Pranav Garg, P. Madhusudan University of Illinois at Urbana-Champaign.
Getting Rid of Store-Buffers in TSO Analysis Mohamed Faouzi Atig Uppsala University, Sweden Ahmed Bouajjani LIAFA, University of Paris 7, France LIAFA,
Software Systems Verification and Validation Laboratory Assignment 4 Model checking Assignment date: Lab 4 Delivery date: Lab 4, 5.
/ PSWLAB Thread Modular Model Checking by Cormac Flanagan and Shaz Qadeer (published in Spin’03) Hong,Shin Thread Modular Model.
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
Overview of Compilation Prepared by Manuel E. Bermúdez, Ph.D. Associate Professor University of Florida Programming Language Principles Lecture 2.
Chapter 2: Algorithm Discovery and Design Invitation to Computer Science.
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
On Sequentializing Concurrent Programs
Chapter 13 Recursion Copyright © 2016 Pearson, Inc. All rights reserved.
Advanced Computer Systems
Formal methods: Lecture
Sequentializing Parameterized Programs
Over-Approximating Boolean Programs with Unbounded Thread Creation
Lazy Sequentialization Unbounded Concurrent Programs
Data Flow Analysis Compiler Design
Presentation transcript:

Writing Model-Checkers for Boolean Recursive Programs using a Fixed-Point Calculus Gennaro Parlato - UIUC Joint work with Madhusudan - UIUC Salvatore La Torre – U.of Salerno, Italy

What this talk is about A framework to implement symbolic model-checking algorithms for Boolean programs (tool GETAFIX) Easy – to implement and debug – to experiment with variants High level formalism – express algorithms in fixed-point calculus – hide details unrelated to the algorithmic aspects of solutions Efficient – competitive with mature model-checkers

Using traditional programming languages (e.g., C or Java) It is a complex task – memory management – caching management – variable ordering (BDD) – A typical model checker spans over thousand lines of code – Hard to check the correctness Small changes in the algorithms may require redesigning large portions of code – usually hard to try new ideas

How model-checkers look in our formalism mu bool Reachable( Module s_mod, PrCount s_pc, Local s_CL, Global s_CG, Local s_ENTRY_CL, Global s_ENTRY_CG) s_mod < s_pc, s_pc < s_CL, s_CL ~+ s_ENTRY_CL, s_CL < s_CG, s_CG ~+ s_ENTRY_CG /* BDD ordering */ ( ( exists Module t_mod, PrCount t_pc, Local t_CL, Global t_CG, Local t_ENTRY_CL, Global t_ENTRY_CG. ( target(t_mod,t_pc) & Reachable(t_mod,t_pc,t_CL,t_CG,t_ENTRY_CL,t_ENTRY_CG) ) ) |(enforce(s_mod, s_CL, s_CG) & ( (s_mod=0 & s_pc=0 ) | ( s_pc=0 & CopyLocals(s_mod,s_ENTRY_CL,s_CL) & (exists Module t_mod, PrCount t_pc, Local t_CL, Global t_CG, Local t_ENTRY_CL, Global t_ENTRY_CG. ( (Reachable(t_mod,t_pc,t_CL,t_CG,t_ENTRY_CL,t_ENTRY_CG) & CopyGlobals(s_mod,t_CG,s_CG) ) & CopyGlobals(s_mod, t_CG, s_ENTRY_CG) & programCall(t_mod,s_mod,t_pc,t_CL,s_CL,t_CG)))) | (exists PrCount t_pc, Local t_CL, Global t_CG. ( (Reachable(s_mod,t_pc,t_CL,t_CG,s_ENTRY_CL,s_ENTRY_CG) & !Calling(s_mod,t_pc)) &( programInt(s_mod,t_pc,s_pc,t_CL,s_CL,t_CG,s_CG)))) | (exists PrCount t_pc, Global t_CG, Module u_mod, PrCount u_pc, Local u_ENTRY_CL. ( exists Local t_CL. ( (Reachable(s_mod,t_pc,t_CL,t_CG,s_ENTRY_CL,s_ENTRY_CG) & SkipCall(s_mod,t_pc,s_pc)) & programCall(s_mod,u_mod,t_pc,t_CL,u_ENTRY_CL,t_CG) & SetReturnTS(s_mod,u_mod,t_pc,u_pc,t_CL,s_CL,t_CG,s_CG))) & ( exists Local u_CL, Global u_CG. ( (Reachable(u_mod,u_pc,u_CL,u_CG,u_ENTRY_CL,t_CG) & Exit(u_mod,u_pc)) & SetReturnUS(s_mod,u_mod,t_pc,u_pc,u_CL,s_CL,u_CG,s_CG)))) ))); ( exists Module s_mod, PrCount s_pc, Local s_CL, Global s_CG, Local s_ENTRY_CL, Global s_ENTRY_CG. ( target(s_mod,s_pc) & Reachable(s_mod,s_pc,s_CL,s_CG,s_ENTRY_CL,s_ENTRY_CG) ); High-level declarative algorithm at one level; but also algorithmic aspects encoded! Highly readable; easily debuggable Easy to experiment with variants Underlying solver GETAFIX will convert the program and run this algorithm efficiently Entire model- checking algorithm ! Checks whether an error state in a sequential Boolean program is reachable. Entire model checking algorithm in 1~2 pages ! Symbolic algorithm that uses BDDs Competitive with mature model-checkers

Boolean programs are recursive imperative programs where – variables ranges over the Boolean domain only – can use non-determinism – recursive function calls – tuple of return values – …

Boolean programs Eg. main () { bool a, b; a := T; b := *; while (b) { a:= f(b); b:= a; } if (a) { ERR: skip } } bool f( bool x ) { bool y; y := * ; while (y) { y:= f(x) } return y; } Nondeterminism y := *;

Why check Boolean programs? Programs can be restricted to finite domains giving Boolean programs Programs can be abstracted to Boolean pgms: – SLAM/SDV from Microsoft for verifying device drivers – Predicate abstraction to derive Boolean pgms Bool pgm tracks predicates over the data domain – BEBOP / MOPED – Model-checkers for Boolean programs Device driver Program Device driver Program Boolean Program Boolean Program Abstraction Engine Model Checker Counter- example Counter- example

Getafix A framework for writing model-checking algorithms using fixed-point formulas Boolean Program Model-checking Algorithm written succinctly as a fixed-point formula Model-checking Algorithm written succinctly as a fixed-point formula YES NO Limitation: No counterexamples GETAFIX Translator Mucke file allocation constraints internal, call, return, entry, exit, Init, Across, Goal Mucke Fixed-point Model-checker

Why fixed-point calculus? Natural formalism in verification – Most symbolic model-checking algorithms essentially compute fixed-points – Ex: compute the least X s.t X = Start  X  Succ(X) (forward reachability) Right primitives – easy encoding of model-checking algorithms – sufficiently low-level to express algorithmic details

Fixed-points Consider the complete lattice (2 S, µ ) Consider a function X 2 2 S if a fixed point of f if f(X)=X A fixed point X of f is the least fixed point if for every fixed point Y, X Y µ

Tarski-Knaster theorem Consider a function that is monotonic X µ Y then f(X) µ f(Y) Consider the sequence X 0 = ; X 1 = f (X 0 ) X 2 = f (X 1 ) … This eventually converges to the least-fixed point (and hence always exists).

Eg: Reachability in non-rec programs Reach(pc, x) = ( pc=0 ∧ Init(x) ) ∨ ∃ pc’,y. ( Reach(pc’, y) ∧ Internal(pc’,y, pc,x) ) Declarative: Reach is the smallest set that contains the initial state and is closed under internal image. Operational/Algorithmic: Start with the empty relation; keep applying Reach to the current definition till the least fixed-point is reached Note: Init and Internal are relations that are defined by the program being checked. Algorithm uses these relations.

Quantified Boolean logic First-order logic over the Boolean domain BoolExp B ::= T | F | R k (x 1, …, x k ) | ¬ B | B ∧ B | B ∨ B | ∃ x.(B) | ∀ x.(B) Variables interpreted over the Boolean domain {T, F} Relations interpreted as k-ary tuples of {T,F}

A fixed-point calculus System of equations f 1 (x 1, …, x r ) = PosBoolExp using f 1,… f m f 2 (y 1, …, y s ) = PosBoolExp using f 1,… f m … f m (z 1, …, z t ) = PosBoolExp using f 1,… f m Positive Boolean expression: relations do not occur within an odd number of negations A positive Boolean expression defines a monotonic function Least fixed-point of all these relations f 1,… f m exists

Computation of the least fixed-points Least fixed-point of f 1,…, f m can be computed by an algorithm that starts with the empty relation, and computes iteratively till a fixed- point is reached Let f=B be an equation of a system Eq Evaluate(f,Eq) : Set S :=  while (S does not stabilize) { - Eq’ := Eq \ f = B - Eq’’:=Eq’ [f  S] - Let f 1,...,f r occur in B do: S i := Evaluate(f i,Eq’’) - S:= evaluation of B[f 1  S 1,....,f r  S r,f  S] } return S Evaluate gives operational semantics to our algorithms - even when general (non positive) Boolean expressions are used (in this case we are in charge to ensure convergence)

Getafix for sequential Boolean programs

Some relations defined by pgms Internal(u,v) uv..... function f function g Call(u,v) Return(u,v,z) function f function g call g return..... u v u z v Entry Exit

Checking recursive Boolean programs main () f(x) call f(y) return from f Summaries: (Entry, State) meaning the state is reachable from the entry of the function (perhaps using calls to other functions) (Entry,Entry)

Writing the algorithm Summary(u,v) = (Entry(u.pc) ∧ u=v ∧ Init(u.pc)) ∨ ∃ x.(Summary(u, x) ∧ Internal(x, v)) ∨ ∃ x, y.(Summary(x, y) ∧ Call(y, u) ∧ u=v) ∨ ∃ x, y, z.(Summary(u, x) ∧ Call(x, y) ∧ Summary(y, z) ∧ Exit(z.pc) ∧ Return(x, z, v) ) (u init, u init ) v u x

Writing the algorithm Summary(u,v) = (Entry(u.pc) ∧ u=v ∧ Init(u.pc)) ∨ ∃ x.(Summary(u, x) ∧ Internal(x, v)) ∨ ∃ x, y.(Summary(x, y) ∧ Call(y, u) ∧ u=v) ∨ ∃ x, y, z.(Summary(u, x) ∧ Call(x, y) ∧ Summary(y, z) ∧ Exit(z.pc) ∧ Return(x, z, v) ) xy u call (u, u)

Writing the algorithm Summary(u,v) = (Entry(u.pc) ∧ u=v ∧ Init(u.pc)) ∨ ∃ x.(Summary(u, x) ∧ Internal(x, v)) ∨ ∃ x, y.(Summary(x, y) ∧ Call(y, u) ∧ u=v) ∨ ∃ x, y, z.(Summary(u, x) ∧ Call(x, y) ∧ Summary(y, z) ∧ Exit(z.pc) ∧ Return(x, z, v) ) u x y call z v ret

Actual code mu bool Reachable( Module s_mod, PrCount s_pc, Local s_CL, Global s_CG, Local s_ENTRY_CL, Global s_ENTRY_CG) s_mod < s_pc, s_pc < s_CL, s_CL ~+ s_ENTRY_CL, s_CL < s_CG, s_CG ~+ s_ENTRY_CG /* BDD ordering */ ( ( exists Module t_mod, PrCount t_pc, Local t_CL, Global t_CG, Local t_ENTRY_CL, Global t_ENTRY_CG. ( target(t_mod,t_pc) & Reachable(t_mod,t_pc,t_CL,t_CG,t_ENTRY_CL,t_ENTRY_CG) ) ) |(enforce(s_mod, s_CL, s_CG) & ( (s_mod=0 & s_pc=0 ) | ( s_pc=0 & CopyLocals(s_mod,s_ENTRY_CL,s_CL) & (exists Module t_mod, PrCount t_pc, Local t_CL, Global t_CG, Local t_ENTRY_CL, Global t_ENTRY_CG. ( (Reachable(t_mod,t_pc,t_CL,t_CG,t_ENTRY_CL,t_ENTRY_CG) & CopyGlobals(s_mod,t_CG,s_CG) ) & CopyGlobals(s_mod, t_CG, s_ENTRY_CG) & programCall(t_mod,s_mod,t_pc,t_CL,s_CL,t_CG)))) | (exists PrCount t_pc, Local t_CL, Global t_CG. ( (Reachable(s_mod,t_pc,t_CL,t_CG,s_ENTRY_CL,s_ENTRY_CG) & !Calling(s_mod,t_pc)) &( programInt(s_mod,t_pc,s_pc,t_CL,s_CL,t_CG,s_CG)))) | (exists PrCount t_pc, Global t_CG, Module u_mod, PrCount u_pc, Local u_ENTRY_CL. ( exists Local t_CL. ( (Reachable(s_mod,t_pc,t_CL,t_CG,s_ENTRY_CL,s_ENTRY_CG) & SkipCall(s_mod,t_pc,s_pc)) & programCall(s_mod,u_mod,t_pc,t_CL,u_ENTRY_CL,t_CG) & SetReturnTS(s_mod,u_mod,t_pc,u_pc,t_CL,s_CL,t_CG,s_CG))) & ( exists Local u_CL, Global u_CG. ( (Reachable(u_mod,u_pc,u_CL,u_CG,u_ENTRY_CL,t_CG) & Exit(u_mod,u_pc)) & SetReturnUS(s_mod,u_mod,t_pc,u_pc,u_CL,s_CL,u_CG,s_CG)))) ))); ( exists Module s_mod, PrCount s_pc, Local s_CL, Global s_CG, Local s_ENTRY_CL, Global s_ENTRY_CG. ( target(s_mod,s_pc) & Reachable(s_mod,s_pc,s_CL,s_CG,s_ENTRY_CL,s_ENTRY_CG) ); Code is executed according to the fixed-point algorithm - bracketing is respected in the evaluations Proper bracketing can reduce the number of variables in the intermediate BDDs

Correctness of the algorithm Let P be a recursive Boolean program For each pair (u,v) which is added to Summary – u is either an initial state or a reachable entry – v is either u or (u,x) is in Summary and v is reachable from x by an internal move or by a call which returns (only reachable states are added to Summary) Each reachable state is eventually added to Summary Theorem. A state v is reachable in P if and only if  an entry u such that Summary(u,v)

An optimized algorithm Frontier: Newly discovered summaries in the last round large BDD Relevant: Summaries whose pc value is involved in the frontier small BDD Idea: Compute only on the relevant summaries. Problem: Relevant summaries does not grow monotonically! Summary from previous iterations Frontier Relevant summary

Tarski-Knaster iteration Forget the least fixed-point. Forget the theorem. Just use the algorithmic semantics of computation of finding a fixed-point Convergence of the algorithm is up to you!

Writing the optimized algorithm Summary(fr, u, v) = (fr=1 ∧ Entry(u.pc) ∧ u=v ∧ Init(u.pc)) ∨ Summary(1, u, v) ∨ (fr=1 ∧ (New1(u, v) ∨ New2(u, v)) ) Relevant(pc)= ∃ u, v.( Summary(1, u, v) ∧ ¬ Summary(0, u, v) ∧ v.pc=pc ) New1(u, v) = (Summary(1, u, v) ∧ Relevant(v.pc)) ∨ ( ∃ x.(New1(u, x) ∧ Internal(x, v))) New2(u, v) = ( ∃ x.(Relevant(x.pc) ∧ Summary(1, u, x) ∧ Call(x, v))) ∨ ( ∃ x, y, z.(Summary(u, x) ∧ Call(x, y) ∧ Summary(y, z) ∧ Exit(z.pc) ∧ Return(x, z, v) ∧ (Relevant(x.pc) ∨ Relevant(z.pc))))

An optimized algorithm Why not computing simply on Frontier? – BDDs for Frontier can be larger than reachable set – Relevant is a restriction of the reachable set to a particular set of program counters New Frontier is computed into two steps: – New1: image-closure of Relevant on internal transitions – New2: image of Relevant on calling a module or skipping the call using a summary Handling call and return transitions is expensive compared to internal transitions Programs contain many more internals than other transitions

Experiments – SLAM benchmarks #LOC GLAnsGetafixMoped Ver 1 Moped Ver2 Bebop (SLAM / SDV) TIME (s) BDD AlgOpt Reg-Pos (99) Yes Reg-Neg (79) No Iscscprt (15) 10K3.5211Yes 8K22111 floppy-pos (12) 17K Yes 9K22111 floppy-neg (4) 10K No 17K22111 iscsi pos (16) 12K Yes 81K55246

Experiments – Terminator examples #LOC GLAnsGetafixMoped Ver 1 Moped Ver2 Bebop (SLAM / SDV) TIME (s) BDD AlgOpt Term-A iterative Yes141K schoose162K Term-B iterative No 997K schoose 660K Term-C iterative No 48K schoose 48K

Getafix for parameterized concurrent Boolean programs

Parameterized Concurrent Boolean Programs A finite set of Boolean programs P 1,..., P n Question: Given a pc of a process, is pc reachable? UNDECIDABLE ! T1T1 T2T2 TnTn shared vars … loc Infinitely many threads T i runs some P j

Bounded round-robin schedules Fix k. Is an error (pc) reachable within k round-robin rounds? [Atig – Bouajjani – Qadeer ’09]: Decidable. Context-bounded analysis for concurrent programs with dynamic creation of threads. High computational complexity No implementation for this problem

Key idea for a Fixed-point formulation T1T1 T2T2 TnTn Initial shared vars Interfaces in a computation round 1 round 2 round k

Thread Interfaces TiTi O1O1 O2O2 OkOk IkIk I2I2 I1I1 Input Output Shared vars change from O i to I i+1 Locals are preserved

Algorithm Compute all possible thread interfaces Compose interfaces of blocks of thread interfaces Check if there exists a block of thread interfaces that folds back. It has a fixed point formulation !

F.P. alg for Thread Linear Interfaces Thread-LI( I,0, reach, u_round, v_round, u, v) = (u_round= v_round= 1 ∧ Entry(u.pc) ∧ u=v ∧ u.shared= I[1] ∧ reach=false) ∨ ( ∃ x.( Thread_LI( I,0, reach, u_round, v_round, u, x) ∧ ProgramInt(x, v))) ∨ ∃ x, x_round, y.( Thread_LI( I,0, reach, x_round, u_round, x, y) ∧ Call(y, u) ∧ u=v ∧ u_round=v_round) ) ∨ ∃ x, x_round, y, z.( Thread_LI( I,0, reach, u_round, x_round, u, x) ∧ Call(x, y) ∧ x_round <= v_round ∧ Thread_LI( I,0, reach, x_round, v_round, y, z) ∧ Exit(z.pc) ∧ Return(x,z,v)) ∨ (Thread_LI( I,0, false, u_round, v_round, u, v) ∧ target(v) ∧ reach =true) ∨ ∃ t_round.(Thread_LI( I,0, reach, u_round, t_round, u, x) ∧ v_round= t_round+1 x.shared = O[ t_round ] ∧ v=x[ shared | I[v _round ] ] ) ∨ ∃ t_round.(Thread_LI( I,0, true, u_round, t_round, u, v) ∧ v_round= t_round+1) ∧ reach=true

F.P. alg. for Block Linear Interfaces Block-LI( I,0, reach) = ∃ x, u_round. Thread_LI( I,0, reach, u_round, k, u, v) ∨ ∃ O’, I’, reach1, reach2. ( Block_LI( I,0’, reach1) ∧ Block_LI( I’,0’ reach2) ∧ 0’ = I’ ∧ (reach = reach1 ∨ reach2) ) ∃ x. Block_LI( I,0, true) ∧ Init_shared( I [1]) ∧ fold( I,O) where Fold( I,O)= ∧ i=1,..,k-1 ( I [i+1]=O[i] )

#prop. checked Avg #LOC per pgm Avg # shared vars per pgm Avg Time (s) on successful pgm # pgm on which tool terminated # of pgm that timed-out wdt_pci (1195 pgm) 2179K (43.3%) 654 (54.7%) wdt (1967 pgm) 3517K (55,1%) 883 (44.9%) machzwd (683 pgm) 2558K (78%) 150 (22%) sbc60xxwdt (375 pgm) 1065K (100%) 0 (0%) i8xx_tco (766 pgm) 33811K (84,2%) 121 (15.8%) Total (4986 pgm) (72.5%)(27.5%) 4 round-robin schedule Experiments – DDVERIFY benchmarks (1 copy of kernel and unboundedly many copies of driver)

Think using fixed-points. Try Getafix

Conclusion Experience: – Succinctness – Easy to check correctness – No hidden heuristics; all ideas explicitly expressed – Extremely easy to program Open problem: Can we do efficient context-sensitive analysis using Getafix?

Related research bddbddb [Lam et al, PODS’05] – Datalog to express program analysis properties – BDD-based implementation of analysis – No algorithmic control possible; purely declarative – Uses many complex heuristics… hard to know what’s happening – We tried encoding Boolean pgs into bddbddb (it’s possible) Complete failure… even simple programs don’t finish. Jedd [Lhotak –Hendren, PLDI’04] Extension of Java with bdd-based relations – Very attractive; however, no fixed-points