Automatic Complexity Analysis of Simple Imperative Programs Zachi Mann.

Slides:



Advertisements
Similar presentations
The simple built-in data types of the C language such as int, float, - are not sufficient to represent complex data such as lists, tables, vectors, and.
Advertisements

Combinational Circuit Yan Gu 2 nd Presentation for CS 6260.
Rigorous Software Development CSCI-GA Instructor: Thomas Wies Spring 2012 Lecture 11.
Week 6 - Programming I So far, we’ve looked at simple programming via “scripts” = programs of sequentially evaluated commands Today, extend features to:
Chapter 12: Expert Systems Design Examples
UNIVERSITY OF SOUTH CAROLINA Department of Computer Science and Engineering CSCE 330 Programming Language Structures Ch.2: Syntax and Semantics Fall 2005.
Precise Inter-procedural Analysis Sumit Gulwani George C. Necula using Random Interpretation presented by Kian Win Ong UC Berkeley.
1 Operational Semantics Mooly Sagiv Tel Aviv University Textbook: Semantics with Applications.
White Box Testing and Symbolic Execution Written by Michael Beder.
Humans, Computers, and Computational Complexity J. Winters Brock Nathan Kaplan Jason Thompson.
Analysis of Algorithms1 Estimate the running time Estimate the memory space required. Time and space depend on the input size.
1 Other Models of Computation. 2 Models of computation: Turing Machines Recursive Functions Post Systems Rewriting Systems.
Lecture 6 & 7 System Models.
Fall 2004COMP 3351 Time Complexity We use a multitape Turing machine We count the number of steps until a string is accepted We use the O(k) notation.
Guide To UNIX Using Linux Third Edition
Computer Science: A Structured Programming Approach Using C1 Objectives ❏ To understand the structure of a C-language program. ❏ To write your first C.
Writing algorithms using the while-statement. Previously discussed Syntax of while-statement:
CS0007: Introduction to Computer Programming Introduction to Arrays.
Fundamentals of Python: From First Programs Through Data Structures
Definition: Let M be a deterministic Turing Machine that halts on all inputs. Space Complexity of M is the function f:N  N, where f(n) is the maximum.
Programming Languages
Fundamentals of Python: First Programs
1 COMP541 State Machines Montek Singh Feb 8, 2012.
1 R. Johnsonbaugh, Discrete Mathematics Chapter 4 Algorithms.
Lesson 1: Introduction to ABAP OBJECTS Todd A. Boyle, Ph.D. St. Francis Xavier University.
Algorithm Input Output An algorithm is a step-by-step procedure for solving a problem in a finite amount of time. Chapter 4. Algorithm Analysis (complexity)
DEPARTMENT OF COMPUTER SCIENCE & TECHNOLOGY FACULTY OF SCIENCE & TECHNOLOGY UNIVERSITY OF UWA WELLASSA 1 CST 221 OBJECT ORIENTED PROGRAMMING(OOP) ( 2 CREDITS.
By the end of this session you should be able to...
Analysis of algorithms Analysis of algorithms is the branch of computer science that studies the performance of algorithms, especially their run time.
Formal Semantics Chapter Twenty-ThreeModern Programming Languages, 2nd ed.1.
The class P Section 7.2 CSC 4170 Theory of Computation.
Algorithms & Flowchart
Strongly Formed Genetic Programming 06/19/2013. Agenda Strongly formed genetic programming (SFGP) Where it fits Current progress Next steps.
Introduction to Computer Programming
NP-Complete Problems. Running Time v.s. Input Size Concern with problems whose complexity may be described by exponential functions. Tractable problems.
COIT29222 Structured Programming 1 COIT29222-Structured Programming Lecture Week 02  Reading: Textbook(4 th Ed.), Chapter 2 Textbook (6 th Ed.), Chapters.
 In the java programming language, a keyword is one of 50 reserved words which have a predefined meaning in the language; because of this,
How Are Computers Programmed? CPS120: Introduction to Computer Science Lecture 5.
Costas Busch - LSU1 Time Complexity. Costas Busch - LSU2 Consider a deterministic Turing Machine which decides a language.
Calculator Program Explained by Arafa Hamed. First Designing The Interface Ask yourself how many places are there that will be used to input numbers?
High Performance Embedded Computing © 2007 Elsevier Chapter 1, part 3: Embedded Computing High Performance Embedded Computing Wayne Wolf.
1 Time Complexity We use a multitape Turing machine We count the number of steps until a string is accepted We use the O(k) notation.
Optimization/Decision Problems Optimization Problems – An optimization problem is one which asks, “What is the optimal solution to problem X?” – Examples:
CS 598 Scripting Languages Design and Implementation 9. Constant propagation and Type Inference.
Operational Semantics Mooly Sagiv Tel Aviv University Sunday Scrieber 8 Monday Schrieber.
Chapter 12 Theory of Computation Introduction to CS 1 st Semester, 2014 Sanghyun Park.
Operational Semantics Mooly Sagiv Reference: Semantics with Applications Chapter 2 H. Nielson and F. Nielson
Prof. Busch - LSU1 Time Complexity. Prof. Busch - LSU2 Consider a deterministic Turing Machine which decides a language.
Operational Semantics Mooly Sagiv Reference: Semantics with Applications Chapter 2 H. Nielson and F. Nielson
Review A program is… a set of instructions that tell a computer what to do. Programs can also be called… software. Hardware refers to… the physical components.
CSC-305 Design and Analysis of AlgorithmsBS(CS) -6 Fall-2014CSC-305 Design and Analysis of AlgorithmsBS(CS) -6 Fall-2014 Design and Analysis of Algorithms.
Arrays An array is a sequence of objects all of which have the same type. The objects are called the elements of the array and are numbered consecutively.
 It is a pure oops language and a high level language.  It was developed at sun microsystems by James Gosling.
ALGORITHMS part-1.
Representation, Syntax, Paradigms, Types
Growth-rate analysis of programs: the quest for decidability
Starter Read the Feedback Click on Add new Feedback Open Realsmart
Unit 2 Programming.
Algorithm design and Analysis
Representation, Syntax, Paradigms, Types
Algorithms Take a look at the worksheet. What do we already know, and what will we have to learn in this term?
Selection Statements.
Representation, Syntax, Paradigms, Types
Theory of Computability
Introduction to Grasshopper for rhino
Theory of Computability
Representation, Syntax, Paradigms, Types
Intro to Theory of Computation
Presentation transcript:

Automatic Complexity Analysis of Simple Imperative Programs Zachi Mann

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

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.

A Short Example

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

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

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

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

Back to the Example

Ben-Amram (2010)

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

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.

Loops

Performance Comparison

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