Combining Theories Sharing Set Operations Thomas Wies joint work with Ruzica Piskac and Viktor Kuncak TexPoint fonts used in EMF. Read the TexPoint manual.

Slides:



Advertisements
Similar presentations
Model Checking Lecture 4. Outline 1 Specifications: logic vs. automata, linear vs. branching, safety vs. liveness 2 Graph algorithms for model checking.
Advertisements

Assertion Checking over Combined Abstraction of Linear Arithmetic and Uninterpreted Functions Sumit Gulwani Microsoft Research, Redmond Ashish Tiwari SRI.
Automated Theorem Proving Lecture 1. Program verification is undecidable! Given program P and specification S, does P satisfy S?
PARIXIT PRASAD December 4, 2013 Parixit Prasad | CSA - IISC 1 Deciding Presburger Arithmetic Using Automata Department of Computer Science and Automaton.
Synthesis, Analysis, and Verification Lecture 04c Lectures: Viktor Kuncak VC Generation for Programs with Data Structures “Beyond Integers”
An Introduction to the Model Verifier verds Wenhui Zhang September 15 th, 2010.
Linked List Implementation class List { private List next; private Object data; private static List root; private static int size; public static void addNew(Object.
On Solving Presburger and Linear Arithmetic with SAT Ofer Strichman Carnegie Mellon University.
Rigorous Software Development CSCI-GA Instructor: Thomas Wies Spring 2012 Lecture 11.
Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
1 Cover Algorithms and Their Combination Sumit Gulwani, Madan Musuvathi Microsoft Research, Redmond.
Panel on Decision Procedures Panel on Decision Procedures Randal E. Bryant Lintao Zhang Nils Klarlund Harald Ruess Sergey Berezin Rajeev Joshi.
1 Introduction to Computability Theory Lecture12: Decidable Languages Prof. Amos Israeli.
Introduction to Computability Theory
1 Introduction to Computability Theory Lecture7: PushDown Automata (Part 1) Prof. Amos Israeli.
On the Use of Automata Techniques to Decide Satisfiability Mia Minnes May 3, 2005.
Interpolants [Craig 1957] G(y,z) F(x,y)
1 Deciding separation formulas with SAT Ofer Strichman Sanjit A. Seshia Randal E. Bryant School of Computer Science, Carnegie Mellon University.
CS Master – Introduction to the Theory of Computation Jan Maluszynski - HT Lecture 4 Context-free grammars Jan Maluszynski, IDA, 2007
1 A propositional world Ofer Strichman School of Computer Science, Carnegie Mellon University.
Prof. Necula CS Lecture 111 Theorem Proving for FOL Satisfiability Procedures CS Lecture 11.
Automating Separation Logic with Trees and Data Ruzica Piskac Yale University Thomas Wies New York University Damien Zufferey MIT CSAIL CAV, ,
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.
Second Order Monadic Theory of One Successor Presented By: Tamar Aizikowitz Spring 2007 Automata Seminar.
Regular Languages A language is regular over  if it can be built from ;, {  }, and { a } for every a 2 , using operators union ( [ ), concatenation.
Deciding a Combination of Theories - Decision Procedure - Changki pswlab Combination of Theories Daniel Kroening, Ofer Strichman Presented by Changki.
Cristian Gherghina Joint work with: Wei-Ngan Chin, Razvan Voicu, Quang Loc Le Florin Craciun, Shengchao Qin TexPoint fonts used in EMF. Read the TexPoint.
Regular Model Checking Ahmed Bouajjani,Benget Jonsson, Marcus Nillson and Tayssir Touili Moran Ben Tulila
A Brief Summary for Exam 1 Subject Topics Propositional Logic (sections 1.1, 1.2) –Propositions Statement, Truth value, Proposition, Propositional symbol,
1 A Combination Method for Generating Interpolants Greta Yorsh Madan Musuvathi Tel Aviv University, Israel Microsoft Research, Redmond, US CAV’05.
DECIDABILITY OF PRESBURGER ARITHMETIC USING FINITE AUTOMATA Presented by : Shubha Jain Reference : Paper by Alexandre Boudet and Hubert Comon.
Minimization of Symbolic Automata Presented By: Loris D’Antoni Joint work with: Margus Veanes 01/24/14, POPL14.
SAT and SMT solvers Ayrat Khalimov (based on Georg Hofferek‘s slides) AKDV 2014.
Automatic Structures Bakhadyr Khoussainov Computer Science Department The University of Auckland, New Zealand.
Theory of Computing Lecture 17 MAS 714 Hartmut Klauck.
Calculus of Data Structures for verification, and synthesis Viktor Kuncak Lab for Automated Reasoning and Analysis EPFL School of Computer and Communication.
Ana Sokolova University of Salzburg joint work with Bart Jacobs Radboud University Nijmegen Coalgebra Day, , RUN 1 TexPoint fonts used in EMF.
Integrating high-level constructs into programming languages Language extensions to make programming more productive Underspecified programs –give assertions,
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.
Lecture 1 Overview Topics 1. Proof techniques: induction, contradiction Proof techniques June 1, 2015 CSCE 355 Foundations of Computation.
Synthesis, Analysis, and Verification Lecture 08 Lectures: Viktor Kuncak BAPA: Quantifier Elimination and Decision Procedures WS1S: Automata-Based Decision.
Strings Basic data type in computational biology A string is an ordered succession of characters or symbols from a finite set called an alphabet Sequence.
Lecture 4 Infinite Cardinals. Some Philosophy: What is “2”? Definition 1: 2 = 1+1. This actually needs the definition of “1” and the definition of the.
The decidability of Presburger Arithmetic By Guillermo Guillen 04/13/05 Dr. Smith COT 6421 FIU Spring 2005.
Learning Universally Quantified Invariants of Linear Data Structures Pranav Garg 1, Christof Loding, 2 P. Madhusudan 1 and Daniel Neider 2 1 University.
This Week Lecture on relational semantics Exercises on logic and relations Labs on using Isabelle to do proofs.
Daniel Kroening and Ofer Strichman Decision Procedures An Algorithmic Point of View Deciding Combined Theories.
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.
Daniel Kroening and Ofer Strichman 1 Decision Procedures An Algorithmic Point of View Basic Concepts and Background.
Relational String Verification Using Multi-track Automata.
Selected Decision Procedures and Techniques for SMT More on combination – theories sharing sets – convex theory Un-interpreted function symbols (quantifier-free.
1 Finite Model Theory Lecture 5 Turing Machines and Finite Models.
Computability Examples. Reducibility. NP completeness. Homework: Find other examples of NP complete problems.
Computer Systems Laboratory Stanford University Clark W. Barrett David L. Dill Aaron Stump A Framework for Cooperating Decision Procedures.
Chapter 2 1. Chapter Summary Sets (This Slide) The Language of Sets - Sec 2.1 – Lecture 8 Set Operations and Set Identities - Sec 2.2 – Lecture 9 Functions.
Satisfiability Modulo Theories and DPLL(T) Andrew Reynolds March 18, 2015.
Counterexample-Guided Abstraction Refinement By Edmund Clarke, Orna Grumberg, Somesh Jha, Yuan Lu, and Helmut Veith Presented by Yunho Kim Provable Software.
Decision Procedures in First Order Logic
Lazy Proofs for DPLL(T)-Based SMT Solvers
Formal Language & Automata Theory
Introduction to Automata Theory
Lifting Propositional Interpolants to the Word-Level
ECE/CS 584: Verification of Embedded Computing Systems
A Brief Summary for Exam 1
Viktor Kuncak EPFL Martin Rinard MIT
Sharing Set Operations
Herbrand Logic Semantics
Presentation transcript:

Combining Theories Sharing Set Operations Thomas Wies joint work with Ruzica Piskac and Viktor Kuncak TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: A A A AAAA

34 Fragment of Insertion into Tree right left right left data p tmp left data size: root e

Program Verification with Jahob implementation specification, proof hints

Generated Verification Condition Expressing this VC requires a rich logic –transitive closure * (in lists and also in trees) –unconstraint functions (data, data0) –cardinality operator on sets |... | Is there a decidable logic containing all this? “The number of stored objects has increased by one.”  next0*(root0,n)  x  {data0(v) | next0*(root0,v)}  next=next0[n:=root0]  data=data0[n:=x]  |{data(v). next*(n,v)}| = |{data0(v). next0*(root0,v)}| + 1

Outline I.Idea of decision procedure: reduction to a shared theory of sets II.BAPA-reducible theories III.BAPA-reduction for WS1S

Decomposing the Formula Consider a (simpler) formula |{data(x). next*(root,x)}|=k+1 Introduce fresh variables denoting sets: A = {x. next*(root,x)}  B = {y.  x. data(x,y)  x  A}  |B|=k+1 1) WS2S 2) C 2 3) BAPA Good news: conjuncts are in decidable fragments Next: explain these decidable fragments Bad news: conjuncts share more than just equality (they share set variables and set operations)

WS2S: Monadic 2 nd Order Logic Weak Monadic 2 nd -order Logic of 2 Successors F ::= x=f1(y) | x=f2(y) | x  S | S  T | 9 S.F | F 1 Æ F 2 | : F - quantification is over finite sets of positions in a tree - transitive closure encoded using set quantification Decision procedure using tree automata (e.g. MONA) f2 f1 f2 f1 f2 f1

C 2 : Two-Variable Logic w/ Counting Two-Variable Logic with Counting F ::= P(v 1,...,v n ) | F 1 Æ F 2 | : F | 9 count v i.F where P : is a predicate symbol v i : is one of the two variable names x,y count : is =k,  k, or  k for nonnegative constants k We can write ( 9  k v i.F) as |{v i.F}|  k We can define 9, 8 and axiomatize total functions: 8 x 9 =1 y.R(x,y) Decidable sat. and fin-sat. (1997), NEXPTIME even for binary-encoded k: Pratt-Hartman ‘05

BAPA (Kuncak et al. CADE’05): Boolean Algebra with Presburger Arithmetic BAPA decidable in alternating time (V. Kuncak et al. JAR’06), QFBAPA decidable in NP (V. Kuncak et al. CADE’07) Also decidable: qf fragment of multisets w/ cardinalities (R. Piskac and V. Kuncak VMCAI’08,CAV’08,CSL’08) New: role of BAPA in combination of theories sharing sets S ::= V | S 1 [ S 2 | S 1 Å S 2 | S 1 n S 2 T ::= k | C | T 1 + T 2 | T 1 – T 2 | C ¢ T | |S| A ::= S 1 = S 2 | S 1 µ S 2 | T 1 = T 2 | T 1 < T 2 F ::= A | F 1 Æ F 2 | F 1 Ç F 2 | : F | 9 S.F | 9 k.F

Combining Theories by Reduction Satisfiability problem expressed in HOL: (all free symbols existentially quantified)  next,data,k,root. 9 A,B. A = {x. next*(root,x)}  B = {y.  x. data(x,y)  x  A}  |B|=k+1 We assume formulas share only: - set variables (sets of uninterpreted elems) - individual variables, as a special case - {x} 1) WS2S 2) C 2 3) BAPA

