Static Program Analysis using Abstract Interpretation

Size: px
Start display at page:

Download "Static Program Analysis using Abstract Interpretation"

Transcription

1 Static Program Analysis using Abstract Interpretation

2 Introduction

3 Static Program Analysis Static program analysis consists of automatically discovering properties of a program that hold for all possible execution paths of the program. Static program analysis is not Testing: manually checking a property for some execution paths Model checking: automatically checking a property for all execution paths

4 Program Analysis for what? Optimizing compilers Semantic preprocessing: Model checking Automated test generation Program verification

5 Program Verification Check that every operation of a program will never cause an error (division by zero, buffer overrun, deadlock, etc.) Example: int a[1000]; for (i = 0; i < 1000; i++) { safe operation a[i] = ; // 0 <= i <= 999 } buffer overrun a[i] = ; // i = 1000;

6 Incompleteness of Program Analysis Discovering a sufficient set of properties for checking every operation of a program is an undecidable problem! Every non trivial behavioral property has (at least) NP complexity False positives: operations that are safe in reality but which cannot be decided safe or unsafe from the properties inferred by static analysis.

7 Precision versus Efficiency Precision: number of program operations that can be decided safe or unsafe by an analyzer. Precision and computational complexity are strongly related Tradeoff precision/efficiency: limit in the average precision and scalability of a given analyzer Greater precision and scalability is achieved through specialization

8 Soundness What guarantees the soundness of the analyzer results? In dataflow analysis and type inference the soundness proof of the resolution algorithm is independent from the analysis specification An independent soundness proof precludes the use of test-and-try techniques Need for analyzers correct by construction

9 Abstract Interpretation A general methodology for designing static program analyzers that are: Correct by construction Generic Easy to fine-tune Scalability is difficult to achieve but the payoff is worth the effort!

10 Approximation The core idea of Abstract Interpretation is the formalization of the notion of approximation An approximation of memory configurations is first defined Then the approximation of all atomic operations The approximation is automatically lifted to the whole program structure

11 Overview of Abstract Interpretation Start with a formal specification of the program semantics (the concrete semantics) Construct abstract semantic equations w.r.t. a parametric approximation scheme Use general fixpoints algorithms to solve the abstract semantic equations Try-and-test various instantiations of the approximation scheme in order to find the best fit

12 The Methodology of Abstract Interpretation

13 Methodology Concrete Semantics Tuners Collecting Semantics Abstract Domain Abstract Domain Partitioning Abstract Semantics Iterative Resolution Algorithms

14 Lattices and Fixpoints A lattice (L,,,,, ) is a partially ordered set (L, ) with: Least upper bounds ( ) and greatest lower bounds ( ) operators A least element bottom : A greatest element top : L is complete if all least upper bounds exist A fixpoint X of F: L L satisfies F(X) = X We denote by lfp F the least fixpoint if it exists

15 Fixpoint Theorems Knaster-Tarski theorem: If F: L L is monotone and L is a complete lattice, the set of fixpoints of F is also a complete lattice. Kleene theorem: If F: L L is monotone, L is a complete lattice and F preserves all least upper bounds then lfp F is the limit of the sequence: F 0 = F n+1 = F (F n )

16 Methodology Concrete Semantics Tuners Collecting Semantics Abstract Domain Abstract Domain Partitioning Abstract Semantics Iterative Resolution Algorithms

17 Concrete Semantics Small-step operational semantics: ( s = program point, env s s' Example: 1: n = 0; 2: while n < 1000 do 3: n = n + 1; 4: end 5: exit 1, n n 0 n 0 n 1 n 1 n 1000 Undefined value

18 Control Flow Graph 1: n = 0; n = 0 1 2: while n < 1000 do n n < : n = n + 1; 4: end 3 4 n = n + 1 5: exit 5

19 Transition Relation Control flow graph: i op j Operational semantics: i, ε j, op ε Semantics of op

20 Methodology Concrete Semantics Tuners Collecting Semantics Abstract Domain Abstract Domain Partitioning Abstract Semantics Iterative Resolution Algorithms

21 Collecting Semantics The collecting semantics is the set of observable behaviours in the operational semantics. It is the starting point of any analysis design. The set of all descendants of the initial state The set of all descendants of the initial state that can reach a final state The set of all finite traces from the initial state The set of all finite and infinite traces from the initial state etc.

22 Which Collecting Semantics? Buffer overrun, division by zero, arithmetic overflows: state properties Deadlocks, un-initialized variables: finite trace properties Loop termination: finite and infinite trace properties

23 State properties The set of descendants of the initial state s 0 : S = {s s 0 s} Theorem: F : ( ( ), ) ( ( ), ) F (S) = {s 0 } s' s S: s s' S = lfp F

24 Example 1: n = 0; 2: while n < 1000 do 3: n = n + 1; 4: end 5: exit S = { 1, n n 0 n 0 n 1 n 1 n 1000 }

25 Computation F0 = F1 = { 1,n Ω } F2 = { 1,n Ω, 2,n 0 } F3 = { 1,n Ω, 2,n 0, 3,n 0 } F4 = { 1,n Ω, 2,n 0, 3,n 0, 4,n 1 }...

26 Methodology Concrete Semantics Tuners Collecting Semantics Abstract Domain Abstract Domain Partitioning Abstract Semantics Iterative Resolution Algorithms

27 Partitioning We partition the set S of states w.r.t. program points: Σ = Σ 1 Σ 2... Σ n Σ i = { k, ε Σ k = i } F(S 1,..., S n ) 0 = { s 0 } F(S 1,..., S n ) i = {s' S i j s S j : s s'} i.e. F(S 1,..., S n ) i = { i, op ε j op i CFG (P)}

28 Illustration Σ Σ S 1 Σ 1 1, e 1 1, e 2 i, op ε 1 i, op ε 2 S i S j Σ j j, ε 1 j, ε 2 F Σ i

29 Semantic Equations Notation: E i = set of environments at program point i System of semantic equations: op E i = U { op E j j i CFG (P) } Solution of the system S = lfp F

30 Example 1: n = 0; 2: while n < 1000 do 3: n = n + 1; 4: end 5: exit E 1 = {n } E 2 = n = 0 E 1 E 4 E 3 = E 2 ]-, 999] E 4 = n = n + 1 E 3 E 5 = E 2 [1000, [

31 Example E 1 = {n } 1: n = 0; E 2 2: = while n = 0 n < E E 4 do 3: n = n + 1; 4: end E5: 3 = Eexit 2 ]-, 999] 1 n = 0 2 n 1000 n < n = n + 1 E 4 = n = n + 1 E 3 4 E 5 = E 2 [1000, [ 5

32 Methodology Concrete Semantics Tuners Collecting Semantics Abstract Domain Abstract Domain Partitioning Abstract Semantics Iterative Resolution Algorithms

33 Approximation Problem: Compute a sound approximation S # of S S S # Solution: Galois connections

34 Galois Connection L 1, L 2 two lattices Abstract domain (L 1, ) (L 2, ) x y : (x) y x (y) x y : x (x) & o (y) y

35 Fixpoint Approximation Abstract computation o F o L 2 L 2 Concrete computation Theorem: L 1 F lfp F (lfp o F o ) L 1

36 Abstracting the Collecting Semantics Find a Galois connection: ( ( ), ) (, ) Find a function: o F o F #

37 Abstract Algebra Notation: E the set of all environments Galois connection: ( (E), ) (E #, ), approximated by, Semantics op approximated by op # o op o op #

38 Abstract Semantic Equations 1: n = 0; 2: while n < 1000 do 3: n = n + 1; 4: end; 5: exit; E 1# = {n }) E 2# = n = 0 # E 1 # E 4 # E 3# = E 2 # ]-, 999]) E 4# = n = n + 1 # E 3 # E 5# = E 2 # [1000, [)

39 Methodology Concrete Semantics Tuners Collecting Semantics Abstract Domain Abstract Domain Partitioning Abstract Semantics Iterative Resolution Algorithms

40 Abstract Domains Various kinds of approximations: Signs (non relational) x +, y -,... Intervals (nonrelational): x [3, 9], y [-23, 4],... Polyhedra (relational): x + y - 2z 10,... Difference-bound matrices (weakly relational): y - x z - y

41 Example: intervals 1: n = 0; 2: while n < 1000 do 3: n = n + 1; 4: end 5: exit Iteration 1: E 2# = [0, 0] Iteration 2: E 2# = [0, 1] Iteration 3: E 2# = [0, 2] Iteration 4: E 2# = [0, 3]...

42 Problem How to cope with lattices of infinite height? Solution: automatic extrapolation operators

43 Methodology Concrete Semantics Tuners Collecting Semantics Abstract Domain Abstract Domain Partitioning Abstract Semantics Iterative Resolution Algorithms

44 Widening operator Lattice (L, ): L L L Abstract union operator: x y : x x y & y x y Enforces convergence: (x n ) n 0 y 0 = x 0 y n + 1 = y n x n+1 (y n ) n 0 is ultimately stationary

45 Widening of intervals [a, b] [a', b'] If a a' then a else - If b' b then b else + Open unstable bounds (jump over the fixpoint)

46 Widening and Fixpoint fixpoint widening

47 Iteration with widening 1: n = 0; 2: while n < 1000 do 3: n = n + 1; 4: end 5: exit (E 2# ) n+1 = (E 2# ) n ( n = 0 # (E 1# ) n (E 4# ) n ) Iteration 1 (union): E 2# = [0, 0] Iteration 2 (union): E 2# = [0, 1] Iteration 3 (widening): E 2# = [0, + ] stable

48 Imprecision at loop exit 1: n = 0; 2: while n < 1000 do 3: n = n + 1; 4: end 5: exit; t[n] = 0; // t has 1500 elements E 5# = [1000, [ False positive!!!

49 Narrowing operator Lattice (L, ): L L L Abstract intersection operator: x y : x y x y Enforces convergence: (x n ) n 0 y 0 = x 0 y n + 1 = y n x n+1 (y n ) n 0 is ultimately stationary

50 Narrowing of intervals [a, b] [a', b'] If a = - then a' else a If b = + then b' else b Refines open bounds

51 Narrowing and Fixpoint fixpoint narrowing widening

52 Iteration with narrowing 1: n = 0; 2: while n < 1000 do 3: n = n + 1; 4: end 5: t[n] = 0; (E 2# ) n+1 = (E 2# ) n ( n = 0 # (E 1# ) n (E 4# ) n ) Beginning of iteration: E 2# = [0, [ Iteration 1: E 2# = [0, 1000] stable Consequence: E 5# = [1000, 1000]

53 Methodology Concrete Semantics Tuners Collecting Semantics Abstract Domain Abstract Domain Partitioning Abstract Semantics Iterative Resolution Algorithms

54 Tuning the abstract domains 1: n = 0; 2: k = 0; 3: while n < 1000 do 4: n = n + 1; 5: k = k + 1; 6: end 7: exit Intervals: E 4# = n k [ Convex polyhedra: E 4# = n k n - k = 0

55 Annotated Bibliography

56 References The historic paper: Patrick Cousot & Radhia Cousot. Abstract interpretation: a unified lattice model for static analysis of programs by construction or approximation of fixpoints. In Conference Record of the Fourth Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pages , Los Angeles, California, ACM Press, New York, NY, USA. Accessible introductions to the theory: Patrick Cousot. Semantic foundations of program analysis. In S.S. Muchnick and N.D. Jones, editors, Program Flow Analysis: Theory and Applications, Ch. 10, pages , Prentice-Hall, Inc., Englewood Cliffs, New Jersey, U.S.A., Patrick Cousot & Radhia Cousot. Abstract interpretation and application to logic programs. Journal of Logic Programming, 13(2 3): , Beyond Galois connections, a presentation of relaxed frameworks: Patrick Cousot & Radhia Cousot. Abstract interpretation frameworks. Journal of Logic and Computation, 2(4): , August A thorough description of a static analyzer with all the proofs (difficult to read): Patrick Cousot. The Calculational Design of a Generic Abstract Interpreter. Course notes for the NATO International Summer School 1998 on Calculational System Design. Marktoberdorf, Germany, 28 July 9 august 1998, organized by F.L. Bauer, M. Broy, E.W. Dijkstra, D. Gries and C.A.R. Hoare.

57 References The abstract domain of intervals: Patrick Cousot & Radhia Cousot. Static Determination of Dynamic Properties of Programs. In B. Robinet, editor, Proceedings of the second international symposium on Programming, Paris, France, pages , april , Dunod, Paris. The abstract domain of convex polyhedra: Patrick Cousot & Nicolas Halbwachs. Automatic discovery of linear restraints among variables of a program. In Conference R ecord of the Fifth Annual ACM SIGPLAN- SIGACT Symposium on Principles of Program ming Languages, pages 84 97, Tucson, Arizona, ACM Press, New York, NY, USA. Weakly relational abstract domains: Antoine Miné. The Octagon Abstract Domain. In Analysis, Slicing and Transformation (part of Working Conference on Reverse Engineering), October 2001, IEEE, pages Antoine Miné. A New Numerical Abstract Domain Based on Difference-Bound Matrices. In Program As Data Objects II, May 2001, LNCS 2053, pages Classical data flow analysis: Steven Muchnick. Advanced Compiler Design and Implementation. Morgan Kaufmann, 1997.

Discrete Fixpoint Approximation Methods in Program Static Analysis

Discrete Fixpoint Approximation Methods in Program Static Analysis Discrete Fixpoint Approximation Methods in Program Static Analysis P. Cousot Département de Mathématiques et Informatique École Normale Supérieure Paris

More information

BASIC CONCEPTS OF ABSTRACT INTERPRETATION

BASIC CONCEPTS OF ABSTRACT INTERPRETATION BASIC CONCEPTS OF ABSTRACT INTERPRETATION Patrick Cousot École Normale Supérieure 45 rue d Ulm 75230 Paris cedex 05, France Patrick.Cousot@ens.fr Radhia Cousot CNRS & École Polytechnique 91128 Palaiseau

More information

«ATutorialon Abstract Interpretation»

«ATutorialon Abstract Interpretation» «ATutorialon Abstract Interpretation» Patrick Cousot École normale supérieure 45 rue d Ulm 75230 Paris cedex 05, France Patrick.Cousot@ens.fr www.di.ens.fr/~cousot VMCAI 05 Industrial Day VMCAI 05 Industrial

More information

Notes on Abstract Interpretation

Notes on Abstract Interpretation Notes on Abstract Interpretation Alexandru Sălcianu salcianu@mit.edu November 2001 1 Introduction This paper summarizes our view of the abstract interpretation field. It is based on the original abstract

More information

Verification of Real-Time Systems Numerical Abstractions

Verification of Real-Time Systems Numerical Abstractions Verification of Real-Time Systems Numerical Abstractions Jan Reineke Advanced Lecture, Summer 2015 Recap: From Local to Global Correctness: Kleene Iteration Abstract Domain F # F #... F # γ a γ a γ a Concrete

More information

An Abstract Domain to Infer Ordinal-Valued Ranking Functions

An Abstract Domain to Infer Ordinal-Valued Ranking Functions An Abstract Domain to Infer Ordinal-Valued Ranking Functions Caterina Urban and Antoine Miné ÉNS & CNRS & INRIA, Paris, France urban@di.ens.fr, mine@di.ens.fr Abstract. The traditional method for proving

More information

«Basic Concepts of Abstract Interpretation»

«Basic Concepts of Abstract Interpretation» «Basic Concepts of Abstract Interpretation» Patrick Cousot École normale supérieure 45 rue d Ulm 75230 Paris cedex 05, France Patrick.Cousot@ens.fr www.di.ens.fr/~cousot IFIP WCC Topical day on Abstract

More information

Introduction to Abstract Interpretation. ECE 584 Sayan Mitra Lecture 18

Introduction to Abstract Interpretation. ECE 584 Sayan Mitra Lecture 18 Introduction to Abstract Interpretation ECE 584 Sayan Mitra Lecture 18 References Patrick Cousot,RadhiaCousot:Abstract Interpretation: A Unified Lattice Model for Static Analysis of Programs by Construction

More information

The Trace Partitioning Abstract Domain

The Trace Partitioning Abstract Domain The Trace Partitioning Abstract Domain XAVIER RIVAL and LAURENT MAUBORGNE École Normale Supérieure In order to achieve better precision of abstract interpretation based static analysis, we introduce a

More information

Partial model checking via abstract interpretation

Partial model checking via abstract interpretation Partial model checking via abstract interpretation N. De Francesco, G. Lettieri, L. Martini, G. Vaglini Università di Pisa, Dipartimento di Ingegneria dell Informazione, sez. Informatica, Via Diotisalvi

More information

A New Numerical Abstract Domain Based on Difference-Bound Matrices

A New Numerical Abstract Domain Based on Difference-Bound Matrices A New Numerical Abstract Domain Based on Difference-Bound Matrices Antoine Miné École Normale Supérieure de Paris, France, mine@di.ens.fr, http://www.di.ens.fr/~mine Abstract. This paper presents a new

More information

Abstract Interpretation II

Abstract Interpretation II Abstract Interpretation II Semantics and Application to Program Verification Antoine Miné École normale supérieure, Paris year 2015 2016 Course 11 13 May 2016 Course 11 Abstract Interpretation II Antoine

More information

A Certified Denotational Abstract Interpreter (Proof Pearl)

A Certified Denotational Abstract Interpreter (Proof Pearl) A Certified Denotational Abstract Interpreter (Proof Pearl) David Pichardie INRIA Rennes David Cachera IRISA / ENS Cachan (Bretagne) Static Analysis Static Analysis Static analysis by abstract interpretation

More information

Space-aware data flow analysis

Space-aware data flow analysis Space-aware data flow analysis C. Bernardeschi, G. Lettieri, L. Martini, P. Masci Dip. di Ingegneria dell Informazione, Università di Pisa, Via Diotisalvi 2, 56126 Pisa, Italy {cinzia,g.lettieri,luca.martini,paolo.masci}@iet.unipi.it

More information

Higher-Order Chaotic Iteration Sequences

Higher-Order Chaotic Iteration Sequences Higher-Order Chaotic Iteration Sequences Mads Rosendahl DIKU, University of Copenhagen Universitetsparken 1, DK-2100 Copenhagen Ø, Denmark E-mail rose@diku.dk 1993 Abstract Chaotic iteration sequences

More information

Abstract Interpretation: Fixpoints, widening, and narrowing

Abstract Interpretation: Fixpoints, widening, and narrowing Abstract Interpretation: Fixpoints, widening, and narrowing CS252r Fall 2015 Slides from Principles of Program Analysis by Nielson, Nielson, and Hankin http://www2.imm.dtu.dk/~riis/ppa/ppasup2004.html

More information

The Abstract Domain of Segmented Ranking Functions

The Abstract Domain of Segmented Ranking Functions The Abstract Domain of Segmented Ranking Functions Caterina Urban To cite this version: Caterina Urban. The Abstract Domain of Segmented Ranking Functions. Logozzo, Francesco and Fähndrich, Manuel. Static

More information

Compilation and Program Analysis (#8) : Abstract Interpretation

Compilation and Program Analysis (#8) : Abstract Interpretation Compilation and Program Analysis (#8) : Abstract Interpretation Laure Gonnord http://laure.gonnord.org/pro/teaching/capm.html Laure.Gonnord@ens-lyon.fr Master, ENS de Lyon Nov 7 Objective Compilation vs

More information

Abstraction in Program Analysis & Model Checking. Abstraction in Model Checking. Motivations & Results

Abstraction in Program Analysis & Model Checking. Abstraction in Model Checking. Motivations & Results On Completeness in Abstract Model Checking from the Viewpoint of Abstract Interpretation Abstraction in Program Analysis & Model Checking Abstract interpretation has been successfully applied in: static

More information

Logical Abstract Domains and Interpretations

Logical Abstract Domains and Interpretations Logical Abstract Domains and Interpretations Patrick Cousot 2,3, Radhia Cousot 3,1, and Laurent Mauborgne 3,4 1 Centre National de la Recherche Scientifique, Paris 2 Courant Institute of Mathematical Sciences,

More information

Classical Program Logics: Hoare Logic, Weakest Liberal Preconditions

Classical Program Logics: Hoare Logic, Weakest Liberal Preconditions Chapter 1 Classical Program Logics: Hoare Logic, Weakest Liberal Preconditions 1.1 The IMP Language IMP is a programming language with an extensible syntax that was developed in the late 1960s. We will

More information

CMSC 631 Program Analysis and Understanding Fall Abstract Interpretation

CMSC 631 Program Analysis and Understanding Fall Abstract Interpretation Program Analysis and Understanding Fall 2017 Abstract Interpretation Based on lectures by David Schmidt, Alex Aiken, Tom Ball, and Cousot & Cousot What is an Abstraction? A property from some domain Blue

More information

Formal Methods in Software Engineering

Formal Methods in Software Engineering Formal Methods in Software Engineering An Introduction to Model-Based Analyis and Testing Vesal Vojdani Department of Computer Science University of Tartu Fall 2014 Vesal Vojdani (University of Tartu)

More information

Reasoning About Imperative Programs. COS 441 Slides 10b

Reasoning About Imperative Programs. COS 441 Slides 10b Reasoning About Imperative Programs COS 441 Slides 10b Last time Hoare Logic: { P } C { Q } Agenda If P is true in the initial state s. And C in state s evaluates to s. Then Q must be true in s. Program

More information

Mechanics of Static Analysis

Mechanics of Static Analysis Escuela 03 III / 1 Mechanics of Static Analysis David Schmidt Kansas State University www.cis.ksu.edu/~schmidt Escuela 03 III / 2 Outline 1. Small-step semantics: trace generation 2. State generation and

More information

The Octagon Abstract Domain

The Octagon Abstract Domain 1 The Octagon Abstract Domain Antoine Miné École Normale Supérieure de Paris, France, mine@di.ens.fr, http://www.di.ens.fr/~mine arxiv:cs/0703084v2 cs.pl] 16 Mar 2007 Abstract This article presents a new

More information

«Specification and Abstraction of Semantics» 1. Souvenir, Souvenir. Neil D. Jones. Contents. A Tribute Workshop and Festival to Honor Neil D.

«Specification and Abstraction of Semantics» 1. Souvenir, Souvenir. Neil D. Jones. Contents. A Tribute Workshop and Festival to Honor Neil D. «Specification and Abstraction of Semantics» Patrick Cousot Radhia Cousot École normale supérieure CNRS & École polytechnique 45 rue d Ulm Route de Saclay 7530 Paris cedex 05, France 9118 Palaiseau Cedex,

More information

Abstract Interpretation: Fixpoints, widening, and narrowing

Abstract Interpretation: Fixpoints, widening, and narrowing Abstract Interpretation: Fixpoints, widening, and narrowing CS252r Spring 2011 Slides from Principles of Program Analysis by Nielson, Nielson, and Hankin http://www2.imm.dtu.dk/~riis/ppa/ppasup2004.html

More information

Automatic Generation of Polynomial Invariants for System Verification

Automatic Generation of Polynomial Invariants for System Verification Automatic Generation of Polynomial Invariants for System Verification Enric Rodríguez-Carbonell Technical University of Catalonia Talk at EPFL Nov. 2006 p.1/60 Plan of the Talk Introduction Need for program

More information

Introduction to Abstract Interpretation

Introduction to Abstract Interpretation Introduction to Abstract Interpretation Bruno Blanchet Département d Informatique École Normale Supérieure, Paris and Max-Planck-Institut für Informatik Bruno.Blanchet@ens.fr November 29, 2002 Abstract

More information

Geometric Quantifier Elimination Heuristics for Automatically Generating Octagonal and Max-plus Invariants

Geometric Quantifier Elimination Heuristics for Automatically Generating Octagonal and Max-plus Invariants Geometric Quantifier Elimination Heuristics for Automatically Generating Octagonal and Max-plus Invariants Deepak Kapur 1 Zhihai Zhang 2 Matthias Horbach 1 Hengjun Zhao 3 Qi Lu 1 and ThanhVu Nguyen 1 1

More information

Software Verification

Software Verification Software Verification Grégoire Sutre LaBRI, University of Bordeaux, CNRS, France Summer School on Verification Technology, Systems & Applications September 2008 Grégoire Sutre Software Verification VTSA

More information

Program verification

Program verification Program verification Data-flow analyses, numerical domains Laure Gonnord and David Monniaux University of Lyon / LIP September 29, 2015 1 / 75 Context Program Verification / Code generation: Variables

More information

Groupe de travail. Analysis of Mobile Systems by Abstract Interpretation

Groupe de travail. Analysis of Mobile Systems by Abstract Interpretation Groupe de travail Analysis of Mobile Systems by Abstract Interpretation Jérôme Feret École Normale Supérieure http://www.di.ens.fr/ feret 31/03/2005 Introduction I We propose a unifying framework to design

More information

Program verification. 18 October 2017

Program verification. 18 October 2017 Program verification 18 October 2017 Example revisited // assume(n>2); void partition(int a[], int n) { int pivot = a[0]; int lo = 1, hi = n-1; while (lo

More information

Generation of. Polynomial Equality Invariants. by Abstract Interpretation

Generation of. Polynomial Equality Invariants. by Abstract Interpretation Generation of Polynomial Equality Invariants by Abstract Interpretation Enric Rodríguez-Carbonell Universitat Politècnica de Catalunya (UPC) Barcelona Joint work with Deepak Kapur (UNM) 1 Introduction

More information

Disjunctive relational abstract interpretation for interprocedural program analysis

Disjunctive relational abstract interpretation for interprocedural program analysis Disjunctive relational abstract interpretation for interprocedural program analysis Nicolas Halbwachs, joint work with Rémy Boutonnet Verimag/CNRS, and Grenoble-Alpes University Grenoble, France R. Boutonnet,

More information

Fuzzy Limits of Functions

Fuzzy Limits of Functions Fuzzy Limits of Functions Mark Burgin Department of Mathematics University of California, Los Angeles 405 Hilgard Ave. Los Angeles, CA 90095 Abstract The goal of this work is to introduce and study fuzzy

More information

Flow grammars a flow analysis methodology

Flow grammars a flow analysis methodology Flow grammars a flow analysis methodology James S. Uhl and R. Nigel Horspool Dept. of Computer Science, University of Victoria P.O. Box 3055, Victoria, BC, Canada V8W 3P6 E-mail: juhl@csr.uvic.ca, nigelh@csr.uvic.ca

More information

Basic Concepts of Abstract Interpretation

Basic Concepts of Abstract Interpretation Programming Research Laboratory Seoul National University Basic Concepts of Abstract Interpretation Soonho Kong http://ropas.snu.ac.kr/ soon/ May 25, 2007 Work of P. Cousot and R.Cousot Basic Concepts

More information

Cours M.2-6 «Interprétation abstraite: applications à la vérification et à l analyse statique» Examen partiel. Patrick Cousot.

Cours M.2-6 «Interprétation abstraite: applications à la vérification et à l analyse statique» Examen partiel. Patrick Cousot. Master Parisien de Recherche en Informatique École normale supérieure Année scolaire 2010/2011 Cours M.2-6 «Interprétation abstraite: applications à la vérification et à l analyse statique» Examen partiel

More information

Two examples of numerical domains

Two examples of numerical domains ROSAEC workshop Fourth session Two examples of numerical domains Jérôme Feret Laboratoire d Informatique de l École Normale Supérieure INRIA, ÉNS, CNRS January, 2009 ROSAEC workshop The Arithmetic-Geometric

More information

Denotational semantics

Denotational semantics Denotational semantics Semantics and Application to Program Verification Antoine Miné École normale supérieure, Paris year 2015 2016 Course 4 4 March 2016 Course 4 Denotational semantics Antoine Miné p.

More information

Deductive Verification

Deductive Verification Deductive Verification Mooly Sagiv Slides from Zvonimir Rakamaric First-Order Logic A formal notation for mathematics, with expressions involving Propositional symbols Predicates Functions and constant

More information

Static Analysis in Disjunctive Numerical Domains.

Static Analysis in Disjunctive Numerical Domains. Static Analysis in Disjunctive Numerical Domains. Sriram Sankaranarayanan, Franjo Ivančić, Ilya Shlyakhter, Aarti Gupta NEC Laboratories America, 4 Independence Way, Princeton, NJ Abstract. The convexity

More information

Hoare Logic I. Introduction to Deductive Program Verification. Simple Imperative Programming Language. Hoare Logic. Meaning of Hoare Triples

Hoare Logic I. Introduction to Deductive Program Verification. Simple Imperative Programming Language. Hoare Logic. Meaning of Hoare Triples Hoare Logic I Introduction to Deductive Program Verification Işıl Dillig Program Spec Deductive verifier FOL formula Theorem prover valid contingent Example specs: safety (no crashes), absence of arithmetic

More information

Relative Completeness of Abstraction Refinement for Software Model Checking

Relative Completeness of Abstraction Refinement for Software Model Checking Relative Completeness of Abstraction Refinement for Software Model Checking Thomas Ball 1, Andreas Podelski 2, and Sriram K. Rajamani 1 1 Microsoft Research 2 Max-Planck-Institut für Informatik Abstract.

More information

Abstract Interpretation and Static Analysis

Abstract Interpretation and Static Analysis / 1 Abstract Interpretation and Static Analysis David Schmidt Kansas State University www.cis.ksu.edu/~schmidt Welcome! / 2 / 3 Four parts 1. Introduction to static analysis what it is and how to apply

More information

A Semantic Basis for Specialising Domain Constraints

A Semantic Basis for Specialising Domain Constraints A Semantic Basis for Specialising Domain Constraints Jacob M. Howe 1 and Andy King 2 Computing Laboratory, University of Kent, Canterbury, CT2 7NF, UK Abstract This paper formalises an analysis of finite

More information

Axiomatic Semantics. Stansifer Ch 2.4, Ch. 9 Winskel Ch.6 Slonneger and Kurtz Ch. 11 CSE

Axiomatic Semantics. Stansifer Ch 2.4, Ch. 9 Winskel Ch.6 Slonneger and Kurtz Ch. 11 CSE Axiomatic Semantics Stansifer Ch 2.4, Ch. 9 Winskel Ch.6 Slonneger and Kurtz Ch. 11 CSE 6341 1 Outline Introduction What are axiomatic semantics? First-order logic & assertions about states Results (triples)

More information

Gerwin Klein, June Andronick, Ramana Kumar S2/2016

Gerwin Klein, June Andronick, Ramana Kumar S2/2016 COMP4161: Advanced Topics in Software Verification {} Gerwin Klein, June Andronick, Ramana Kumar S2/2016 data61.csiro.au Content Intro & motivation, getting started [1] Foundations & Principles Lambda

More information

Automatic determination of numerical properties of software and systems

Automatic determination of numerical properties of software and systems Automatic determination of numerical properties of software and systems Eric Goubault and Sylvie Putot Modelling and Analysis of Interacting Systems, CEA LIST MASCOT-NUM 2012 Meeting, March 21-23, 2012

More information

Spring 2015 Program Analysis and Verification. Lecture 4: Axiomatic Semantics I. Roman Manevich Ben-Gurion University

Spring 2015 Program Analysis and Verification. Lecture 4: Axiomatic Semantics I. Roman Manevich Ben-Gurion University Spring 2015 Program Analysis and Verification Lecture 4: Axiomatic Semantics I Roman Manevich Ben-Gurion University Agenda Basic concepts of correctness Axiomatic semantics (pages 175-183) Hoare Logic

More information

Abstract Interpretation of Combinational Asynchronous Circuits

Abstract Interpretation of Combinational Asynchronous Circuits Abstract Interpretation of Combinational Asynchronous Circuits Sarah Thompson and Alan Mycroft Computer Laboratory, University of Cambridge William Gates Building, JJ Thompson Avenue, Cambridge, CB3 0FD,

More information

Polynomial Precise Interval Analysis Revisited

Polynomial Precise Interval Analysis Revisited Polynomial Precise Interval Analysis Revisited Thomas Gawlitza 1, Jérôme Leroux 2, Jan Reineke 3, Helmut Seidl 1, Grégoire Sutre 2, and Reinhard Wilhelm 3 1 TU München, Institut für Informatik, I2 80333

More information

Model Checking & Program Analysis

Model Checking & Program Analysis Model Checking & Program Analysis Markus Müller-Olm Dortmund University Overview Introduction Model Checking Flow Analysis Some Links between MC and FA Conclusion Apology for not giving proper credit to

More information

Interprocedurally Analyzing Polynomial Identities

Interprocedurally Analyzing Polynomial Identities Interprocedurally Analyzing Polynomial Identities Markus Müller-Olm 1, Michael Petter 2, and Helmut Seidl 2 1 Westfälische Wilhelms-Universität Münster, Institut für Informatik Einsteinstr. 62, 48149 Münster,

More information

CSC 7101: Programming Language Structures 1. Axiomatic Semantics. Stansifer Ch 2.4, Ch. 9 Winskel Ch.6 Slonneger and Kurtz Ch. 11.

CSC 7101: Programming Language Structures 1. Axiomatic Semantics. Stansifer Ch 2.4, Ch. 9 Winskel Ch.6 Slonneger and Kurtz Ch. 11. Axiomatic Semantics Stansifer Ch 2.4, Ch. 9 Winskel Ch.6 Slonneger and Kurtz Ch. 11 1 Overview We ll develop proof rules, such as: { I b } S { I } { I } while b do S end { I b } That allow us to verify

More information

Compositionality in SLD-derivations and their abstractions Marco Comini, Giorgio Levi and Maria Chiara Meo Dipartimento di Informatica, Universita di

Compositionality in SLD-derivations and their abstractions Marco Comini, Giorgio Levi and Maria Chiara Meo Dipartimento di Informatica, Universita di Compositionality in SLD-derivations and their abstractions Marco Comini Giorgio Levi and Maria Chiara Meo Dipartimento di Informatica Universita di Pisa Corso Italia 40 56125 Pisa Italy fcomini levi meog@di.unipi.it

More information

An Abstract Domain to Discover Interval Linear Equalities

An Abstract Domain to Discover Interval Linear Equalities An Abstract Domain to Discover Interval Linear Equalities Liqian Chen 1,2, Antoine Miné 1,3, Ji Wang 2, and Patrick Cousot 1,4 1 École Normale Supérieure, Paris, France {chen,mine,cousot}@di.ens.fr 2 National

More information

Algebraic Reasoning for Probabilistic Action Systems and While-Loops

Algebraic Reasoning for Probabilistic Action Systems and While-Loops Algebraic Reasoning for Probabilistic Action Systems and While-Loops Larissa Meinicke Ian J. Hayes September 006 Technical Report SSE-006-05 Division of Systems and Software Engineering Research School

More information

Abstract Interpretation from a Topological Perspective

Abstract Interpretation from a Topological Perspective (-: / 1 Abstract Interpretation from a Topological Perspective David Schmidt Kansas State University www.cis.ksu.edu/ schmidt Motivation and overview of results (-: / 2 (-: / 3 Topology studies convergent

More information

Foundations of Abstract Interpretation

Foundations of Abstract Interpretation Escuela 03 II / 1 Foundations of Abstract Interpretation David Schmidt Kansas State University www.cis.ksu.edu/~schmidt Escuela 03 II / 2 Outline 1. Lattices and continuous functions 2. Galois connections,

More information

Smoothing a Program Soundly and Robustly

Smoothing a Program Soundly and Robustly Smoothing a Program Soundly and Robustly Swarat Chaudhuri 1 and Armando Solar-Lezama 2 1 Rice University 2 MIT Abstract. We study the foundations of smooth interpretation, a recentlyproposed program approximation

More information

Introduction to Program Analysis and Abstract Interpretation (Part I)

Introduction to Program Analysis and Abstract Interpretation (Part I) Introduction to Program Analysis and Abstract Interpretation (Part I) Axel Simon Olaf Chitil Lawrence Beadle Materials: http://www.cs.kent.ac.uk/research/ groups/tcs/pgradtrain/abstract.html Acknowledgments:

More information

Axiomatic semantics. Semantics and Application to Program Verification. Antoine Miné. École normale supérieure, Paris year

Axiomatic semantics. Semantics and Application to Program Verification. Antoine Miné. École normale supérieure, Paris year Axiomatic semantics Semantics and Application to Program Verification Antoine Miné École normale supérieure, Paris year 2015 2016 Course 6 18 March 2016 Course 6 Axiomatic semantics Antoine Miné p. 1 /

More information

Linearity Analysis for Automatic Differentiation

Linearity Analysis for Automatic Differentiation Linearity Analysis for Automatic Differentiation Michelle Mills Strout 1 and Paul Hovland 2 1 Colorado State University, Fort Collins, CO 80523 2 Argonne National Laboratory, Argonne, IL 60439 Abstract.

More information

Least Common Subsumers and Most Specific Concepts in a Description Logic with Existential Restrictions and Terminological Cycles*

Least Common Subsumers and Most Specific Concepts in a Description Logic with Existential Restrictions and Terminological Cycles* Least Common Subsumers and Most Specific Concepts in a Description Logic with Existential Restrictions and Terminological Cycles* Franz Baader Theoretical Computer Science TU Dresden D-01062 Dresden, Germany

More information

Lecture Notes: Program Analysis Correctness

Lecture Notes: Program Analysis Correctness Lecture Notes: Program Analysis Correctness 15-819O: Program Analysis Jonathan Aldrich jonathan.aldrich@cs.cmu.edu Lecture 5 1 Termination As we think about the correctness of program analysis, let us

More information

Precise Relational Invariants Through Strategy Iteration

Precise Relational Invariants Through Strategy Iteration Precise Relational Invariants Through Strategy Iteration Thomas Gawlitza and Helmut Seidl TU München, Institut für Informatik, I2 85748 München, Germany {gawlitza, seidl}@in.tum.de Abstract. We present

More information

Program verification using Hoare Logic¹

Program verification using Hoare Logic¹ Program verification using Hoare Logic¹ Automated Reasoning - Guest Lecture Petros Papapanagiotou Part 2 of 2 ¹Contains material from Mike Gordon s slides: Previously on Hoare Logic A simple while language

More information

Transformation of a PID Controller for Numerical Accuracy

Transformation of a PID Controller for Numerical Accuracy Replace this file with prentcsmacro.sty for your meeting, or with entcsmacro.sty for your meeting. Both can be found at the ENTCS Macro Home Page. Transformation of a PID Controller for Numerical Accuracy

More information

Spring 2016 Program Analysis and Verification. Lecture 3: Axiomatic Semantics I. Roman Manevich Ben-Gurion University

Spring 2016 Program Analysis and Verification. Lecture 3: Axiomatic Semantics I. Roman Manevich Ben-Gurion University Spring 2016 Program Analysis and Verification Lecture 3: Axiomatic Semantics I Roman Manevich Ben-Gurion University Warm-up exercises 1. Define program state: 2. Define structural semantics configurations:

More information

Towards a quantum calculus

Towards a quantum calculus QPL 2006 Preliminary Version Towards a quantum calculus (work in progress, extended abstract) Philippe Jorrand 1 Simon Perdrix 2 Leibniz Laboratory IMAG-INPG Grenoble, France Abstract The aim of this paper

More information

Hoare Logic: Reasoning About Imperative Programs

Hoare Logic: Reasoning About Imperative Programs Hoare Logic: Reasoning About Imperative Programs COMP1600 / COMP6260 Dirk Pattinson Australian National University Semester 2, 2017 Catch Up / Drop in Lab When Fridays, 15.00-17.00 Where N335, CSIT Building

More information

Dynamic Semantics. Dynamic Semantics. Operational Semantics Axiomatic Semantics Denotational Semantic. Operational Semantics

Dynamic Semantics. Dynamic Semantics. Operational Semantics Axiomatic Semantics Denotational Semantic. Operational Semantics Dynamic Semantics Operational Semantics Denotational Semantic Dynamic Semantics Operational Semantics Operational Semantics Describe meaning by executing program on machine Machine can be actual or simulated

More information

Program Analysis Probably Counts

Program Analysis Probably Counts Probably Counts 1 c.hankin@imperial.ac.uk joint work with Alessandra Di Pierro 2 and Herbert Wiklicky 1 1 Department of Computing, 2 Dipartimento di Informatica, Università di Verona Computer Journal Lecture,

More information

Data-Flow Analysis. Compiler Design CSE 504. Preliminaries

Data-Flow Analysis. Compiler Design CSE 504. Preliminaries Data-Flow Analysis Compiler Design CSE 504 1 Preliminaries 2 Live Variables 3 Data Flow Equations 4 Other Analyses Last modifled: Thu May 02 2013 at 09:01:11 EDT Version: 1.3 15:28:44 2015/01/25 Compiled

More information

The Complexity of Transducer Synthesis from Multi-Sequential Specifications

The Complexity of Transducer Synthesis from Multi-Sequential Specifications The Complexity of Transducer Synthesis from Multi-Sequential Specifications Léo Exibard 12 Emmanuel Filiot 13 Ismaël Jecker 1 Tuesday, August 28 th, 2018 1 Université libre de Bruxelles 2 LIS Aix-Marseille

More information

An Abstract Interpretation Approach. for Automatic Generation of. Polynomial Invariants

An Abstract Interpretation Approach. for Automatic Generation of. Polynomial Invariants An Abstract Interpretation Approach for Automatic Generation of Polynomial Invariants Enric Rodríguez-Carbonell Universitat Politècnica de Catalunya Barcelona Deepak Kapur University of New Mexico Albuquerque

More information

Semantics and Verification of Software

Semantics and Verification of Software Semantics and Verification of Software Thomas Noll Software Modeling and Verification Group RWTH Aachen University http://moves.rwth-aachen.de/teaching/ss-15/sv-sw/ The Denotational Approach Denotational

More information

Precise Widening Operators for Convex Polyhedra

Precise Widening Operators for Convex Polyhedra Precise Widening Operators for Convex Polyhedra Roberto Bagnara a, Patricia M. Hill b, Elisa Ricci a, Enea Zaffanella a a Department of Mathematics, University of Parma, Italy b School of Computing, University

More information

Program Analysis. Lecture 5. Rayna Dimitrova WS 2016/2017

Program Analysis. Lecture 5. Rayna Dimitrova WS 2016/2017 Program Analysis Lecture 5 Rayna Dimitrova WS 2016/2017 2/21 Recap: Constant propagation analysis Goal: For each program point, determine whether a variale has a constant value whenever an execution reaches

More information

Unifying Theories of Programming

Unifying Theories of Programming 1&2 Unifying Theories of Programming Unifying Theories of Programming 3&4 Theories Unifying Theories of Programming designs predicates relations reactive CSP processes Jim Woodcock University of York May

More information

Widening Operators for Powerset Domains

Widening Operators for Powerset Domains Widening Operators for Powerset Domains Roberto Bagnara 1, Patricia M. Hill 2, and Enea Zaffanella 1 1 Department of Mathematics, University of Parma, Italy {bagnara,zaffanella}@cs.unipr.it 2 School of

More information

Join Algorithms for the Theory of Uninterpreted Functions

Join Algorithms for the Theory of Uninterpreted Functions Join Algorithms for the Theory of Uninterpreted Functions Sumit Gulwani 1, Ashish Tiwari 2, and George C. Necula 1 1 University of California, Berkeley, CA 94720, {gulwani,necula}@cs.berkeley.edu 2 SRI

More information

Information Flow Analysis via Path Condition Refinement

Information Flow Analysis via Path Condition Refinement Information Flow Analysis via Path Condition Refinement Mana Taghdiri, Gregor Snelting, Carsten Sinz Karlsruhe Institute of Technology, Germany FAST September 16, 2010 KIT University of the State of Baden-Wuerttemberg

More information

A Constraint Solver based on Abstract Domains

A Constraint Solver based on Abstract Domains A Constraint Solver based on Abstract Domains Marie Pelleau, Antoine Miné, Charlotte Truchet, Frédéric Benhamou To cite this version: Marie Pelleau, Antoine Miné, Charlotte Truchet, Frédéric Benhamou.

More information

Semantics and Verification of Software

Semantics and Verification of Software Semantics and Verification of Software Thomas Noll Software Modeling and Verification Group RWTH Aachen University http://moves.rwth-aachen.de/teaching/ws-1718/sv-sw/ Recap: The Denotational Approach Semantics

More information

Hoare Logic and Model Checking

Hoare Logic and Model Checking Hoare Logic and Model Checking Kasper Svendsen University of Cambridge CST Part II 2016/17 Acknowledgement: slides heavily based on previous versions by Mike Gordon and Alan Mycroft Introduction In the

More information

Spring 2015 Program Analysis and Verification. Lecture 6: Axiomatic Semantics III. Roman Manevich Ben-Gurion University

Spring 2015 Program Analysis and Verification. Lecture 6: Axiomatic Semantics III. Roman Manevich Ben-Gurion University Spring 2015 Program Analysis and Verification Lecture 6: Axiomatic Semantics III Roman Manevich Ben-Gurion University Tentative syllabus Semantics Static Analysis Abstract Interpretation fundamentals Analysis

More information

Computing (the smallest) fixed points of monotone maps arising in static analysis by AI

Computing (the smallest) fixed points of monotone maps arising in static analysis by AI Computing (the smallest fixed points of monotone maps arising in static analysis by AI Joint work, over the last 4 years: Stéphane Gaubert 1, Assalé Adjé, Eric Goubault 3, Sylvie Putot, Alexandru Costan,

More information

Computing Loops with at Most One External Support Rule for Disjunctive Logic Programs

Computing Loops with at Most One External Support Rule for Disjunctive Logic Programs Computing Loops with at Most One External Support Rule for Disjunctive Logic Programs Xiaoping Chen 1, Jianmin Ji 1, and Fangzhen Lin 2 1 School of Computer Science and Technology, University of Science

More information

Model Checking, Theorem Proving, and Abstract Interpretation: The Convergence of Formal Verification Technologies

Model Checking, Theorem Proving, and Abstract Interpretation: The Convergence of Formal Verification Technologies Model Checking, Theorem Proving, and Abstract Interpretation: The Convergence of Formal Verification Technologies Tom Henzinger EPFL Three Verification Communities Model checking: -automatic, but inefficient

More information

Analysis of a Boost Converter Circuit Using Linear Hybrid Automata

Analysis of a Boost Converter Circuit Using Linear Hybrid Automata Analysis of a Boost Converter Circuit Using Linear Hybrid Automata Ulrich Kühne LSV ENS de Cachan, 94235 Cachan Cedex, France, kuehne@lsv.ens-cachan.fr 1 Introduction Boost converter circuits are an important

More information

Algorithmic verification

Algorithmic verification Algorithmic verification Ahmed Rezine IDA, Linköpings Universitet Hösttermin 2018 Outline Overview Model checking Symbolic execution Outline Overview Model checking Symbolic execution Program verification

More information

A Humble Introduction to DIJKSTRA S A A DISCIPLINE OF PROGRAMMING

A Humble Introduction to DIJKSTRA S A A DISCIPLINE OF PROGRAMMING A Humble Introduction to DIJKSTRA S A A DISCIPLINE OF PROGRAMMING Do-Hyung Kim School of Computer Science and Engineering Sungshin Women s s University CONTENTS Bibliographic Information and Organization

More information

On the Design of Adaptive Supervisors for Discrete Event Systems

On the Design of Adaptive Supervisors for Discrete Event Systems On the Design of Adaptive Supervisors for Discrete Event Systems Vigyan CHANDRA Department of Technology, Eastern Kentucky University Richmond, KY 40475, USA and Siddhartha BHATTACHARYYA Division of Computer

More information

A Few Graph-Based Relational Numerical Abstract Domains

A Few Graph-Based Relational Numerical Abstract Domains A Few Graph-Based Relational Numerical Abstract Domains Antoine Miné École Normale Supérieure de Paris, France, mine@di.ens.fr, http://www.di.ens.fr/~mine Abstract This article presents the systematic

More information

Static Program Analysis

Static Program Analysis Static Program Analysis Xiangyu Zhang The slides are compiled from Alex Aiken s Michael D. Ernst s Sorin Lerner s A Scary Outline Type-based analysis Data-flow analysis Abstract interpretation Theorem

More information