Debugging Program Slicing

Size: px
Start display at page:

Download "Debugging Program Slicing"

Transcription

1 Debugging Franz Wotawa Institut für Informationssysteme, Database and Artificial Intelligence Group, Technische Universität Wien 1

2 What is a Slice? A Slice is a reduced program, that preserves the original program s behavior for a given set of variables at a chosen point in a program. Characteristics: Defined for variables and a given point A slice is itself a program Ignoring other statements Focus on relevant parts 2

3 Is slicing/debugging necessary? YES!? 3

4 Example A 1. z = 4; 2. y = z + 1; 3. x = 5 + z; 4. Original Program 1. z = 4; x = 5 + z; 4. Slice wrt. Deleting statements Preserving projection of programs semantics Removing irrelevant information Algorithmic debugging, testing, maintenance, and measurement 4

5 Definitions (Overview) Mark Weiser: Slicing Criterion Captures semantics projection to be preserved and a set of Varia- Consists of a line number bles : Example: The variable does not depend on, hence statement 2 can be removed. Static vs. Dynamic slicing 5

6 Formal Definitions (I) de- Definition 1.1 (REF/DEF Variable Sets) notes the set of variables defined at node. denotes the set of variables referenced at node. Example Assignment x = y + z; and. Definition 1.2 (State Trajectory) A state trajectory of length of a program is a finite list of ordered pairs where each is a node of and each is a function mapping the variables in (a subset of the variables in ) to their values. Each gives the values of variables in immediately before the execution of. 6

7 Formal Definitions (II) Definition 1.3 (Static Slicing Criterion) A static slicing criterion of a program is a pair, where is a statement in and is a subset of the variables in. Definition 1.4 (Projection) Let be a state trajectory, any node in and any function from variable names to values. Then if otherwise where is restricted to domain, and is the empty string. 7

8 Formal Definitions (III) of a pro- is any pro- Definition 1.5 (Static Slicing) A slice gram on a slicing criterion gram with the following properties: 1. can be obtained from more statements from. by deleting zero or 2. Whenever halts on an input with state trajectory, then also halts on input with state trajectory, and, where and is the nearest successor to in the original program which is also in the slice, or itself if is in the slice. 8

9 Example A (cont.) State trajectory: State trajectory for slice: Projections are equal Really a slice 9

10 Computing Slices (I) Slicing Definition does not say how to find one! Is there a minimal slice? Definition 1.6 (Minimal Slice) Let be a slicing criterion on a program. A slice of on is statement-minimal if no other slice of on has fewer statements than. Theorem 1.1 There does not exist an algorithm to find state-minimal slices for arbitrary programs. Argument: Finding minimal slices is equivalent to solving the halting problem. 10

11 Computing Slices (II) Use data flow analyses Constructs conservative slices Results have slice property Maybe to many statements included. 1. y = x; 2. z = y; 3. The value of x can affect the value of z to be directly relevant to a slice. x is said 11

12 Computing Slices (III) Definition 1.7 (Relevant Variables) Let be a slicing criterion. Then comprises all variables such that either: 1. and, or 2. is an immediate predecessor of a node such that either: (a) is in and and there is a, or in both (b) is not in and is in. Recursive definition over the length of paths to reach node. Computation of for arbitrary programs in and for structured programs in where is the number of edges in the flow-graph. 12

13 Computing Slices (IV) Statements included in the slice by. are denoted all nodes s.t. While is a function mapping statements to variables, is only a set of statements. does not include indirect effects is a sufficient but not necessary condition for including statements in a slice. 13

14 Example A (cont.) Computing for our running example 1. z = 4; 2. y = z + 1; 3. x = 5 + z; 4. Slice for Rule (1) Rule (2a) Rule (2b) Slice 14

15 Negative Example 1. read(x); 2. if (x < 1) 3. z = 1; else 4. z = 2; 5. write(z); 6. In this program statement 2 obviously has an effect on the value of z at statement 5, yet 2 is not in. Branch statements must be specially treated! Branch statements should be in the slice! 15

16 Computing Slices (IV) Avoid Problems Define Range of Influence Nearest inverse dominator of a branch Definition 1.8 is the set of statements which are on the path from to its nearest inverse dominator, excluding the endpoints of. is empty unless immediate successor. has more than one 16

17 Computing Slices (V) Definition 1.9 For all : all nodes or s.t. where. is the branch statement criterion and define nondecreasing subset bound by the set of variables and statements. Therefore, each has a least fix point denoted and. 17

18 Computing Slices (VI) The following properties hold: The upper bound on the complexity of computing is where is the number of edges in the flow-graphs and the number of nodes. Computation in practice seems much faster. is not always the smallest slice! 18

19 Example B 1. A = constant; 2. while (P(k)) 3. if (Q(C)) 4. B = A; 5. X = 1; else 6. C = B; 7. Y = 2; 8. K = K + 1; 9. Z = X + Y; 10. write(z); Slicing criterion Statement 1 will be in but cannot affect the values of in statement 10! It cannot because any path by which at 1 can influence at 3 will also execute both statements 5 and 7, resulting in a constant value for at line

20 Advantages/Disadvantages Can be computed at compile time (Offline) Fast computation of slices Provide relevant informations of a program Does not help in all cases (Neither do other techniques) Contains informations that are not relevant to a specific test-case 20

21 Extensions (Dynamic Slicing) Compute Slice for each test-case Use Execution Trace Slice is smaller Computation is fast Requires more space (for the execution trace) 21

