Presentation is loading. Please wait.

Presentation is loading. Please wait.

Automatic Complexity Analysis of Simple Imperative Programs Zachi Mann.

Similar presentations


Presentation on theme: "Automatic Complexity Analysis of Simple Imperative Programs Zachi Mann."— Presentation transcript:

1 Automatic Complexity Analysis of Simple Imperative Programs Zachi Mann

2 Consider the following “Core” Language: Non-deterministic branching Bounded non-deterministic loops Variables hold only positive integer values

3 Problem Statement The polynomial-bound analysis problem is to find, for any given command, which output variables are bounded by a polynomial in the input variables. A variant: The linear-bound problem identifies linearly-bounded output values instead. The problem can be easily extended to identify the overall runtime upper bound.

4 A Short Example

5 Ben-Amram, Jones & Kristiansen (2008) Sound & complete compositional analysis algorithm running in polynomial time. Algorithm assigns a certificate(DFR) to each command: DFR

6 Ben-Amram, Jones & Kristiansen (2008) DFR left part represents the variables dependencies. type: DFR

7 Ben-Amram, Jones & Kristiansen (2008) DFR right part is used to identify computations that double an input value by adding two copies of it: DFR

8 Ben-Amram (2010) Core language is extended with the constant zero. The analysis problem is shown to be PSPACE-complete.

9 Back to the Example

10 Ben-Amram (2010)

11

12 The link between inference rules and DFR: – The inference rules generate the variable dependences (arcs) within the DFR.

13 Implementation Bottom Up – For every command the set of all true judgments are generated. Top Down – An abstract interpreter generates for every command the dependence judgments according to the inference rules and the reset contexts that were computed so far from previous commands. Output Extension – Algorithm output is extended to include a description of a computation path which results with each computed variable dependence.

14 Loops

15 Performance Comparison

16 Related Work What happens if features are added/dropped from the core language? – Deterministic loops, the constant 1, weak assignment, … Is the analysis problem decidable? With what run time complexity? – Some answers in paper by Amir Ben Amram & Lars Kristiansen (2011)paper


Download ppt "Automatic Complexity Analysis of Simple Imperative Programs Zachi Mann."

Similar presentations


Ads by Google