Combining Abstract Interpreters Sumit Gulwani Microsoft Research Redmond, Group Ashish Tiwari SRI RADRAD.

Slides:



Advertisements
Similar presentations
Assertion Checking over Combined Abstraction of Linear Arithmetic and Uninterpreted Functions Sumit Gulwani Microsoft Research, Redmond Ashish Tiwari SRI.
Advertisements

Join Algorithms for the Theory of Uninterpreted Functions Sumit Gulwani Ashish Tiwari George Necula UC-Berkeley SRI UC-Berkeley.
A Randomized Satisfiability Procedure for Arithmetic and Uninterpreted Function Symbols Sumit Gulwani George Necula EECS Department University of California,
A Polynomial-Time Algorithm for Global Value Numbering SAS 2004 Sumit Gulwani George C. Necula.
Path-Sensitive Analysis for Linear Arithmetic and Uninterpreted Functions SAS 2004 Sumit Gulwani George Necula EECS Department University of California,
Program Verification using Probabilistic Techniques Sumit Gulwani Microsoft Research Invited Talk: VSTTE Workshop August 2006 Joint work with George Necula.
Global Value Numbering using Random Interpretation Sumit Gulwani George C. Necula CS Department University of California, Berkeley.
- 1 - Using an SMT Solver and Craig Interpolation to Detect and Remove Redundant Linear Constraints in Representations of Non-Convex Polyhedra Christoph.
Precise Interprocedural Analysis using Random Interpretation Sumit Gulwani George Necula UC-Berkeley.
Logical Abstract Interpretation Sumit Gulwani Microsoft Research, Redmond.
A practical and complete approach to predicate abstraction Ranjit Jhala UCSD Ken McMillan Cadence Berkeley Labs.
Consequence Generation, Interpolants, and Invariant Discovery Ken McMillan Cadence Berkeley Labs.
Automated Theorem Proving Lecture 1. Program verification is undecidable! Given program P and specification S, does P satisfy S?
1 First order theories (Chapter 1, Sections 1.4 – 1.5)
1 Decision Procedures An algorithmic point of view Equality Logic and Uninterpreted Functions.
Problems and Their Classes
Abstract Interpretation Part II
Continuing Abstract Interpretation We have seen: 1.How to compile abstract syntax trees into control-flow graphs 2.Lattices, as structures that describe.
CSCI 115 Chapter 6 Order Relations and Structures.
© Imperial College LondonPage 1 Model checking and refinement checking for modal transition systems and their cousins MTS meeting 2007 Adam Antonik & Michael.
SLD-resolution Introduction Most general unifiers SLD-resolution
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.
1 Cover Algorithms and Their Combination Sumit Gulwani, Madan Musuvathi Microsoft Research, Redmond.
Discovering Affine Equalities Using Random Interpretation Sumit Gulwani George Necula EECS Department University of California, Berkeley.
Lifting Abstract Interpreters to Quantified Logical Domains Sumit Gulwani, MSR Bill McCloskey, UCB Ashish Tiwari, SRI 1.
Program Verification as Probabilistic Inference Sumit Gulwani Nebojsa Jojic Microsoft Research, Redmond.
Assertion Checking Unified Sumit Gulwani Microsoft Research, Redmond Ashish Tiwari SRI.
1 Basic abstract interpretation theory. 2 The general idea §a semantics l any definition style, from a denotational definition to a detailed interpreter.
Precise Inter-procedural Analysis Sumit Gulwani George C. Necula using Random Interpretation presented by Kian Win Ong UC Berkeley.
Interpolants [Craig 1957] G(y,z) F(x,y)
Automated Theorem Proving Lecture 4.   Formula := A |  |    A  Atom := b | t = 0 | t < 0 | t  0 t  Term := c | x | t + t | t – t | ct | Select(m,t)
1 2. Constraint Databases Next level of data abstraction: Constraint level – finitely represents by constraints the logical level.
1 Deciding separation formulas with SAT Ofer Strichman Sanjit A. Seshia Randal E. Bryant School of Computer Science, Carnegie Mellon University.
Abstract Interpretation Part I Mooly Sagiv Textbook: Chapter 4.
A Numerical Abstract Domain based on Expression Abstraction + Max Operator with Application in Timing Analysis Sumit Gulwani (MSR Redmond) Bhargav Gulavani.
Semantics with Applications Mooly Sagiv Schrirber html:// Textbooks:Winskel The.
TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: A A Sumit Gulwani (Microsoft Research, Redmond, USA) Symbolic Bound Computation.
Ofer Strichman, Technion Deciding Combined Theories.
Leonardo de Moura Microsoft Research. Many approaches Graph-based for difference logic: a – b  3 Fourier-Motzkin elimination: Standard Simplex General.
Deciding a Combination of Theories - Decision Procedure - Changki pswlab Combination of Theories Daniel Kroening, Ofer Strichman Presented by Changki.
The Theory of NP-Completeness 1. What is NP-completeness? Consider the circuit satisfiability problem Difficult to answer the decision problem in polynomial.
SAT and SMT solvers Ayrat Khalimov (based on Georg Hofferek‘s slides) AKDV 2014.
Pattern-directed inference systems
Sound Global Caching for Abstract Modal Tableaux Rajeev Goré The Australian National University  Linh Anh Nguyen University of Warsaw CS&P’2008.
Key Concepts Representation Inference Semantics Discourse Pragmatics Computation.
Program Analysis and Verification Spring 2015 Program Analysis and Verification Lecture 12: Abstract Interpretation IV Roman Manevich Ben-Gurion University.
A Logic of Partially Satisfied Constraints Nic Wilson Cork Constraint Computation Centre Computer Science, UCC.
Decision methods for arithmetic Third summer school on formal methods Leonardo de Moura Microsoft Research.
Thinking Mathematically
CS6133 Software Specification and Verification
Linear Program Set Cover. Given a universe U of n elements, a collection of subsets of U, S = {S 1,…, S k }, and a cost function c: S → Q +. Find a minimum.
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.
Daniel Kroening and Ofer Strichman Decision Procedures An Algorithmic Point of View Deciding Combined Theories.
1 Combining Abstract Interpreters Mooly Sagiv Tel Aviv University
Symbolic Logic The Following slide were written using materials from the Book: The Following slide were written using materials from the Book: Discrete.
Quantified Data Automata on Skinny Trees: an Abstract Domain for Lists Pranav Garg 1, P. Madhusudan 1 and Gennaro Parlato 2 1 University of Illinois at.
1/20 Arrays Changki PSWLAB Arrays Daniel Kroening and Ofer Strichman Decision Procedure.
Deciding Combined Theories Presented by Adi Sosnovich Based on presentation from: Decision Procedures An Algorithmic Point of View Daniel Kroening and.
Section 1.4. Propositional Functions Propositional functions become propositions (and have truth values) when their variables are each replaced by a value.
Satisfiability Modulo Theories and DPLL(T) Andrew Reynolds March 18, 2015.
DFA foundations Simone Campanoni
Lifting Abstract Interpreters to Quantified Logical Domains (POPL’08)
Quick Course Overview Quick review of logic and computational problems
Symbolic Implementation of the Best Transformer
Decidability of logical theories
The Lower Bounds of Problems
Decidability of logical theories
This Lecture Substitution model
Background material.
Presentation transcript:

Combining Abstract Interpreters Sumit Gulwani Microsoft Research Redmond, Group Ashish Tiwari SRI RADRAD

Motivation a 1 := a 1 +1; a 2 := a 2 +2; b 1 := F(b 1 ); b 2 := F(b 2 ); c 1 := F(2c 1 -c 2 ); c 2 := F(c 2 ); a 1 := 0; a 2 := 0; b 1 := 1; b 2 := F(1); c 1 := 2; c 2 := 2; Assert(a 2 =2a 1 ); Assert(b 2 = F(b 1 )); Assert(c 2 =c 1 ); b 1 < b 2 False True Abstract interpretation over the abstractions of linear arithmetic and uninterpreted functions can verify the first and second assertions respectively. Third assertion can be verified only over the combined abstraction.

Outline Logical product combination of lattices Abstract interpreter for logical product lattice –Join operator –Existential quantification operator –Correctness and Complexity

Logical Product of Lattices A lattice L consists of a domain D L and partial order ¹ L. A lattice L is a logical lattice over theory T if –D L = finite conjunctions of atomic facts over T – E ¹ L E iff E ) T E Let L1 and L2 be logical lattices over T1 and T2 resp. Then logical product of L1 and L2 is L1*L2, where –D L1*L2 = finite conjunctions of atomic facts over T1 [ T2 –E ¹ L1*L2 E iff E ) T1 [ T2 E and AlienTerms(E) µ Terms(E)

Outline Logical product combination of lattices Abstract interpreter for logical product lattice –Join operator –Existential quantification operator –Correctness and Complexity

Abstract Interpreter for L1*L2 Join Node x := g; E E Conditional Node p True False E E1E1 E2E2 Assignment Node E2E2 E E1E1 E = Join L1*L2 (E 1,E 2 ) We show how to get Join L1*L2 from Join L1 and Join L2. E 1 = Meet L1*L2 (E, p) E 2 = E Meet L1*L2 (E,E) = E Æ E E = EQ L1*L2 (E, {x}) E = E[x/x] Æ x=(g[x/x]) We show how to get EQ L1*L2 from EQ L1 and EQ L2.

Outline Logical product combination of lattices Abstract interpreter for logical product lattice Join operator –Existential quantification operator –Correctness and Complexity

Background: Combining Decision Procedures a 1 =2y 2 -y 1 y 1 · 4y 3 · a 2 y 1 = y 2 y 1 = a 2 a 2 =F(a 1 ) y 1 =F(y 1 ) Æ y 2 =F(F(y 1 )) y 1 = a 1 y 1 · 4y 3 · F(2y 2 -y 1 ) Æ y 1 =F(y 1 ) Æ y 2 =F(F(y 1 )) Purification y 1 =y 2 y 1 =a 1 y 1 =a 2 y 1 = 4y 3 Saturation y 1 = 4y 3 ? This classic algorithm was given by Nelson and Oppen in 1979.

Join Operator If E = Join L (E 1,E 2 ), then E is the least upper bound of E 1 and E 2 in lattice L Examples: Join la (z=0 Æ y=10, z=5 Æ y=5) = z+y=10 Æ 0 · z · 5 Join uf (z=a Æ y=F(a), z=b Æ y=F(b)) = y=F(z) Join la*uf (z=a-1 Æ y=F(a), z=b-1 Æ y=F(b)) = ?

Join Operator If E = Join L (E 1,E 2 ), then E is the least upper bound of E 1 and E 2 in lattice L Examples: Join la (z=0 Æ y=10, z=5 Æ y=5) = z+y=10 Æ 0 · z · 5 Join uf (z=a Æ y=F(a), z=b Æ y=F(b)) = y=F(z) Join la*uf (z=a-1 Æ y=F(a), z=b-1 Æ y=F(b)) = y=F(1+z) We next show how to construct Join L1*L2 using Join L1 and Join L2.

y=F(a) a= h a,b i z=a-1 a= h a,b i y=F(b) b= h a,b i z=b-1 b= h a,b i z=a-1 Æ y=F(a) z=b-1 Æ y=F(b) h a,b i =1+z y=F( h a,b i ) Join la Join uf EQ uf*la y=F(1+z) { h a,b i } Join uf+la Combining Join Operators

Outline Logical product combination of lattices Abstract interpreter for logical product lattice –Join operator Existential quantification operator –Correctness and Complexity

Existential Quantification Operator If E = EQ L (E,V), then E is the least (i.e., most precise) element in lattice L such that: E ¹ L E Vars(E) Å V = ; Examples: EQ la (x · a Æ a · y, {a}) = x · y EQ uf (x=F(a) Æ y=F 2 (a), {a}) = y=F(x) EQ la*uf (a · b · y Æ z=c+1 Æ a=F 2 (b) Æ c=F(b), {a,b,c}) = ?

Existential Quantification Operator If E = EQ L (E,V), then E is the least (i.e., most precise) element in lattice L such that: E ¹ L E Vars(E) Å V = ; Examples: EQ la (x · a Æ a · y, {a}) = x · y EQ uf (x=F(a) Æ y=F 2 (a), {a}) = y=F(x) EQ la*uf (a · b · y Æ z=c+1 Æ a=F 2 (b) Æ c=F(b), {a,b,c}) = F(z-1) · y We can construct EQ L1*L2 using EQ L1 and EQ L2.

a=F 2 (b) Æ c=F(b) a · b · y Æ z=c+1 a · b · y Æ z=c+1 Æ a=F 2 (b) Æ c=F(b) { a, b, c } { b } a · y Æ z=c+1 EQ uf Substitute F(z-1) · y c z-1 a F(z-1) EQ uf+la Combining Existential Quantification Operators c z-1 a F(z-1) Def la Def uf EQ la a = F(c)

Outline Logical product combination of lattices Abstract interpreter for logical product lattice –Join operator –Existential Quantification operator Correctness and Complexity

Correctness Our algorithms for Join L1*L2 and EQ L1*L2 are sound. They are complete when the underlying theories T1 and T2 are convex, stably infinite, and disjoint. Proof of correctness is non-trivial.

Computational Complexity Complexity of Join L1*L2 and EQ L1*L2 is worst-case quadratic in complexity of Join L1, Join L2, EQ L1, EQ L2. Steps required for fixed-point computation D L (E) = max # of elements in a chain above E in lattice L D L1 £ L2 (E) · D L1 (E 1 ) + D L2 (E 2 ) + |AlienTerms(E)| where E 1 and E 2 are purified and saturated components of E.

Conclusion and Future Work Defined combination L1*L2 of two lattices L1 and L2. –This logical product is more precise than reduced product. Described abstract interpretation operators for L1*L2 in terms of corresponding operators for L1 and L2. –Lends modularity to design & implementation of abstract interpreters. Future Work: Handle non-convex theories (eg. arrays) more precisely. Handle non-atomic facts involving negation & disjunction. Perform experiments.