Extend decision procedures for fragments into projection procedures that reduce each conjunct to a decidable shared theory Satisfiability problem expressed in HOL, after moving fragment-specific quantifiers  A,B.  next,root. A = {x. next*(root,x)}   data. B = {y.  x. data(x,y)  x  A}   k. |B|=k+1 Combining Theories by Reduction F WS2S F C2 F BAPA applies 9 to all non-set variables

Satisfiability problem expressed in HOL, after moving fragment-specific quantifiers  A,B.  next,root. A = {x. next*(root,x)}   data. B = {y.  x. data(x,y)  x  A}   k. |B|=k+1 Check satisfiability of conjunction of projections Combining Theories by Reduction F WS2S F C2 F BAPA  A,B. F WS2S Æ F C2 Æ F BAPA Conjunction of projections satisfiable  so is original formula

Decision Procedure for Combination Separate formula into WS2S, C 2, BAPA parts For each part, compute projection onto set vars Check satisfiability of conjunction of projections What is the right target theory for expressing the projections onto set variables?

Outline I.Idea of decision procedure: reduction to a shared theory of sets II.BAPA-reducible theories III.BAPA-reduction of WS1S

Reduction to BAPA F expresses “R is bijection between A and B” Consider the C 2 formula Projection of F onto A and B gives Cardinalities are needed to express projections ! BAPA

