1/20 Arrays Changki PSWLAB Arrays Daniel Kroening and Ofer Strichman Decision Procedure.

Slides:



Advertisements
Similar presentations
Logical Abstract Interpretation Sumit Gulwani Microsoft Research, Redmond.
Advertisements

Automated Theorem Proving Lecture 1. Program verification is undecidable! Given program P and specification S, does P satisfy S?
B ϋ CHIS MONADIC SECOND ORDER LOGIC Verification Seminar V.Sowjanya Lakshmi ( Subhasree M.
1 Decision Procedures An algorithmic point of view Equality Logic and Uninterpreted Functions.
Synthesis, Analysis, and Verification Lecture 04c Lectures: Viktor Kuncak VC Generation for Programs with Data Structures “Beyond Integers”
2005conjunctive-ii1 Query languages II: equivalence & containment (Motivation: rewriting queries using views)  conjunctive queries – CQ’s  Extensions.
Copyright , Doron Peled and Cesare Tinelli. These notes are based on a set of lecture notes originally developed by Doron Peled at the University.
Propositional and First Order Reasoning. Terminology Propositional variable: boolean variable (p) Literal: propositional variable or its negation p 
1 Combinational Logic Design&Analysis. 2 Introduction We have learned all the prerequisite material: – Truth tables and Boolean expressions describe functions.
Hoare’s Correctness Triplets Dijkstra’s Predicate Transformers
Technion 1 Generating minimum transitivity constraints in P-time for deciding Equality Logic Ofer Strichman and Mirron Rozanov Technion, Haifa, Israel.
1/30 SAT Solver Changki PSWLAB SAT Solver Daniel Kroening, Ofer Strichman.
Panel on Decision Procedures Panel on Decision Procedures Randal E. Bryant Lintao Zhang Nils Klarlund Harald Ruess Sergey Berezin Rajeev Joshi.
1/22 Programs : Semantics and Verification Charngki PSWLAB Programs: Semantics and Verification Mordechai Ben-Ari Mathematical Logic for Computer.
Daniel Kroening and Ofer Strichman Decision Procedures An Algorithmic Point of View Gaussian Elimination and Simplex.
Constraint Logic Programming Ryan Kinworthy. Overview Introduction Logic Programming LP as a constraint programming language Constraint Logic Programming.
Interpolants [Craig 1957] G(y,z) F(x,y)
1 Boolean Satisfiability in Electronic Design Automation (EDA ) By Kunal P. Ganeshpure.
Technion 1 Generating minimum transitivity constraints in P-time for deciding Equality Logic Ofer Strichman and Mirron Rozanov Technion, Haifa, Israel.
Technion 1 (Yet another) decision procedure for Equality Logic Ofer Strichman and Orly Meir Technion.
Reduced Functional Consistency of Uninterpreted Functions.
Software Verification Bertrand Meyer Chair of Software Engineering Lecture 2: Axiomatic semantics.
ECI 2007: Specification and Verification of Object- Oriented Programs Lecture 4.
Lesson 6. Refinement of the Operator Model This page describes formally how we refine Figure 2.5 into a more detailed model so that we can connect it.
Describing Syntax and Semantics
Ofer Strichman, Technion 1 Decision Procedures in First Order Logic Part II – Equality Logic and Uninterpreted Functions.
Ofer Strichman, Technion Deciding Combined Theories.
Daniel Kroening and Ofer Strichman 1 Decision Procedures in First Order Logic Decision Procedures for Equality Logic.
Daniel Kroening and Ofer Strichman Decision Procedure
1 First order theories. 2 Satisfiability The classic SAT problem: given a propositional formula , is  satisfiable ? Example:  Let x 1,x 2 be propositional.
1/25 Pointer Logic Changki PSWLAB Pointer Logic Daniel Kroening and Ofer Strichman Decision Procedure.
SAT Solver Math Foundations of Computer Science. 2 Boolean Expressions  A Boolean expression is a Boolean function  Any Boolean function can be written.
CSE 311 Foundations of Computing I Lecture 6 Predicate Logic, Logical Inference Spring
Deciding a Combination of Theories - Decision Procedure - Changki pswlab Combination of Theories Daniel Kroening, Ofer Strichman Presented by Changki.
1/20 Symbolic Execution and Program Testing Charngki PSWLAB Symbolic Execution and Program Testing James C.King IBM Thomas J.Watson Research Center.
Binary Decision Diagrams (BDDs)
Chapter 9 Integrity. Copyright © 2004 Pearson Addison-Wesley. All rights reserved.9-2 Topics in this Chapter Predicates and Propositions Internal vs.
Quantified Formulas - Decision Procedure Daniel Kroening, Ofer Strichman Presented by Changki Hong 07 NOV 08.
Daniel Kroening and Ofer Strichman 1 Decision Proceduresfoe Equality Logic 4 Range Allocation.
DECIDABILITY OF PRESBURGER ARITHMETIC USING FINITE AUTOMATA Presented by : Shubha Jain Reference : Paper by Alexandre Boudet and Hubert Comon.
1st-order Predicate Logic (FOL)
1 Automatic Refinement and Vacuity Detection for Symbolic Trajectory Evaluation Orna Grumberg Technion Haifa, Israel Joint work with Rachel Tzoref.
Introduction to Satisfiability Modulo Theories
ISBN Chapter 3 Describing Semantics -Attribute Grammars -Dynamic Semantics.
Parameterized Unit Tests By Nikolai Tillmann and Wolfram Schulte Proc. of ESEC/FSE 2005 Presented by Yunho Kim Provable Software Lab, KAIST TexPoint fonts.
Daniel Kroening and Ofer Strichman 1 Decision Procedures An Algorithmic Point of View BDDs.
Controller Synthesis for Pipelined Circuits Using Uninterpreted Functions Georg Hofferek and Roderick Bloem. MEMOCODE 2011.
Propositional Calculus CS 270: Mathematical Foundations of Computer Science Jeremy Johnson.
CS Introduction to AI Tutorial 8 Resolution Tutorial 8 Resolution.
CSE 311 Foundations of Computing I Lecture 7 Logical Inference Autumn 2012 CSE
Chapter 3 Part II Describing Syntax and Semantics.
Semantics In Text: Chapter 3.
CS6133 Software Specification and Verification
LDK R Logics for Data and Knowledge Representation First Order Logics (FOL) Originally by Alessandro Agostini and Fausto Giunchiglia Modified by Fausto.
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.
Controller Synthesis for Pipelined Circuits Using Uninterpreted Functions Georg Hofferek and Roderick Bloem. MEMOCODE 2011.
Daniel Kroening and Ofer Strichman Decision Procedures An Algorithmic Point of View Deciding Combined Theories.
Dr. Naveed Riaz Design and Analysis of Algorithms 1 1 Formal Methods in Software Engineering Lecture # 26.
Daniel Kroening and Ofer Strichman 1 Decision Procedures An Algorithmic Point of View Basic Concepts and Background.
1 A framework for eager encoding Daniel Kroening ETH, Switzerland Ofer Strichman Technion, Israel (Executive summary) (submitted to: Formal Aspects of.
1 Section 7.1 First-Order Predicate Calculus Predicate calculus studies the internal structure of sentences where subjects are applied to predicates existentially.
Daniel Kroening and Ofer Strichman 1 Decision Procedures in First Order Logic Decision Procedures for Equality Logic.
Satisfiability Modulo Theories and DPLL(T) Andrew Reynolds March 18, 2015.
CENG 424-Logic for CS Introduction Based on the Lecture Notes of Konstantin Korovin, Valentin Goranko, Russel and Norvig, and Michael Genesereth.
Daniel Kroening and Ofer Strichman 1 Decision Procedures for Equality Logic 1.
Decision Procedures in First Order Logic
Introduction to Logic for Artificial Intelligence Lecture 2
Propositional Calculus: Boolean Algebra and Simplification
CSE 311 Foundations of Computing I
Logics for Data and Knowledge Representation
Presentation transcript:

1/20 Arrays Changki PSWLAB Arrays Daniel Kroening and Ofer Strichman Decision Procedure

2/20 Arrays Changki PSWLAB Array logic  Arrays are a basic data structure that is used in most software programs  modeling memories and caches in hardware design.  Array logic permits expressions over arrays.  Arrays can be formalized as maps from an index type to an element type.  Array logic has two basic operations  Reading  Writing

3/20 Arrays Changki PSWLAB Contents  Introduction  Arrays as uninterpreted function  A reduction algorithm for array logic  Conclusion

4/20 Arrays Changki PSWLAB Array logic  Array is the set of functions that map an index value to an element.  Index type T I  Element type T E  Array type  Let denote an array.  Two basic operations on arrays: 1. Reading : reads an element with index from a. The value of the element of index i is denoted by a[i]. 2. Writing : writes an element with. Let denote the value to be written. The array a where element i has been replaced by e is denoted by a { i  e }.

5/20 Arrays Changki PSWLAB Index logic  Index logic  The index logic should permit existential and universal quantification.  Existential quantification  “There exists an array element that is zero”  Universal quantification  “All elements of the array are greater than zero”  Array logic is defined by index logic and element logic  Validity for array logic is undecidable, since index logic permits existential and universal quantification.  First-order-logic is undecidable.

6/20 Arrays Changki PSWLAB The syntax of array logic  atom I denotes an atom in the index logic  atom E denotes an atom in the element logic

7/20 Arrays Changki PSWLAB Read-over-write axiom  Read-over-write axiom  McCarthy proposed.  After the value e has been written into array a at index i, the value of this array at index i is e. The value at any index j ≠ i matches that in the array before the write operation at index j :

8/20 Arrays Changki PSWLAB Example  The main step of correctness argument is to show that the invariant in the line 7 is maintained by the assignment in line 6.  A common way to do so is to generate verification conditions.

9/20 Arrays Changki PSWLAB Example (cond.)  We can obtain the following verification condition for the claim:  Proving validity of this formula shows that the loop invariant is maintained.  Prove by means of read-over-write axiom

10/20 Arrays Changki PSWLAB Arrays as uninterpreted functions  Here we consider a method to check satisfiability of array logic formula whose quantifications are removed by a reduction mechanism.  We will see the reduction scheme.  array logic formula with quantification  array logic formula without quantification  Here  array logic formula without quantification  equality formula with uninterpreted functions  How to reduce?  array type  uninterpreted function  index type  function argument

11/20 Arrays Changki PSWLAB Example  Array logic without quantification  Equality formula with an uninterpreted function  Apply Bryant’s reduction

12/20 Arrays Changki PSWLAB A reduction algorithm for array logic  We define here a restricted class of array logic formulas in order to obtain decidability.  Recall arbitrary formula of original array logic is undecidable.  From hereon we will learn how to reduce given an array logic formula to the decidable array logic formula.  We consider formulas that are Boolean combinations of array property.  The reduced decidable array logic formula has array property.

13/20 Arrays Changki PSWLAB Array property  Def. An array logic formula is called an array property if and only if it is of the form  and satisfies the following conditions: 1. The predicate, called the index guard, must follow the grammar. 2. The predicate is called the value constraint. The “ integer-identifier ” used in “ term ” must not be.

14/20 Arrays Changki PSWLAB Extensionality rule  Def. Extensionality rule is the elementwise equality of two arrays.  Extensionality is an array property:  index guard is simply TRUE in this case.  is the value constraint of Extensionality rule.

15/20 Arrays Changki PSWLAB Example  Array logic formula  Array property formula  Only second conjunct is not array property formula  Write-rule : Array updates can be handled by replacing each expression of the form by a fresh variable a’ of array type, and by adding two constraints that correspond directly to the two cases of the read-over-write axiom: 1. for the value that is written, 2. for the values that are unchanged.

16/20 Arrays Changki PSWLAB A reduction algorithm  Array-Reduction  Input : An array property formula  Output : A formula with uninterpreted functions 1. Apply the write rule to remove all array updates from. 2. Replace all existential quantifications of the form by P(j), where j is a fresh variable. 3. Replace all universal quantifications of the form by 4. Replace the array read operations by uninterpreted functions and obtain. 5. return.

17/20 Arrays Changki PSWLAB A reduction algorithm  In step 3  The universal quantifiers replaced by the conjunction, where the set denotes the index variables that i might possibly be equal to in the formula.  set contains the following element : 1. All variables used as an array index in that are not quantified variables. 2. All variables used inside index guards in that are not quantified variables. 3. If contains none of the above, is {0} in order to obtain a nonempty set of index variables.

18/20 Arrays Changki PSWLAB Example  We want to check satisfiability of 1. Apply the write rule to remove all array updates from. 2. Replace all existential quantifications of the form by P(z), where z is a fresh variable. == =

19/20 Arrays Changki PSWLAB Example (cond.) 3. Replace all universal quantifications of the form by, where = { i, z } 4. Remove trivially satisfied conjuncts. 5. Replace the two arrays a and a’ by uninterpreted functions F a and F a ’.

20/20 Arrays Changki PSWLAB Conclusion  Validity of an array logic formula without any reduction is undecidable.  Reduction algorithm needed.  Reduction algorithm outputs a formula with uninterpreted functions