Parametric Shape Analysis via 3-Valued Logic

Slides:



Advertisements
Similar presentations
1 First order theories (Chapter 1, Sections 1.4 – 1.5)
Advertisements

Techniques for proving programs with pointers A. Tikhomirov.
The Logic of Quantified Statements
Predicate Abstraction and Canonical Abstraction for Singly - linked Lists Roman Manevich Mooly Sagiv Tel Aviv University Eran Yahav G. Ramalingam IBM T.J.
3-Valued Logic Analyzer (TVP) Tal Lev-Ami and Mooly Sagiv.
August Moscow meeting1August Moscow meeting1August Moscow meeting11 Deductive tools in insertion modeling verification A.Letichevsky.
Review of topics Final exam : -May 2nd to May 7 th - Projects due on May 7th.
Computability and Complexity 9-1 Computability and Complexity Andrei Bulatov Logic Reminder (Cnt’d)
Computability and Complexity 8-1 Computability and Complexity Andrei Bulatov Logic Reminder.
1 Lecture 07 – Shape Analysis Eran Yahav. Previously  LFP computation and join-over-all-paths  Inter-procedural analysis  call-string approach  functional.
1 Lecture 08(a) – Shape Analysis – continued Lecture 08(b) – Typestate Verification Lecture 08(c) – Predicate Abstraction Eran Yahav.
1 Operational Semantics Mooly Sagiv Tel Aviv University Textbook: Semantics with Applications.
Specialized Reference Counting Garbage Collection using Data Structure Annotations By Eric Watkins and Dzin Avots for CS 343 Spring 2002.
Establishing Local Temporal Heap Safety Properties with Applications to Compile-Time Memory Management Ran Shaham Eran Yahav Elliot Kolodner Mooly Sagiv.
1 2. Constraint Databases Next level of data abstraction: Constraint level – finitely represents by constraints the logical level.
Finite Differencing of Logical Formulas for Static Analysis Thomas Reps University of Wisconsin Joint work with M. Sagiv and A. Loginov.
1 Verifying Temporal Heap Properties Specified via Evolution Logic Eran Yahav, Tom Reps, Mooly Sagiv and Reinhard Wilhelm
Model Checking of Concurrent Software: Current Projects Thomas Reps University of Wisconsin.
1 Shape Analysis via 3-Valued Logic Mooly Sagiv Tel Aviv University Shape analysis with applications Chapter 4.6
Invisible Invariants: Underapproximating to Overapproximate Ken McMillan Cadence Research Labs TexPoint fonts used in EMF: A A A A A.
Program Analysis Mooly Sagiv Tel Aviv University Sunday Scrieber 8 Monday Schrieber.
A Semantics for Procedure Local Heaps and its Abstractions Noam Rinetzky Tel Aviv University Jörg Bauer Universität des Saarlandes Thomas Reps University.
Static Program Analysis via Three-Valued Logic Thomas Reps University of Wisconsin Joint work with M. Sagiv (Tel Aviv) and R. Wilhelm (U. Saarlandes)
1/25 Pointer Logic Changki PSWLAB Pointer Logic Daniel Kroening and Ofer Strichman Decision Procedure.
Cheng/Dillon-Software Engineering: Formal Methods Model Checking.
Mark Marron IMDEA-Software (Madrid, Spain) 1.
Dagstuhl Seminar "Applied Deductive Verification" November Symbolically Computing Most-Precise Abstract Operations for Shape.
Program Analysis and Verification Noam Rinetzky Lecture 10: Shape Analysis 1 Slides credit: Roman Manevich, Mooly Sagiv, Eran Yahav.
Program Analysis and Verification Spring 2015 Program Analysis and Verification Lecture 2: Operational Semantics I Roman Manevich Ben-Gurion University.
Automatic Verification of Pointer Programs using Grammar-based Shape Analysis Hongseok Yang Seoul National University (Joint Work with Oukseh Lee and Kwangkeun.
1 Employing decision procedures for automatic analysis and verification of heap-manipulating programs Greta Yorsh under the supervision of Mooly Sagiv.
Shape Analysis Overview presented by Greta Yorsh.
Shape Analysis via 3-Valued Logic Mooly Sagiv Thomas Reps Reinhard Wilhelm
Symbolically Computing Most-Precise Abstract Operations for Shape Analysis Greta Yorsh Thomas Reps Mooly Sagiv Tel Aviv University University of Wisconsin.
Model construction and verification for dynamic programming languages Radu Iosif
Program Analysis and Verification Spring 2014 Program Analysis and Verification Lecture 4: Axiomatic Semantics I Roman Manevich Ben-Gurion University.
Programming Languages and Design Lecture 3 Semantic Specifications of Programming Languages Instructor: Li Ma Department of Computer Science Texas Southern.
CS6133 Software Specification and Verification
1 Shape Analysis via 3-Valued Logic Mooly Sagiv Tel Aviv University Shape analysis with applications Chapter 4.6
Nikolaj Bjørner Microsoft Research DTU Winter course January 2 nd 2012 Organized by Flemming Nielson & Hanne Riis Nielson.
Program Analysis and Verification Spring 2015 Program Analysis and Verification Lecture 4: Axiomatic Semantics I Roman Manevich Ben-Gurion University.
Operational Semantics Mooly Sagiv Tel Aviv University Textbook: Semantics with Applications Chapter.
Albert Gatt LIN3021 Formal Semantics Lecture 3. Aims This lecture is divided into two parts: 1. We make our first attempts at formalising the notion of.
1 Program Analysis via 3-Valued Logic Mooly Sagiv, Tal Lev-Ami, Roman Manevich Tel Aviv University Thomas Reps, University of Wisconsin, Madison Reinhard.
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.
Program Analysis via 3-Valued Logic Thomas Reps University of Wisconsin Joint work with Mooly Sagiv and Reinhard Wilhelm.
Operational Semantics Mooly Sagiv Tel Aviv University Sunday Scrieber 8 Monday Schrieber.
Shape & Alias Analyses Jaehwang Kim and Jaeho Shin Programming Research Laboratory Seoul National University
Interprocedural shape analysis for cutpoint-free programs Noam Rinetzky Tel Aviv University Joint work with Mooly Sagiv Tel Aviv University Eran Yahav.
Putting Static Analysis to Work for Verification A Case Study Tal Lev-Ami Thomas Reps Mooly Sagiv Reinhard Wilhelm.
Program Analysis and Verification Spring 2015 Program Analysis and Verification Lecture 8: Static Analysis II Roman Manevich Ben-Gurion University.
Interprocedural shape analysis for cutpoint-free programs
Spring 2017 Program Analysis and Verification
Beyond Strong vs. Weak Updates Isil Dillig, Thomas Dillig, Alex Aiken
Spring 2016 Program Analysis and Verification
Program Analysis and Verification
Planning as model checking, (OBDDs)
G. Ramalingam Microsoft Research, India & K. V. Raghavan
Symbolic Implementation of the Best Transformer
Formal Methods in software development
Parametric Shape Analysis via 3-Valued Logic
Formal Methods in software development
Predicate Transformers
((a)) A a and c C ((c))
Symbolic Characterization of Heap Abstractions
Formal Methods in software development
A Semantics for Procedure Local Heaps and its Abstractions
A simple function.
Representations & Reasoning Systems (RRS) (2.2)
Presentation transcript:

Parametric Shape Analysis via 3-Valued Logic Mooly Sagiv Thomas Reps Reinhard Wilhelm

Goals Capture storage invariants May-alias information x points to a list, tree, dag, etc. May-alias information Sharing of structures x and y point to structures that do not share cells Parametric Framework for a collection of analyses Basis for an analysis-generation tool

The Shape-Analysis Problem For every program point, compute a finite characterization of the possible “shapes” of the heap-allocated data structures.

Formalizing “. . .” Informal: x y Formal: x y

Formalizing “. . .” Informal: Formal: x y x y {x} transitively pointed to by

Formalizing “. . .” Informal: t1 x y t2 Formal: x y t2 t1

Formalizing “. . .” Informal: t1 t2 Formal: t1 t2 x y x y {x} {x} {t2,y} {t2,y}

Abstract Interpretation f(a,b) = (16 * b + 3) * (2 * a + 1) * + b 1 2 a 3 16

Abstract Interpretation f(a,b) = (16 * b + 3) * (2 * a + 1) O * + b 1 2 a 3 16 O O O E E O E ? E ? f : _  _  O

Abstract Interpretation Concrete

Outline Using logic to describe stores Using logic to express store transformations Forming abstractions of stores Three-valued logic Using three-valued logic to express transformations of abstract stores

Logic (Syntax) Vocabulary Formulas Predicate symbols: p1, p2, . . ., pn Constant symbols: c1, c2, . . ., cm Function symbols: f1, f2, . . ., fk Formulas Variables Equality-predicate symbol: = Logical constant symbols: 0, 1 Connectives: , ,  Quantifiers: , 

Using Logic to Describe Stores Predicate Symbols Whether variable x points to location u: x(u) Pointer fields: n(u1, u2) car(u1, u2) cdr(u1, u2) x u u1 u2 u1 u2 u1 u2

Using Logic to Describe Stores Formulas: Other Properties of Locations un(v)   v1,v2 : n(v1,v)  n(v2,v)  v1 = v2 u3 u4 u1 u2 un(u1) = 1 un(u2) = 1 un(u4) = 1 un(u3) = 1 u3 u1 u2 un(u1) = 1 un(u2) = 0 un(u3) = 1

Logic (Semantics) Truth values: 0, 1 Logical Structures Individuals: U = {u1, u2, . . ., un} Predicates: pi : U arity(pi)  {0, 1}

An Example Individuals: U = {u1, u2, u3} Predicates: x u1 x u1 u3 u1 y u3 y u3 Individuals: U = {u1, u2, u3} Predicates:

Logic (Semantics) Assignments Z: free variables  individuals Meaning of a formula (Z)

Meaning of a Formula  (v,v1,v2) = n(v1,v)  n(v2,v)  v1 = v2 x u1 u2 y u3  (v,v1,v2) = n(v1,v)  n(v2,v)  v1 = v2 Z = { v  u2, v1  u1, v2  u3} (Z) = ???

Meaning of a Formula (Z) pi(v1, …, vk) (Z) = pi (Z(v1), …, Z(vk)) 1  2(Z) = 1 (Z)  2(Z) 1  2(Z) = 1 (Z)  2(Z) 1  2(Z) = 1 (Z)  2(Z)

Meaning of a Formula  (v,v1,v2) = n(v1,v)  n(v2,v)  v1 = v2 y x  (v,v1,v2) = n(v1,v)  n(v2,v)  v1 = v2 Z = { v  u2, v1  u1, v2  u3} (Z) = n(v1,v)  n(v2,v) (Z)  v1 = v2(Z) = n(u1, u2)  n(u3, u2)  u1 = u3 = 1  1  0 = 0

Outline Using logic to describe stores Using logic to express store transformations Forming abstractions of stores Three-valued logic Using three-valued logic to express transformations of abstract stores

Using Logic to Change Stores x = null Before: x u3 u1 u2 y z After: u3 u1 u2 y z x

Predicate-Alteration Formulas for x = null Old: x u3 u1 u2 y z New: u3 u1 u2 x[x = null](v)  0

Predicate-Alteration Formulas for x = null Old: x u3 u1 u2 y z New: u3 u1 u2 y y[x = null](v)  y(v)

Predicate-Alteration Formulas for x = null Old: x u3 u1 u2 y z New: u3 u1 u2 y z z[x = null](v)  z(v)

Predicate-Alteration Formulas for x = null Old: x u3 u1 u2 y z New: y u1 u2 z u3

Predicate-Alteration Formulas for x = null Old: x u3 u1 u2 y z New: y u1 u2 z u3 n[x = null](v1,v2)  n(v1,v2) n n

Predicate-Alteration Formulas for x = null Old: x u3 u1 u2 y z New: y u1 u2 z u3 n n

Predicate-Alteration Formulas for x = null Old: x u3 u1 u2 y z New: y u1 u2 z u3 n n

Outline Using logic to describe stores Using logic to express store transformations Forming abstractions of stores Three-valued logic Using three-valued logic to express transformations of abstract stores

Abstraction Principle u1 u2 u3 u4 x u1 u234 x

Abstraction Principle u1 u2 u3 u4 x un(v)   v1,v2 : n(v1,v)  n(v2,v)  v1 = v2 u1 u234 x

Outline Using logic to describe stores Using logic to express store transformations Forming abstractions of stores Three-valued logic Using three-valued logic to express transformations of abstract stores

Two- vs. Three-Valued Logic 1 Two-valued logic {0,1} {0} {1} Three-valued logic

Two- vs. Three-Valued Logic Two-valued logic Three-valued logic {1} {0,1} {0} 1  1

Outline Using logic to describe stores Using logic to express store transformations Forming abstractions of stores Three-valued logic Using three-valued logic to express transformations of abstract stores