BAPA-Reducibility Definition: Logic is BAPA-reducible iff there is an algorithm that computes projections of formulas onto set variables, and these projections are BAPA formulas. Theorem: 1) WS2S, 2) C 2, 3) BAPA, 4) BSR, 5) qf-multisets are all BAPA-reducible. Thus, their set-sharing combination is decidable.

Amalgamation of Models: The Disjoint Case model for F model for G model for F Æ G ? Cardinalities of the models coincide

Amalgamation of Models: The Set-Sharing Case model for F model for G model for F Æ G Cardinalities of all Venn regions over shared sets coincide

BAPA-reducible Theories

Outline I.Idea of decision procedure: reduction to a shared theory of sets II.BAPA-reducible theories III.BAPA-reduction of WS1S

BAPA-reduction for WS1S WS1S formula for a regular language F = ((A Æ: B)(B Æ: A))* ( : B Æ: A)* Formulas are interpreted over finite words Symbols in alphabet correspond to ( : A Æ: B),(A Æ: B),( : A Æ B),(A Æ B) Model of formula F ABAB

BAPA-reduction for WS1S WS1S formula for a regular language F = ((A Æ: B)(B Æ: A))* ( : B Æ: A)* Model of formula F A,B denote sets of positions in the word w.,,, denote Venn regions over A,B Parikh image gives card.s of Venn regions Parikh(w) = {  7,  4,  4,  0} ABAB } w