22 Example C program sample; var n,max,min,s,i,k: integer; a: array[1..100] of integer; 1. procedure find max(s1: integer; var s2: integer); begin 2. if s1 s2 then 3. s := s1; /* correctly s2 := s1; end; 4. procedure find min(x: integer; var y: integer); begin 5. if x y then 6. y := x; end; 22

23 Example C (cont.) begin 7. readln(n); 8. readln(k); 9. i := 1; 10. while i n do begin 11. readln(a[i]); 12. i := i + 1; end; 13. max := a[1]; 14. min := a[1]; 15. s := a[1]; 16. i := k + 1; 17. while i n do begin 18. if a[i] 0 then begin 19. Find max(a[i],max); 20. Find min(a[i],min); 21. s := s + a[i]; end; 22. i := i + k; end; 23. write(max,, min,, s); end; 23

24 Example C (cont.) Flow Graph readln(n) readln(k) Flow Graph Program sample i:=1 i<=n max:=a[1] readln(a[i]) min:=a[1] i:=i+1 s:=a[1] i:=k+1 i<=n write(max,,min,,s) a[i]>0 Find_max(..) Find_min(..) s:=s+a[i] i:=i+k 24

25 Example C (cont.) Execution trace on input:,,. readln(n). readln(k). i := 1. i n. readln(a[1]). i := i + 1. i n. readln(a[1]). i := i + 1. i n. readln(a[1]). i := i + 1. i n. max := a[1]. min := a[1]. s := a[1]. i := k + 1. i n. a[i] 0. Find max(a[i],max). procedure Find max(... ). s1 s2. s := s1. Find min(a[i],min). procedure Find min(... ). x y. s := s + a[i]. i := i + k. i n. a[i] 0. i := i + k. i n. writeln(max,, min,, s) 25

26 Background Flow Graph Node for every assignment, input and output statement, procedure call, procedure entry, goto, break, continue, label, and the predicate of while loops and conditional (test node). Arc are for potential transfer of control from one node to the other. Execution Trace is a sequence of nodes that has been executed for some input. e.g.,. Node at position is written as and is referred to as an action (or test action if is a test node). is a variable at position, i.e., a variable before execution of node. 26

27 Dynamic Slice A dynamic slice is an executable part of a program whose behavior is identical, for the same input, to that of the original program wrt. a variable of interest at some execution position. Definition 1.10 (Slicing Criterion) A slicing criterion of a program executed on program input is a tuple where is a variable at execution position. A dynamic slice for preserves the value of for a given program input. Goal: Find a minimal number of statements that is a dynamic slice for. 27

28 Computing Dynamic Slices Compute the execution trace for a given input Derive the dynamic slice using data and control dependencies Data dependency: An action node assigns a value and another node uses this value, e.g., assigns a value to variable and uses that value. Control dependency: Capture the dependence between test actions and actions that have been chosen to be executed by these test actions, e.g., is depended on the outcome of test action, but is not. Use dynamic dependencies to compute the dynamic slice by tracing back the dependencies between actions in starting from action. 28

29 Computing Dynamic Slices (cont.) 1. Set all actions as unmarked and not visited. 2. Mark the last definition of. The last definition of a variable in execution trace is an action that assigns a value to and is not modified between and. E.g., last definition of is action. 3. Chose an action that is marked and not visited. Set as visited. All last definitions of all variables used in are marked, and then all actions for which there exists a control dependence between them and are marked. 4. This process continues until all marked actions are visited. 5. A dynamic slice is constructed by removing all nodes (statements) whose actions are not marked in. 29

30 Example C (cont.) Marked actions are referred as contributing actions. Dynamic slice for at position 23: program sample; var n,max,min,s,i,k: integer; a: array[1..100] of integer; begin 7. readln(n); 8. readln(k); 9. i := 1; 10. while i n do begin 11. readln(a[i]); 12. i := i + 1; end; 13. max := a[1]; 23. write(max,, min,, s); end; 30

Static Slicing. Software Maintenance

Static Slicing. Software Maintenance soma@ist.tugraz.at 1 Outline Basics Control flow graphs Slicing Motivation Static slicing with relevant variables table Static slicing with program dependency graphs Summary & Outline 2 Outline Basics

More information

Class 6. Review; questions Assign (see Schedule for links) Slicing overview (cont d) Problem Set 3: due 9/8/09. Program Slicing

Class 6. Review; questions Assign (see Schedule for links) Slicing overview (cont d) Problem Set 3: due 9/8/09. Program Slicing Class 6 Review; questions Assign (see Schedule for links) Slicing overview (cont d) Problem Set 3: due 9/8/09 1 Program Slicing 2 1 Program Slicing 1. Slicing overview 2. Types of slices, levels of slices

More information

Slides for Faculty Oxford University Press All rights reserved.

Slides for Faculty Oxford University Press All rights reserved. Oxford University Press 2013 Slides for Faculty Assistance Preliminaries Author: Vivek Kulkarni vivek_kulkarni@yahoo.com Outline Following topics are covered in the slides: Basic concepts, namely, symbols,

More information

V Advanced Data Structures

V Advanced Data Structures V Advanced Data Structures B-Trees Fibonacci Heaps 18 B-Trees B-trees are similar to RBTs, but they are better at minimizing disk I/O operations Many database systems use B-trees, or variants of them,

More information

Modeling Java Programs for Diagnosis ½

Modeling Java Programs for Diagnosis ½ Modeling Java Programs for Diagnosis ½ Cristinel Mateis and Markus Stumptner and Franz Wotawa ¾ Abstract. A key advantage of model-based diagnosis is the ability to use a generic model for the production

More information

SEQUENCES, MATHEMATICAL INDUCTION, AND RECURSION

SEQUENCES, MATHEMATICAL INDUCTION, AND RECURSION CHAPTER 5 SEQUENCES, MATHEMATICAL INDUCTION, AND RECURSION Alessandro Artale UniBZ - http://www.inf.unibz.it/ artale/ SECTION 5.5 Application: Correctness of Algorithms Copyright Cengage Learning. All

More information

Subset sum problem and dynamic programming

Subset sum problem and dynamic programming Lecture Notes: Dynamic programming We will discuss the subset sum problem (introduced last time), and introduce the main idea of dynamic programming. We illustrate it further using a variant of the so-called

More information

Reasoning About Imperative Programs. COS 441 Slides 10

Reasoning About Imperative Programs. COS 441 Slides 10 Reasoning About Imperative Programs COS 441 Slides 10 The last few weeks Agenda reasoning about functional programming It s very simple and very uniform: substitution of equal expressions for equal expressions

More information

Outline. Introduction. 2 Proof of Correctness. 3 Final Notes. Precondition P 1 : Inputs include

Outline. Introduction. 2 Proof of Correctness. 3 Final Notes. Precondition P 1 : Inputs include Outline Computer Science 331 Correctness of Algorithms Mike Jacobson Department of Computer Science University of Calgary Lectures #2-4 1 What is a? Applications 2 Recursive Algorithms 3 Final Notes Additional

More information

Power Set of a set and Relations

Power Set of a set and Relations Power Set of a set and Relations 1 Power Set (1) Definition: The power set of a set S, denoted P(S), is the set of all subsets of S. Examples Let A={a,b,c}, P(A)={,{a},{b},{c},{a,b},{b,c},{a,c},{a,b,c}}

More information

V Advanced Data Structures

V Advanced Data Structures V Advanced Data Structures B-Trees Fibonacci Heaps 18 B-Trees B-trees are similar to RBTs, but they are better at minimizing disk I/O operations Many database systems use B-trees, or variants of them,

More information

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2016

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2016 Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2016 Lecture 15 Ana Bove May 23rd 2016 More on Turing machines; Summary of the course. Overview of today s lecture: Recap: PDA, TM Push-down

More information

Online Graph Exploration

Online Graph Exploration Distributed Computing Online Graph Exploration Semester thesis Simon Hungerbühler simonhu@ethz.ch Distributed Computing Group Computer Engineering and Networks Laboratory ETH Zürich Supervisors: Sebastian

More information

Qualifying Exam in Programming Languages and Compilers

Qualifying Exam in Programming Languages and Compilers Qualifying Exam in Programming Languages and Compilers University of Wisconsin Fall 1991 Instructions This exam contains nine questions, divided into two parts. All students taking the exam should answer

More information

DEBUGGING: STATIC ANALYSIS

DEBUGGING: STATIC ANALYSIS DEBUGGING: STATIC ANALYSIS WS 2017/2018 Martina Seidl Institute for Formal Models and Verification Deduction Techniques (1/2) basic idea: reasoning from abstract program to concrete program runs (program

More information

Last time. Reasoning about programs. Coming up. Project Final Presentations. This Thursday, Nov 30: 4 th in-class exercise

Last time. Reasoning about programs. Coming up. Project Final Presentations. This Thursday, Nov 30: 4 th in-class exercise Last time Reasoning about programs Coming up This Thursday, Nov 30: 4 th in-class exercise sign up for group on moodle bring laptop to class Final projects: final project presentations: Tue Dec 12, in

More information

Reasoning about programs

Reasoning about programs Reasoning about programs Last time Coming up This Thursday, Nov 30: 4 th in-class exercise sign up for group on moodle bring laptop to class Final projects: final project presentations: Tue Dec 12, in

More information

Heuristic (Informed) Search

Heuristic (Informed) Search Heuristic (Informed) Search (Where we try to choose smartly) R&N: Chap., Sect..1 3 1 Search Algorithm #2 SEARCH#2 1. INSERT(initial-node,Open-List) 2. Repeat: a. If empty(open-list) then return failure

More information

Functions. Def. Let A and B be sets. A function f from A to B is an assignment of exactly one element of B to each element of A.

Functions. Def. Let A and B be sets. A function f from A to B is an assignment of exactly one element of B to each element of A. Functions functions 1 Def. Let A and B be sets. A function f from A to B is an assignment of exactly one element of B to each element of A. a A! b B b is assigned to a a A! b B f ( a) = b Notation: If

More information

Comp 411 Principles of Programming Languages Lecture 7 Meta-interpreters. Corky Cartwright January 26, 2018

Comp 411 Principles of Programming Languages Lecture 7 Meta-interpreters. Corky Cartwright January 26, 2018 Comp 411 Principles of Programming Languages Lecture 7 Meta-interpreters Corky Cartwright January 26, 2018 Denotational Semantics The primary alternative to syntactic semantics is denotational semantics.

More information

INTRODUCTION TO SOFTWARE ENGINEERING

INTRODUCTION TO SOFTWARE ENGINEERING INTRODUCTION TO SOFTWARE ENGINEERING Structural Testing d_sinnig@cs.concordia.ca Department for Computer Science and Software Engineering Introduction Testing is simple all a tester needs to do is find

More information

CSCI Compiler Design

CSCI Compiler Design CSCI 565 - Compiler Design Spring 2010 Final Exam - Solution May 07, 2010 at 1.30 PM in Room RTH 115 Duration: 2h 30 min. Please label all pages you turn in with your name and student number. Name: Number:

More information

Trees. 3. (Minimally Connected) G is connected and deleting any of its edges gives rise to a disconnected graph.

Trees. 3. (Minimally Connected) G is connected and deleting any of its edges gives rise to a disconnected graph. Trees 1 Introduction Trees are very special kind of (undirected) graphs. Formally speaking, a tree is a connected graph that is acyclic. 1 This definition has some drawbacks: given a graph it is not trivial

More information

COMPUTABILITY THEORY AND RECURSIVELY ENUMERABLE SETS

COMPUTABILITY THEORY AND RECURSIVELY ENUMERABLE SETS COMPUTABILITY THEORY AND RECURSIVELY ENUMERABLE SETS JOSHUA LENERS Abstract. An algorithm is function from ω to ω defined by a finite set of instructions to transform a given input x to the desired output

More information

Cantor s Diagonal Argument for Different Levels of Infinity

Cantor s Diagonal Argument for Different Levels of Infinity JANUARY 2015 1 Cantor s Diagonal Argument for Different Levels of Infinity Michael J. Neely University of Southern California http://www-bcf.usc.edu/ mjneely Abstract These notes develop the classic Cantor

More information

Analyze the obvious algorithm, 5 points Here is the most obvious algorithm for this problem: (LastLargerElement[A[1..n]:

Analyze the obvious algorithm, 5 points Here is the most obvious algorithm for this problem: (LastLargerElement[A[1..n]: CSE 101 Homework 1 Background (Order and Recurrence Relations), correctness proofs, time analysis, and speeding up algorithms with restructuring, preprocessing and data structures. Due Thursday, April

More information

Lecture Notes: Widening Operators and Collecting Semantics

Lecture Notes: Widening Operators and Collecting Semantics Lecture Notes: Widening Operators and Collecting Semantics 15-819O: Program Analysis (Spring 2016) Claire Le Goues clegoues@cs.cmu.edu 1 A Collecting Semantics for Reaching Definitions The approach to

More information

THE traditional denotational semantics treats a program

THE traditional denotational semantics treats a program The Formal Semantics of Program Slicing for Non-Terminating Computations Martin Ward and Hussein Zedan Abstract Since the original development of program slicing in 1979 [1] there have been many attempts

More information

Global Optimization. Lecture Outline. Global flow analysis. Global constant propagation. Liveness analysis. Local Optimization. Global Optimization

Global Optimization. Lecture Outline. Global flow analysis. Global constant propagation. Liveness analysis. Local Optimization. Global Optimization Lecture Outline Global Optimization Global flow analysis Global constant propagation Liveness analysis Compiler Design I (2011) 2 Local Optimization Recall the simple basic-block optimizations Constant

More information

A counter-example to the minimal coverability tree algorithm

A counter-example to the minimal coverability tree algorithm A counter-example to the minimal coverability tree algorithm A. Finkel, G. Geeraerts, J.-F. Raskin and L. Van Begin Abstract In [1], an algorithm to compute a minimal coverability tree for Petri nets has

More information

Shell CSCE 314 TAMU. Haskell Functions

Shell CSCE 314 TAMU. Haskell Functions 1 CSCE 314: Programming Languages Dr. Dylan Shell Haskell Functions 2 Outline Defining Functions List Comprehensions Recursion 3 Conditional Expressions As in most programming languages, functions can

More information

CHAPTER 7. Copyright Cengage Learning. All rights reserved.

CHAPTER 7. Copyright Cengage Learning. All rights reserved. CHAPTER 7 FUNCTIONS Copyright Cengage Learning. All rights reserved. SECTION 7.1 Functions Defined on General Sets Copyright Cengage Learning. All rights reserved. Functions Defined on General Sets We

More information

Chapter S:V. V. Formal Properties of A*

Chapter S:V. V. Formal Properties of A* Chapter S:V V. Formal Properties of A* Properties of Search Space Graphs Auxiliary Concepts Roadmap Completeness of A* Admissibility of A* Efficiency of A* Monotone Heuristic Functions S:V-1 Formal Properties

More information

(How Not To Do) Global Optimizations

(How Not To Do) Global Optimizations (How Not To Do) Global Optimizations #1 One-Slide Summary A global optimization changes an entire method (consisting of multiple basic blocks). We must be conservative and only apply global optimizations

More information

Functions. How is this definition written in symbolic logic notation?

Functions. How is this definition written in symbolic logic notation? functions 1 Functions Def. Let A and B be sets. A function f from A to B is an assignment of exactly one element of B to each element of A. We write f(a) = b if b is the unique element of B assigned by

More information

INTRODUCTION TO ALGORITHMS

INTRODUCTION TO ALGORITHMS UNIT- Introduction: Algorithm: The word algorithm came from the name of a Persian mathematician Abu Jafar Mohammed Ibn Musa Al Khowarizmi (ninth century) An algorithm is simply s set of rules used to perform

More information

Theorem 2.9: nearest addition algorithm

Theorem 2.9: nearest addition algorithm There are severe limits on our ability to compute near-optimal tours It is NP-complete to decide whether a given undirected =(,)has a Hamiltonian cycle An approximation algorithm for the TSP can be used

More information

CONTROL FLOW ANALYSIS. The slides adapted from Vikram Adve

CONTROL FLOW ANALYSIS. The slides adapted from Vikram Adve CONTROL FLOW ANALYSIS The slides adapted from Vikram Adve Flow Graphs Flow Graph: A triple G=(N,A,s), where (N,A) is a (finite) directed graph, s N is a designated initial node, and there is a path from

More information

Algorithm Analysis and Design

Algorithm Analysis and Design Algorithm Analysis and Design Dr. Truong Tuan Anh Faculty of Computer Science and Engineering Ho Chi Minh City University of Technology VNU- Ho Chi Minh City 1 References [1] Cormen, T. H., Leiserson,

More information

Fixed-Parameter Algorithm for 2-CNF Deletion Problem

Fixed-Parameter Algorithm for 2-CNF Deletion Problem Fixed-Parameter Algorithm for 2-CNF Deletion Problem Igor Razgon Igor Razgon Computer Science Department University College Cork Ireland A brief introduction to the area of fixed-parameter algorithms 2

More information

(Not Quite) Minijava

(Not Quite) Minijava (Not Quite) Minijava CMCS22620, Spring 2004 April 5, 2004 1 Syntax program mainclass classdecl mainclass class identifier { public static void main ( String [] identifier ) block } classdecl class identifier

More information

Lecture Notes on Contracts

Lecture Notes on Contracts Lecture Notes on Contracts 15-122: Principles of Imperative Computation Frank Pfenning Lecture 2 August 30, 2012 1 Introduction For an overview the course goals and the mechanics and schedule of the course,

More information

Paths, Flowers and Vertex Cover

Paths, Flowers and Vertex Cover Paths, Flowers and Vertex Cover Venkatesh Raman, M.S. Ramanujan, and Saket Saurabh Presenting: Hen Sender 1 Introduction 2 Abstract. It is well known that in a bipartite (and more generally in a Konig)

More information

Static Analysis. Systems and Internet Infrastructure Security

Static Analysis. Systems and Internet Infrastructure Security Systems and Internet Infrastructure Security Network and Security Research Center Department of Computer Science and Engineering Pennsylvania State University, University Park PA Static Analysis Trent

More information

How many leaves on the decision tree? There are n! leaves, because every permutation appears at least once.

How many leaves on the decision tree? There are n! leaves, because every permutation appears at least once. Chapter 8. Sorting in Linear Time Types of Sort Algorithms The only operation that may be used to gain order information about a sequence is comparison of pairs of elements. Quick Sort -- comparison-based

More information

Abstract Interpretation

Abstract Interpretation Abstract Interpretation Ranjit Jhala, UC San Diego April 22, 2013 Fundamental Challenge of Program Analysis How to infer (loop) invariants? Fundamental Challenge of Program Analysis Key issue for any analysis

More information

Cardinality of Sets. Washington University Math Circle 10/30/2016

Cardinality of Sets. Washington University Math Circle 10/30/2016 Cardinality of Sets Washington University Math Circle 0/0/06 The cardinality of a finite set A is just the number of elements of A, denoted by A. For example, A = {a, b, c, d}, B = {n Z : n } = {,,, 0,,,

More information

Handout 9: Imperative Programs and State

Handout 9: Imperative Programs and State 06-02552 Princ. of Progr. Languages (and Extended ) The University of Birmingham Spring Semester 2016-17 School of Computer Science c Uday Reddy2016-17 Handout 9: Imperative Programs and State Imperative

More information

Constraint Satisfaction Problems

Constraint Satisfaction Problems Constraint Satisfaction Problems Search and Lookahead Bernhard Nebel, Julien Hué, and Stefan Wölfl Albert-Ludwigs-Universität Freiburg June 4/6, 2012 Nebel, Hué and Wölfl (Universität Freiburg) Constraint

More information

Advanced Programming Methods. Introduction in program analysis

Advanced Programming Methods. Introduction in program analysis Advanced Programming Methods Introduction in program analysis What is Program Analysis? Very broad topic, but generally speaking, automated analysis of program behavior Program analysis is about developing

More information

ELEC 876: Software Reengineering

ELEC 876: Software Reengineering ELEC 876: Software Reengineering () Dr. Ying Zou Department of Electrical & Computer Engineering Queen s University Compiler and Interpreter Compiler Source Code Object Compile Execute Code Results data

More information

Learning Rules. How to use rules? Known methods to learn rules: Comments: 2.1 Learning association rules: General idea

Learning Rules. How to use rules? Known methods to learn rules: Comments: 2.1 Learning association rules: General idea 2. Learning Rules Rule: cond è concl where } cond is a conjunction of predicates (that themselves can be either simple or complex) and } concl is an action (or action sequence) like adding particular knowledge

More information

Query Optimization. Shuigeng Zhou. December 9, 2009 School of Computer Science Fudan University

Query Optimization. Shuigeng Zhou. December 9, 2009 School of Computer Science Fudan University Query Optimization Shuigeng Zhou December 9, 2009 School of Computer Science Fudan University Outline Introduction Catalog Information for Cost Estimation Estimation of Statistics Transformation of Relational

More information

Programming Languages

Programming Languages CSE 230: Winter 2008 Principles of Programming Languages Ocaml/HW #3 Q-A Session Push deadline = Mar 10 Session Mon 3pm? Lecture 15: Type Systems Ranjit Jhala UC San Diego Why Typed Languages? Development

More information

CS 6110 S14 Lecture 38 Abstract Interpretation 30 April 2014

CS 6110 S14 Lecture 38 Abstract Interpretation 30 April 2014 CS 6110 S14 Lecture 38 Abstract Interpretation 30 April 2014 1 Introduction to Abstract Interpretation At this point in the course, we have looked at several aspects of programming languages: operational

More information

1 Non greedy algorithms (which we should have covered

1 Non greedy algorithms (which we should have covered 1 Non greedy algorithms (which we should have covered earlier) 1.1 Floyd Warshall algorithm This algorithm solves the all-pairs shortest paths problem, which is a problem where we want to find the shortest

More information

Copyright 2007 Pearson Addison-Wesley. All rights reserved. A. Levitin Introduction to the Design & Analysis of Algorithms, 2 nd ed., Ch.

Copyright 2007 Pearson Addison-Wesley. All rights reserved. A. Levitin Introduction to the Design & Analysis of Algorithms, 2 nd ed., Ch. Iterative Improvement Algorithm design technique for solving optimization problems Start with a feasible solution Repeat the following step until no improvement can be found: change the current feasible

More information

Lecture 15: The subspace topology, Closed sets

Lecture 15: The subspace topology, Closed sets Lecture 15: The subspace topology, Closed sets 1 The Subspace Topology Definition 1.1. Let (X, T) be a topological space with topology T. subset of X, the collection If Y is a T Y = {Y U U T} is a topology

More information

CMSC 330: Organization of Programming Languages. Operational Semantics

CMSC 330: Organization of Programming Languages. Operational Semantics CMSC 330: Organization of Programming Languages Operational Semantics Notes about Project 4, Parts 1 & 2 Still due today (7/2) Will not be graded until 7/11 (along with Part 3) You are strongly encouraged

More information

G Programming Languages - Fall 2012

G Programming Languages - Fall 2012 G22.2110-003 Programming Languages - Fall 2012 Lecture 3 Thomas Wies New York University Review Last week Names and Bindings Lifetimes and Allocation Garbage Collection Scope Outline Control Flow Sequencing

More information

Propositional Logic. Part I

Propositional Logic. Part I Part I Propositional Logic 1 Classical Logic and the Material Conditional 1.1 Introduction 1.1.1 The first purpose of this chapter is to review classical propositional logic, including semantic tableaux.

More information

Worst-Case Execution Time (WCET)

Worst-Case Execution Time (WCET) Introduction to Cache Analysis for Real-Time Systems [C. Ferdinand and R. Wilhelm, Efficient and Precise Cache Behavior Prediction for Real-Time Systems, Real-Time Systems, 17, 131-181, (1999)] Schedulability

More information

Types of general clustering methods. Clustering Algorithms for general similarity measures. Similarity between clusters

Types of general clustering methods. Clustering Algorithms for general similarity measures. Similarity between clusters Types of general clustering methods Clustering Algorithms for general similarity measures agglomerative versus divisive algorithms agglomerative = bottom-up build up clusters from single objects divisive

More information

The Static Single Assignment Form:

The Static Single Assignment Form: The Static Single Assignment Form: Construction and Application to Program Optimizations - Part 3 Department of Computer Science Indian Institute of Science Bangalore 560 012 NPTEL Course on Compiler Design

More information

Compiler Design. Fall Data-Flow Analysis. Sample Exercises and Solutions. Prof. Pedro C. Diniz

Compiler Design. Fall Data-Flow Analysis. Sample Exercises and Solutions. Prof. Pedro C. Diniz Compiler Design Fall 2015 Data-Flow Analysis Sample Exercises and Solutions Prof. Pedro C. Diniz USC / Information Sciences Institute 4676 Admiralty Way, Suite 1001 Marina del Rey, California 90292 pedro@isi.edu

More information

Introduction to Software Testing Chapter 4 Input Space Partition Testing

Introduction to Software Testing Chapter 4 Input Space Partition Testing Introduction to Software Testing Chapter 4 Input Space Partition Testing Paul Ammann & Jeff Offutt http://www.cs.gmu.edu/~offutt/ softwaretest/ Ch. 4 : Input Space Coverage Four Structures for Modeling

More information

DATABASE TECHNOLOGY - 1MB025 (also 1DL029, 1DL300+1DL400)

DATABASE TECHNOLOGY - 1MB025 (also 1DL029, 1DL300+1DL400) 1 DATABASE TECHNOLOGY - 1MB025 (also 1DL029, 1DL300+1DL400) Spring 2008 An introductury course on database systems http://user.it.uu.se/~udbl/dbt-vt2008/ alt. http://www.it.uu.se/edu/course/homepage/dbastekn/vt08/

More information

Recursive Function Theory

Recursive Function Theory Recursive Function Theory Abhishek Kr Singh TFR Mumbai. 21 August 2014 Primitive Recursive Functions nitial Functions. s(x) =x + 1 n(x) =0 u n i (x 1,...,x n )=x i,where1apple i apple n. Composition: Let

More information

Artificial Intelligence

Artificial Intelligence Artificial Intelligence Search Marc Toussaint University of Stuttgart Winter 2015/16 (slides based on Stuart Russell s AI course) Outline Problem formulation & examples Basic search algorithms 2/100 Example:

More information

6.001 Notes: Section 8.1

6.001 Notes: Section 8.1 6.001 Notes: Section 8.1 Slide 8.1.1 In this lecture we are going to introduce a new data type, specifically to deal with symbols. This may sound a bit odd, but if you step back, you may realize that everything

More information

Presentation for use with the textbook, Algorithm Design and Applications, by M. T. Goodrich and R. Tamassia, Wiley, Merge Sort & Quick Sort

Presentation for use with the textbook, Algorithm Design and Applications, by M. T. Goodrich and R. Tamassia, Wiley, Merge Sort & Quick Sort Presentation for use with the textbook, Algorithm Design and Applications, by M. T. Goodrich and R. Tamassia, Wiley, 2015 Merge Sort & Quick Sort 1 Divide-and-Conquer Divide-and conquer is a general algorithm

More information

CS350: Data Structures Binary Search Trees

CS350: Data Structures Binary Search Trees Binary Search Trees James Moscola Department of Engineering & Computer Science York College of Pennsylvania James Moscola Introduction to Binary Search Trees A binary search tree is a binary tree that

More information

LECTURE 8: SETS. Software Engineering Mike Wooldridge

LECTURE 8: SETS. Software Engineering Mike Wooldridge LECTURE 8: SETS Mike Wooldridge 1 What is a Set? The concept of a set is used throughout mathematics; its formal definition matches closely our intuitive understanding of the word. Definition: A set is

More information

DESIGN AND ANALYSIS OF ALGORITHMS. Unit 1 Chapter 4 ITERATIVE ALGORITHM DESIGN ISSUES

DESIGN AND ANALYSIS OF ALGORITHMS. Unit 1 Chapter 4 ITERATIVE ALGORITHM DESIGN ISSUES DESIGN AND ANALYSIS OF ALGORITHMS Unit 1 Chapter 4 ITERATIVE ALGORITHM DESIGN ISSUES http://milanvachhani.blogspot.in USE OF LOOPS As we break down algorithm into sub-algorithms, sooner or later we shall

More information

CS2 Algorithms and Data Structures Note 1

CS2 Algorithms and Data Structures Note 1 CS2 Algorithms and Data Structures Note 1 Analysing Algorithms This thread of the course is concerned with the design and analysis of good algorithms and data structures. Intuitively speaking, an algorithm

More information

Key Concepts: Economic Computation, Part II

Key Concepts: Economic Computation, Part II Key Concepts: Economic Computation, Part II Brent Hickman Fall, 2009 The purpose of the second section of these notes is to give you some further practice with numerical computation in MATLAB, and also

More information

Traveling Salesman Problem (TSP) Input: undirected graph G=(V,E), c: E R + Goal: find a tour (Hamiltonian cycle) of minimum cost

Traveling Salesman Problem (TSP) Input: undirected graph G=(V,E), c: E R + Goal: find a tour (Hamiltonian cycle) of minimum cost Traveling Salesman Problem (TSP) Input: undirected graph G=(V,E), c: E R + Goal: find a tour (Hamiltonian cycle) of minimum cost Traveling Salesman Problem (TSP) Input: undirected graph G=(V,E), c: E R

More information

Data Mining. Part 2. Data Understanding and Preparation. 2.4 Data Transformation. Spring Instructor: Dr. Masoud Yaghini. Data Transformation

Data Mining. Part 2. Data Understanding and Preparation. 2.4 Data Transformation. Spring Instructor: Dr. Masoud Yaghini. Data Transformation Data Mining Part 2. Data Understanding and Preparation 2.4 Spring 2010 Instructor: Dr. Masoud Yaghini Outline Introduction Normalization Attribute Construction Aggregation Attribute Subset Selection Discretization

More information

Höllische Programmiersprachen Hauptseminar im Wintersemester 2014/2015 Determinism and reliability in the context of parallel programming

Höllische Programmiersprachen Hauptseminar im Wintersemester 2014/2015 Determinism and reliability in the context of parallel programming Höllische Programmiersprachen Hauptseminar im Wintersemester 2014/2015 Determinism and reliability in the context of parallel programming Raphael Arias Technische Universität München 19.1.2015 Abstract

More information

Formal Languages and Compilers Lecture VI: Lexical Analysis

Formal Languages and Compilers Lecture VI: Lexical Analysis Formal Languages and Compilers Lecture VI: Lexical Analysis Free University of Bozen-Bolzano Faculty of Computer Science POS Building, Room: 2.03 artale@inf.unibz.it http://www.inf.unibz.it/ artale/ Formal

More information

Contents Contents Introduction Basic Steps in Query Processing Introduction Transformation of Relational Expressions...

Contents Contents Introduction Basic Steps in Query Processing Introduction Transformation of Relational Expressions... Contents Contents...283 Introduction...283 Basic Steps in Query Processing...284 Introduction...285 Transformation of Relational Expressions...287 Equivalence Rules...289 Transformation Example: Pushing

More information

1 Matchings in Graphs

1 Matchings in Graphs Matchings in Graphs J J 2 J 3 J 4 J 5 J J J 6 8 7 C C 2 C 3 C 4 C 5 C C 7 C 8 6 J J 2 J 3 J 4 J 5 J J J 6 8 7 C C 2 C 3 C 4 C 5 C C 7 C 8 6 Definition Two edges are called independent if they are not adjacent

More information

AND-OR GRAPHS APPLIED TO RUE RESOLUTION

AND-OR GRAPHS APPLIED TO RUE RESOLUTION AND-OR GRAPHS APPLIED TO RUE RESOLUTION Vincent J. Digricoli Dept. of Computer Science Fordham University Bronx, New York 104-58 James J, Lu, V. S. Subrahmanian Dept. of Computer Science Syracuse University-

More information

PROGRAM EFFICIENCY & COMPLEXITY ANALYSIS

PROGRAM EFFICIENCY & COMPLEXITY ANALYSIS Lecture 03-04 PROGRAM EFFICIENCY & COMPLEXITY ANALYSIS By: Dr. Zahoor Jan 1 ALGORITHM DEFINITION A finite set of statements that guarantees an optimal solution in finite interval of time 2 GOOD ALGORITHMS?

More information

Crit-bit Trees. Adam Langley (Version )

Crit-bit Trees. Adam Langley (Version ) CRITBIT CWEB OUTPUT 1 Crit-bit Trees Adam Langley (agl@imperialviolet.org) (Version 20080926) 1. Introduction This code is taken from Dan Bernstein s qhasm and implements a binary crit-bit (alsa known

More information

Chapter 15: Information Flow

Chapter 15: Information Flow Chapter 15: Information Flow Definitions Compiler-based mechanisms Execution-based mechanisms Examples Slide #15-1 Overview Basics and background Compiler-based mechanisms Execution-based mechanisms Examples

More information

Lecture 2: Algorithms, Complexity and Data Structures. (Reading: AM&O Chapter 3)

Lecture 2: Algorithms, Complexity and Data Structures. (Reading: AM&O Chapter 3) Lecture 2: Algorithms, Complexity and Data Structures (Reading: AM&O Chapter 3) Algorithms problem: class of situations for which a computergenerated solution is needed. instance: specification of a particular

More information

School of Computer Science. Scheme Flow Analysis Note 2 4/27/90. Useless-Variable Elimination. Olin Shivers.

School of Computer Science. Scheme Flow Analysis Note 2 4/27/90. Useless-Variable Elimination. Olin Shivers. Carnegie Mellon School of Computer Science Scheme Flow Analysis Note 2 4/27/90 Useless-Variable Elimination Olin Shivers shivers@cs.cmu.edu 1 Intro In my 1988 SIGPLAN paper Control-Flow Analysis in Scheme,

More information

Unit 1 Chapter 4 ITERATIVE ALGORITHM DESIGN ISSUES

Unit 1 Chapter 4 ITERATIVE ALGORITHM DESIGN ISSUES DESIGN AND ANALYSIS OF ALGORITHMS Unit 1 Chapter 4 ITERATIVE ALGORITHM DESIGN ISSUES http://milanvachhani.blogspot.in USE OF LOOPS As we break down algorithm into sub-algorithms, sooner or later we shall

More information

Program Structure. Simple Statements. Program consists of blocks Block. Can be represented by a flow graph. Sequence of statements

Program Structure. Simple Statements. Program consists of blocks Block. Can be represented by a flow graph. Sequence of statements An Applicable Family of Data Flow Testing Criteria Assumptions about the program No goto statements with variant records Functions having var parameters By reference Procedural or functional parameters

More information

Program Structure. Simple Statements. Program consists of blocks Block. Can be represented by a flow graph. Sequence of statements

Program Structure. Simple Statements. Program consists of blocks Block. Can be represented by a flow graph. Sequence of statements An Applicable Family of Data Flow Testing Criteria Assumptions about the program No goto statements with variant records Functions having var parameters By reference Procedural or functional parameters

More information

Program Syntax; Operational Semantics

Program Syntax; Operational Semantics 9/5 Solved Program Syntax; Operational Semantics CS 536: Science of Programming, Fall 2018 A. Why Our simple programming language is a model for the kind of constructs seen in actual languages. Step-by-step

More information

Reasoning About Programs Panagiotis Manolios

Reasoning About Programs Panagiotis Manolios Reasoning About Programs Panagiotis Manolios Northeastern University March 22, 2012 Version: 58 Copyright c 2012 by Panagiotis Manolios All rights reserved. We hereby grant permission for this publication

More information

Introduction Alternative ways of evaluating a given query using

Introduction Alternative ways of evaluating a given query using Query Optimization Introduction Catalog Information for Cost Estimation Estimation of Statistics Transformation of Relational Expressions Dynamic Programming for Choosing Evaluation Plans Introduction

More information

Space vs Time, Cache vs Main Memory

Space vs Time, Cache vs Main Memory Space vs Time, Cache vs Main Memory Marc Moreno Maza University of Western Ontario, London, Ontario (Canada) CS 4435 - CS 9624 (Moreno Maza) Space vs Time, Cache vs Main Memory CS 4435 - CS 9624 1 / 49

More information

Chapter 4 Concepts from Geometry

Chapter 4 Concepts from Geometry Chapter 4 Concepts from Geometry An Introduction to Optimization Spring, 2014 Wei-Ta Chu 1 Line Segments The line segment between two points and in R n is the set of points on the straight line joining

More information

Fault Simulation. Problem and Motivation

Fault Simulation. Problem and Motivation Fault Simulation Problem and Motivation Fault Simulation Problem: Given A circuit A sequence of test vectors A fault model Determine Fault coverage Fraction (or percentage) of modeled faults detected by

More information

Clustering: Centroid-Based Partitioning

Clustering: Centroid-Based Partitioning Clustering: Centroid-Based Partitioning Yufei Tao Department of Computer Science and Engineering Chinese University of Hong Kong 1 / 29 Y Tao Clustering: Centroid-Based Partitioning In this lecture, we

More information

Compiler Construction 2009/2010 SSA Static Single Assignment Form

Compiler Construction 2009/2010 SSA Static Single Assignment Form Compiler Construction 2009/2010 SSA Static Single Assignment Form Peter Thiemann March 15, 2010 Outline 1 Static Single-Assignment Form 2 Converting to SSA Form 3 Optimization Algorithms Using SSA 4 Dependencies

More information

Clustering Algorithms for general similarity measures

Clustering Algorithms for general similarity measures Types of general clustering methods Clustering Algorithms for general similarity measures general similarity measure: specified by object X object similarity matrix 1 constructive algorithms agglomerative

More information