BAPA-reduction for WS1S Decision procedure for sat. of WS1S: - construct finite word automaton A from F - check emptiness of L(A) Parikh 1966: Parikh image of a regular language is semilinear and effectively computable from the finite automaton Construct BAPA formula from Parikh image of the reg. lang.

BAPA-reduction for WS1S WS1S formula for a regular language F = ((A Æ: B)(B Æ: A))* ( : B Æ: A)* Parikh image of the models of F: Parikh(F) = {(q,p,p,0) | q,p ¸ 0} BAPA formula for projection of F onto A,B: |A Å B c | = |A c Å B| Æ |A Å B| =

4 Fragment of Insertion into Tree right left right left data p tmp left e data size:

Reduction of VC for insertAt Conjunction of projections unsatisfiable  so is original formula

Related Work on Combination Nelson-Oppen, 1980 – disjoint theories reduces to equality logic (finite # of formulas) Tinelli, Ringeissen, 2003 – general non-disjoint we consider the particular case of sets Ghilardi – sharing locally finite theories cardinality on sets needed, not locally finite Fontaine – gentle theories (BSR, …) disjoint case only Ruess, Klaedtke – WS2S + cardinality (no C 2 ) Reduction procedures to SAT (UCLID) we reduce to (QF)BAPA (NP-complete) reduction QFBAPA  QFPA  SAT non-trivial

Summary Presented new combination technique for theories sharing sets by reduction to a common shared theory (BAPA). Identified an expressive decidable set-sharing combination of theories by extending their decision procedures to BAPA-reductions 1) WS2S, 2) C 2, 3) BSR, 4) BAPA, 5) qf-multisets Resulting theory is useful for automated verification of complex properties of data structure implementations.

Combining Logics and Verifiers Bohne infers loop invariants of the form: B(S 1,…,S n ) = Univ where B(S 1,…,S n ) is a Boolean algebra expr. over sets S 1,…,S n defined in the individual theories