Static Slicing. Software Maintenance

Size: px
Start display at page:

Download "Static Slicing. Software Maintenance"

Transcription

1 1

2 Outline Basics Control flow graphs Slicing Motivation Static slicing with relevant variables table Static slicing with program dependency graphs Summary & Outline 2

3 Outline Basics Control flow graphs Slicing Motivation Static slicing with relevant variables table Static slicing with program dependency graphs Summary & Outline 3

4 Outline Basics Control flow graphs Slicing Motivation Static slicing with relevant variables table Static slicing with program dependency graphs Summary & Outline 4

5 Motivation Imagine: Your program computes the wrong value for variable x at line 312 in the file y. The statement in line 312 is correct. How can you minimize the statements you have to investigate? Solution: Computation of statements influencing the values of the variables referenced in line 312 and skip the rest. 5

6 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 (irrelevant) statements Focus on relevant parts 6

7 Example 1 1. begin 2. z = 4 + a; 3. y = z + 1; 4. x = 5 + z; 5. end Slicing Criterion: (5, {x}) 7

8 Algorithm 1 Slicing criterion C = (i,v) with line number i, variables of interest V Relevant variables R C (n) all v V if n = I all v Ref(n) if { w w Def(n) w R C (m) n Pre(m)} all w R C (m) where w Def(n) n Pre(m) 1 2a 2b Slice S C comprises all statements n where R C (m) Def(n) { } with n Pre(m) 8

9 9 Example 2 1. begin 2. z = 4 + a; 3. if (a > 3) then 4. begin 5. z = z - 3; 6. end 7. fi; 8. x = 5 + z; 9. end Slicing Criterion: (9, {x})

10 Algorithm 2 Influence set Infl(b) Set of statements influenced by the control statement b Improved algorithm: 1. Compute R 0 C and S 0 C 2. Compute control flow stmts infl. variables in the slice: B C = { b j S 0 C, j Infl(b) } 3. Compute the slice S 1 C S 1 C = S 0 C B C 10

11 Example 3 1. begin 2. r = 0 ; 3. i = 0 ; 4. while ( i < n) do 5. begin 6. if (A[ i ] == 1) then 7. begin 8. r = r + 1 ; 9. end; 10. f i ; 11. i = i + 1 ; 12. end; 13. od; 14. end; Slicing Criterion: (14, {i}) 11

12 Example 4 1. begin 2. r = 0 ; 3. i = 0 ; 4. while ( i < n) do 5. begin 6. if (A[ i ] == 1) then 7. begin 8. r = r + 1 ; 9. end; 10. f i ; 11. i = i + 1 ; 12. n = n 1; 13. end; 14. od; 15. end; Slicing Criterion: (15, {i}) 12

13 Algorithm 3 1.Compute R 0 C and S 0 C 2.For i 0 a. Compute control flow statements influencing variables in the slice: B i C = { b j S i C, j Infl(b) } b. Compute statements which influence variables referenced in B i C: R i+1 C(n) = R i C(n) R 0 (b,ref(b))(n) c. Compute the slice S i+1 C S i+1 C = S i C B i C 13

14 Example 5 1. begin 2. a = 0 ; 3. i = 0 ; 4. while ( i < n) do 5. begin 6. a = b ; 7. b = i ; 8. i = i + 1 ; 9. end; 10. od; 11.end; Slicing Criterion: (11, {a}) 14

15 Program dependency graph Directed graph of a single procedure in a program Statements are the nodes Data and control dependencies are the edges Control dependency Statements in the branches of if or while statements are control dependent on the control predicate Data dependency Node j is data dependent on node i if x { x Def(i), x Ref(j) } and there exists a path P from i to j without redefining x. 15

16 Minimal slice Definition: Let C be a slicing criterion on a program P. A slice P of P on C is statement-minimal if no other slice of P on C has fewer statements than S. Theorem: There does not exist an algorithm to find statement-minimal slices for arbitrary programs. (Problem equivalent to halting problem) 16

17 17 Example 6 1. begin 2. A = constant; 3. while (K < 10) do 4. begin 5. if (C = 0) then 6. begin 7. B = A; 8. X = 1; 9. end; 10. else 11. begin 12. C = B; 13. Y = 2; 14. end; 15. fi; 16. K = K + 1 ; 17. end; 18. od; 19. Z = X + Y; 20. wr i t e (Z) 21. end; Slicing Criterion: (20, {z})

18 Outline Basics Control flow graphs Slicing Motivation Static slicing with relevant variables table Static slicing with program dependency graphs Summary & Outline 18

19 Types of slices A slice S can be obtained from a program P by deleting zero or more statements from P. S has the same values for the variables in V as P any input I (static slicing) for a given input I (dynamic slicing) 19

20 Slicing Criterion Static slice C = (i, V) with a line number i and a set of variables of interest V Example: C = (5, {x}) Dynamic slice C = (x, I q, V) with program input x, q th element of the trajectory I q and a set of variables of interest V Example: C = ({a = 4}, 5³, {x}) 20

21 Types of slices Backward Computation of statements influencing the value of a variable Forward Computation of statements influenced by a statement 21

22 Types of slices Input constraint Static slice Relevant variables table Program dependency graphs Dynamic slice Relevant slicing Direction Backward slice Forward slice 22

23 Open Problems Function calls call-by-value call-by-reference Other control flow statements goto break continue Composite data types arrays Pointer Interprocess communication 23

24 Questions? 24

Debugging Program Slicing

Debugging Program Slicing Debugging Franz Wotawa Institut für Informationssysteme, Database and Artificial Intelligence Group, Technische Universität Wien Email: wotawa@dbai.tuwien.ac.at 1 What is a Slice? A Slice is a reduced

More information

Slicing. Rupesh Nasre. CS6843 Program Analysis IIT Madras Jan 2016

Slicing. Rupesh Nasre. CS6843 Program Analysis IIT Madras Jan 2016 Slicing Rupesh Nasre. CS6843 Program Analysis IIT Madras Jan 2016 Outline Introduction and applications Application time static dynamic Direction forward backward 2 Definition A slice is a subset of program

More information

Applications. Slicing. Program with Multiple Functionality. Outline. Definition. Program with Single Functionality

Applications. Slicing. Program with Multiple Functionality. Outline. Definition. Program with Single Functionality Applications Program understanding / debugging Program restructuring Program differencing Rupesh Nasre. Test coverage Model checking S6843 Program Analysis IIT Madras Jan 2016 4 Outline Introduction and

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

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

Extract Slice Refactoring. Rani Ettinger, Programming Tools Group, May 19th, 2003

Extract Slice Refactoring. Rani Ettinger, Programming Tools Group, May 19th, 2003 Extract Slice Refactoring Rani Ettinger, Programming Tools Group, May 19th, 2003 Outline Extract Slice Refactoring: Motivation Example Mechanics Correctness issues: Behaviour Preservation Limitations and

More information

Testing Methods: White Box Testing II

Testing Methods: White Box Testing II Testing Methods: White Box Testing II Outline Today we continue our look at white box testing with more code coverage methods, and a data coverage method We ll look at : - code coverage testing - decision

More information

slicing An example of slicing Consider the following example:

slicing An example of slicing Consider the following example: slicing The concept of slicing was introduced over two decades ago. With an initial program behavior (a variable associated with a particular statement), slicing reduces the program to a minimal form which

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

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

Formal Methods. CITS5501 Software Testing and Quality Assurance

Formal Methods. CITS5501 Software Testing and Quality Assurance Formal Methods CITS5501 Software Testing and Quality Assurance Pressman, R. Software Engineering: A Practitioner s Approach. Chapter 28. McGraw-Hill, 2005 The Science of Programming, David Gries, 1981

More information

Flow Propagation Algorithm

Flow Propagation Algorithm SOMA Flow Propagation Algorithm Univ.Prof. Dr. Franz Wotawa, Birgit Hofer Institut für Softwaretechnologie {wotawa, hofer}@ist.tugraz.at Institute for Software Technology Agenda Flow Propagation Algorithm

More information

Program Slicing for Refactoring

Program Slicing for Refactoring Program Slicing for Refactoring Mathieu Verbaere Lady Margaret Hall Oxford University Computing Laboratory September 2003 Abstract A program slice singles out all statements that may have affected the

More information

CS64 Week 5 Lecture 1. Kyle Dewey

CS64 Week 5 Lecture 1. Kyle Dewey CS64 Week 5 Lecture 1 Kyle Dewey Overview More branches in MIPS Memory in MIPS MIPS Calling Convention More Branches in MIPS else_if.asm nested_if.asm nested_else_if.asm Memory in MIPS Accessing Memory

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

Chapter 8. Statement-Level Control Structures

Chapter 8. Statement-Level Control Structures Chapter 8 Statement-Level Control Structures Levels of Control Flow Within expressions Among program units Among program statements Copyright 2012 Addison-Wesley. All rights reserved. 1-2 Control Structure

More information

Data Flow Analysis. Program Analysis

Data Flow Analysis. Program Analysis Program Analysis https://www.cse.iitb.ac.in/~karkare/cs618/ Data Flow Analysis Amey Karkare Dept of Computer Science and Engg IIT Kanpur Visiting IIT Bombay karkare@cse.iitk.ac.in karkare@cse.iitb.ac.in

More information

Shared Variables and Interference

Shared Variables and Interference Illinois Institute of Technology Lecture 24 Shared Variables and Interference CS 536: Science of Programming, Spring 2018 A. Why Parallel programs can coordinate their work using shared variables, but

More information

Topic I (d): Static Single Assignment Form (SSA)

Topic I (d): Static Single Assignment Form (SSA) Topic I (d): Static Single Assignment Form (SSA) 621-10F/Topic-1d-SSA 1 Reading List Slides: Topic Ix Other readings as assigned in class 621-10F/Topic-1d-SSA 2 ABET Outcome Ability to apply knowledge

More information

Iterative Statements. Iterative Statements: Examples. Counter-Controlled Loops. ICOM 4036 Programming Languages Statement-Level Control Structure

Iterative Statements. Iterative Statements: Examples. Counter-Controlled Loops. ICOM 4036 Programming Languages Statement-Level Control Structure ICOM 4036 Programming Languages Statement-Level Control Structure Selection Statement Iterative Statements Unconditional Branching Guarded Commands This lecture covers review questions 8-16 This lecture

More information

Shared Variables and Interference

Shared Variables and Interference Solved Shared Variables and Interference CS 536: Science of Programming, Fall 2018 A. Why Parallel programs can coordinate their work using shared variables, but it s important for threads to not interfere

More information

Decompiling Boolean Expressions from Java TM Bytecode

Decompiling Boolean Expressions from Java TM Bytecode Decompiling Boolean Expressions from Java TM Bytecode Mangala Gowri Nanda (IBM-IRL) and S. Arun-Kumar (IIT Delhi) Introduction The Problem Motivation Generating executable code from program slices. Java

More information

Chapter 8. Statement-Level Control Structures

Chapter 8. Statement-Level Control Structures Chapter 8 Statement-Level Control Structures Chapter 8 Topics Introduction Selection Statements Iterative Statements Unconditional Branching Guarded Commands Conclusions Copyright 2009 Addison-Wesley.

More information

Dataflow-based Coverage Criteria

Dataflow-based Coverage Criteria Dataflow-based Coverage Criteria W. Eric Wong Department of Computer Science The University of Texas at Dallas ewong@utdallas.edu http://www.utdallas.edu/~ewong Dataflow-based Coverage Criteria ( 2012

More information

Data Flow Analysis. Daqing Hou

Data Flow Analysis. Daqing Hou Data Flow Analysis Daqing Hou Outline Basic blocks and control flow graph An example: reaching definitions Characteristics of DFA (Data Flow Analysis) Daqing Hou, Spring 2008 2 Example 100 unsigned int

More information

Program Static Analysis. Overview

Program Static Analysis. Overview Program Static Analysis Overview Program static analysis Abstract interpretation Data flow analysis Intra-procedural Inter-procedural 2 1 What is static analysis? The analysis to understand computer software

More information

Tour of common optimizations

Tour of common optimizations Tour of common optimizations Simple example foo(z) { x := 3 + 6; y := x 5 return z * y } Simple example foo(z) { x := 3 + 6; y := x 5; return z * y } x:=9; Applying Constant Folding Simple example foo(z)

More information

Limitations of Algorithmic Solvability In this Chapter we investigate the power of algorithms to solve problems Some can be solved algorithmically and

Limitations of Algorithmic Solvability In this Chapter we investigate the power of algorithms to solve problems Some can be solved algorithmically and Computer Language Theory Chapter 4: Decidability 1 Limitations of Algorithmic Solvability In this Chapter we investigate the power of algorithms to solve problems Some can be solved algorithmically and

More information

Chapter 8. Statement-Level Control Structures ISBN

Chapter 8. Statement-Level Control Structures ISBN Chapter 8 Statement-Level Control Structures ISBN 0-321-49362-1 Chapter 8 Topics Introduction Selection Statements Iterative Statements Unconditional Branching Guarded Commands Conclusions Copyright 2012

More information

Basic Verification Strategy

Basic Verification Strategy ormal Verification Basic Verification Strategy compare behavior to intent System Model of system behavior intent Verifier results Intent Usually, originates with requirements, refined through design and

More information

The Use of Program Dependence Graphs in Software Engineering

The Use of Program Dependence Graphs in Software Engineering - 1 - ABSTRACT The Use of Program Depence Graphs in Software Engineering This paper describes a language-indepent representation the depence graph and discusses how depence graphs, together with operations

More information

The Use of Program Dependence Graphs in Software Engineering

The Use of Program Dependence Graphs in Software Engineering -1- The Use of Program Depence Graphs in Software Engineering Susan Horwitz and Thomas Reps University of Wisconsin ABSTRACT would arise at p when the is run on some initial state. This paper describes

More information

EECS 470 Midterm Exam Winter 2008 answers

EECS 470 Midterm Exam Winter 2008 answers EECS 470 Midterm Exam Winter 2008 answers Name: KEY unique name: KEY Sign the honor code: I have neither given nor received aid on this exam nor observed anyone else doing so. Scores: #Page Points 2 /10

More information

Informed Search A* Algorithm

Informed Search A* Algorithm Informed Search A* Algorithm CE417: Introduction to Artificial Intelligence Sharif University of Technology Spring 2018 Soleymani Artificial Intelligence: A Modern Approach, Chapter 3 Most slides have

More information

Introduction to Model Checking

Introduction to Model Checking Introduction to Model Checking René Thiemann Institute of Computer Science University of Innsbruck WS 2007/2008 RT (ICS @ UIBK) week 4 1/23 Outline Promela - Syntax and Intuitive Meaning Promela - Formal

More information

Data Flow Analysis. Agenda CS738: Advanced Compiler Optimizations. 3-address Code Format. Assumptions

Data Flow Analysis. Agenda CS738: Advanced Compiler Optimizations. 3-address Code Format. Assumptions Agenda CS738: Advanced Compiler Optimizations Data Flow Analysis Amey Karkare karkare@cse.iitk.ac.in http://www.cse.iitk.ac.in/~karkare/cs738 Department of CSE, IIT Kanpur Static analysis and compile-time

More information

Lab 3 (Sections 300, 301 and 302) Prelab: MIPS-Control Instructions

Lab 3 (Sections 300, 301 and 302) Prelab: MIPS-Control Instructions Lab 3 (Sections 300, 301 and 302) Prelab: MIPS-Control Instructions Name: Sign the following statement: On my honor, as an Aggie, I have neither given nor received unauthorized aid on this academic work

More information

Multiway searching. In the worst case of searching a complete binary search tree, we can make log(n) page faults Everyone knows what a page fault is?

Multiway searching. In the worst case of searching a complete binary search tree, we can make log(n) page faults Everyone knows what a page fault is? Multiway searching What do we do if the volume of data to be searched is too large to fit into main memory Search tree is stored on disk pages, and the pages required as comparisons proceed may not be

More information

Week 4 Selection Structures. UniMAP Sem II-11/12 DKT121 Basic Computer Programming 1

Week 4 Selection Structures. UniMAP Sem II-11/12 DKT121 Basic Computer Programming 1 Week 4 Selection Structures UniMAP Sem II-11/12 DKT121 Basic Computer Programming 1 Outline Recall selection control structure Types of selection One-way selection Two-way selection Multi-selection Compound

More information

Understanding Data Dependences in the Presence of Pointers

Understanding Data Dependences in the Presence of Pointers Technical Report GIT-CERCS-03-10 Understanding Data Dependences in the Presence of Pointers Alessandro Orso, Saurabh Sinha, and Mary Jean Harrold College of Computing, Georgia Institute of Technology 801

More information

Locating Faults Through Automated Predicate Switching

Locating Faults Through Automated Predicate Switching Locating Faults Through Automated Predicate Switching Authored by Xiangyu Zhang, Neelam Gupta, Rajiv Gupta The University of Arizona ICSE 2006 Presented by Jing Pu Authors 1 Neelam Gupta The University

More information

PROCEDURAL DATABASE PROGRAMMING ( PL/SQL AND T-SQL)

PROCEDURAL DATABASE PROGRAMMING ( PL/SQL AND T-SQL) Technology & Information Management Instructor: Michael Kremer, Ph.D. Class 3 Database Programming PROCEDURAL DATABASE PROGRAMMING ( PL/SQL AND T-SQL) AGENDA 3. Declaring Variables/Constants 4. Flow Control

More information

B.V. Patel Institute of Business Management, Computer & Information Technology, Uka Tarsadia University

B.V. Patel Institute of Business Management, Computer & Information Technology, Uka Tarsadia University Unit 1 Programming Language and Overview of C 1. State whether the following statements are true or false. a. Every line in a C program should end with a semicolon. b. In C language lowercase letters are

More information

In this chapter you ll learn:

In this chapter you ll learn: Much that I bound, I could not free; Much that I freed returned to me. Lee Wilson Dodd Will you walk a little faster? said a whiting to a snail, There s a porpoise close behind us, and he s treading on

More information

Chapter 8. Statement-Level Control Structures

Chapter 8. Statement-Level Control Structures Chapter 8 Statement-Level Control Structures Chapter 8 Topics Introduction Selection Statements Iterative Statements Unconditional Branching Guarded Commands Conclusions 1-2 Levels of Control Flow Within

More information

The IA-64 Architecture. Salient Points

The IA-64 Architecture. Salient Points The IA-64 Architecture Department of Electrical Engineering at College Park OUTLINE: Architecture overview Background Architecture Specifics UNIVERSITY OF MARYLAND AT COLLEGE PARK Salient Points 128 Registers

More information

19 Much that I bound, I could not free; Much that I freed returned to me. Lee Wilson Dodd

19 Much that I bound, I could not free; Much that I freed returned to me. Lee Wilson Dodd 19 Much that I bound, I could not free; Much that I freed returned to me. Lee Wilson Dodd Will you walk a little faster? said a whiting to a snail, There s a porpoise close behind us, and he s treading

More information

Lab 3 (All Sections) Prelab: MIPS-Control Instructions

Lab 3 (All Sections) Prelab: MIPS-Control Instructions Lab 3 (All Sections) Prelab: MIPS-Control Instructions Name: Sign the following statement: On my honor, as an Aggie, I have neither given nor received unauthorized aid on this academic work 1 Objective

More information

Statement level control structures

Statement level control structures 1 Statement level control structures CS 315 Programming Languages Pinar Duygulu Bilkent University Control Statements: Evolution 2 FORTRAN I control statements were based directly on IBM 704 hardware Much

More information

Special Section: Building Your Own Compiler

Special Section: Building Your Own Compiler cshtp6_19_datastructures_compiler.fm Page 1 Tuesday, February 14, 2017 10:31 AM 1 Chapter 19 Special Section: Building Your Own Compiler In Exercises8.31 8.33, we introduced Simpletron Machine Language

More information

Operating System Control Structures

Operating System Control Structures Operating System Control Structures Information about the current status of each process and resource Tables are constructed for each entity the operating system manages 26 Memory Tables Allocation of

More information

COP5621 Exam 4 - Spring 2005

COP5621 Exam 4 - Spring 2005 COP5621 Exam 4 - Spring 2005 Name: (Please print) Put the answers on these sheets. Use additional sheets when necessary. Show how you derived your answer when applicable (this is required for full credit

More information

DICOM Correction Item

DICOM Correction Item DICOM Correction Item Correction Number CP-567 Log Summary: Type of Modification Clarification Name of Standard PS 3.3 2004 Rationale for Correction The order of signficance of dimension indices (i.e.,which

More information

Outline. Introduction SDV Motivation Model vs Real Implementation SLIC SDVRP SLAM-2 Comparisons Conclusions

Outline. Introduction SDV Motivation Model vs Real Implementation SLIC SDVRP SLAM-2 Comparisons Conclusions Outline Introduction SDV Motivation Model vs Real Implementation SIC SDVRP SAM-2 Comparisons Conclusions SDV Research Platform Academic release of SDV (Static Driver Verifier), based on the code that ships

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

Dataflow Analysis. Xiaokang Qiu Purdue University. October 17, 2018 ECE 468

Dataflow Analysis. Xiaokang Qiu Purdue University. October 17, 2018 ECE 468 Dataflow Analysis Xiaokang Qiu Purdue University ECE 468 October 17, 2018 Program optimizations So far we have talked about different kinds of optimizations Peephole optimizations Local common sub-expression

More information

Outline. Best-first search

Outline. Best-first search Outline Best-first search Greedy best-first search A* search Heuristics Admissible Heuristics Graph Search Consistent Heuristics Local search algorithms Hill-climbing search Beam search Simulated annealing

More information

High-Level Small-Step Operational Semantics for Software Transactions

High-Level Small-Step Operational Semantics for Software Transactions High-Level Small-Step Operational Semantics for Software Transactions Katherine F. Moore Dan Grossman The University of Washington Motivating Our Approach Operational Semantics Model key programming-language

More information

Principles of Programming Languages

Principles of Programming Languages Principles of Programming Languages Lecture 08 Control Semantics & Continuations Semantics of Control Flow Sequencers: commands that cause control transfers:! goto! return! exit! break! continue! resultis

More information

Forward Assignment; Strongest Postconditions

Forward Assignment; Strongest Postconditions 3/1 new version Forward Assignment; Strongest Postconditions CS 536: Science of Programming, Spring 2018 A. Why? At times, a forward version of the assignment rule is more appropriate than the backward

More information

Week - 04 Lecture - 01 Merge Sort. (Refer Slide Time: 00:02)

Week - 04 Lecture - 01 Merge Sort. (Refer Slide Time: 00:02) Programming, Data Structures and Algorithms in Python Prof. Madhavan Mukund Department of Computer Science and Engineering Indian Institute of Technology, Madras Week - 04 Lecture - 01 Merge Sort (Refer

More information

INTRODUCTION TO HEURISTIC SEARCH

INTRODUCTION TO HEURISTIC SEARCH INTRODUCTION TO HEURISTIC SEARCH What is heuristic search? Given a problem in which we must make a series of decisions, determine the sequence of decisions which provably optimizes some criterion. What

More information

On Formal Analysis of OO Languages using. OO Languages and Rewriting Logic: Designing for Performance

On Formal Analysis of OO Languages using. OO Languages and Rewriting Logic: Designing for Performance On Formal Analysis of OO Languages using Rewriting Logic: Designing for Performance {mhills, grosu}@cs.uiuc.edu Department of Computer Science University of Illinois at Urbana-Champaign 6 June 2007 1 2

More information

ACLT: Algebra, Categories, Logic in Topology - Grothendieck's generalized topological spaces (toposes)

ACLT: Algebra, Categories, Logic in Topology - Grothendieck's generalized topological spaces (toposes) ACLT: Algebra, Categories, Logic in Topology - Grothendieck's generalized topological spaces (toposes) Steve Vickers CS Theory Group Birmingham 4. Toposes and geometric reasoning How to "do generalized

More information

UNIT 3

UNIT 3 UNIT 3 Presentation Outline Sequence control with expressions Conditional Statements, Loops Exception Handling Subprogram definition and activation Simple and Recursive Subprogram Subprogram Environment

More information

Copyright 2008 CS655 System Modeling and Analysis. Korea Advanced Institute of Science and Technology

Copyright 2008 CS655 System Modeling and Analysis. Korea Advanced Institute of Science and Technology The Spin Model Checker : Part I Copyright 2008 CS655 System Korea Advanced Institute of Science and Technology System Spec. In Promela Req. Spec. In LTL Overview of the Spin Architecture Spin Model pan.c

More information

C Programming Decision Making

C Programming Decision Making 1 P a ge C Programming, Decision Making C Programming Decision Making Introduction to Decision Making OR Control Statement OR Branching Statement: - We know that the execution of program is done instruction

More information

Software Engineering

Software Engineering Software Engineering Lecture 12: Testing and Debugging Debugging Peter Thiemann University of Freiburg, Germany 13.06.2013 Today s Topic Last Lecture Bug tracking Program control Design for Debugging Input

More information

6. Control Statements II

6. Control Statements II Visibility Declaration in a block is not visible outside of the block. 6. Control Statements II Visibility, Local Variables, While Statement, Do Statement, Jump Statements main block int main () int i

More information

Extending C Global Surveyor

Extending C Global Surveyor Extending C Global Surveyor Silvia Breu NASA Ames Research Center/MCT silviabreu@gmailcom Abstract This paper describes an extension of C Global Surveyor (CGS), a static program analysis tool developed

More information

Guarded Commands, Nondeterminancy and Formal Derivation of Programs. Edsger W. Dijkstra. CACM 18, 8 pp (Aug. 1975).

Guarded Commands, Nondeterminancy and Formal Derivation of Programs. Edsger W. Dijkstra. CACM 18, 8 pp (Aug. 1975). CS322 E. W. Dijkstra, Guarded command, Nondeterminancy and Formal Derivation of Programs 1 Guarded Commands, Nondeterminancy and Formal Derivation of Programs Edsger W. Dijkstra CACM 18, 8 pp. 453-457

More information

Algorithms (III) Yijia Chen Shanghai Jiaotong University

Algorithms (III) Yijia Chen Shanghai Jiaotong University Algorithms (III) Yijia Chen Shanghai Jiaotong University Review of the Previous Lecture Factoring: Given a number N, express it as a product of its prime factors. Many security protocols are based on the

More information

4/24/18. Overview. Program Static Analysis. Has anyone done static analysis? What is static analysis? Why static analysis?

4/24/18. Overview. Program Static Analysis. Has anyone done static analysis? What is static analysis? Why static analysis? Overview Program Static Analysis Program static analysis Abstract interpretation Static analysis techniques 2 What is static analysis? The analysis to understand computer software without executing programs

More information

Programming Fundamentals

Programming Fundamentals Programming Fundamentals Computers are really very dumb machines -- they only do what they are told to do. Most computers perform their operations on a very primitive level. The basic operations of a computer

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

SCoLang - Language Reference Manual

SCoLang - Language Reference Manual SCoLang - Language Reference Manual Table of Contents: 1. Introduction 2. Types a. Basic Data types b. Advanced Data types 3. Lexical Convention a. Identifiers b. Keywords c. Comments d. Operators e. Punctuators

More information

Chapter 3. Algorithms for Query Processing and Optimization

Chapter 3. Algorithms for Query Processing and Optimization Chapter 3 Algorithms for Query Processing and Optimization Chapter Outline 1. Introduction to Query Processing 2. Translating SQL Queries into Relational Algebra 3. Algorithms for External Sorting 4. Algorithms

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

Midterm II CS164, Spring 2006

Midterm II CS164, Spring 2006 Midterm II CS164, Spring 2006 April 11, 2006 Please read all instructions (including these) carefully. Write your name, login, SID, and circle the section time. There are 10 pages in this exam and 4 questions,

More information

6. Operatoren. 7. Safe Programming: Assertions. Table of Operators. Table of Operators - Explanations. Tabular overview of all relevant operators

6. Operatoren. 7. Safe Programming: Assertions. Table of Operators. Table of Operators - Explanations. Tabular overview of all relevant operators 6. Operatoren Tabular overview of all relevant operators 180 Table of Operators Description Operator Arity Precedence Associativity Object member access. 2 16 left Array access [ ] 2 16 left Method invocation

More information

Deriving a Slicing Algorithm via FermaT Transformations

Deriving a Slicing Algorithm via FermaT Transformations Deriving a Slicing Algorithm via FermaT Transformations M. P. Ward and H. Zedan Software Technology Research Lab De Montfort University The Gateway, Leicester LE1 9BH, UK martin@gkc.org.uk and zedan@dmu.ac.uk

More information

Compiling Techniques

Compiling Techniques Lecture 12: Code Shapes (EaC Chapter 7) 17 November 2015 Coursework Demo: Friday 4th of December In order to comply with the school regulations, you will have to give a demonstration of your compiler.

More information

Well-defined coverage metrics for the glass box test

Well-defined coverage metrics for the glass box test Well-defined coverage metrics for the glass box test Rainer Schmidberger rainer.schmidberger@informatik.uni-stuttgart.de ISTE (Institute for Software Technology), University of Stuttgart se Well-defined

More information

Name :. Roll No. :... Invigilator s Signature : INTRODUCTION TO PROGRAMMING. Time Allotted : 3 Hours Full Marks : 70

Name :. Roll No. :... Invigilator s Signature : INTRODUCTION TO PROGRAMMING. Time Allotted : 3 Hours Full Marks : 70 Name :. Roll No. :..... Invigilator s Signature :.. 2011 INTRODUCTION TO PROGRAMMING Time Allotted : 3 Hours Full Marks : 70 The figures in the margin indicate full marks. Candidates are required to give

More information

Computing with Infinitely Many Processes under assumptions on concurrency and participation -M.Merritt&G.Taubenfeld. Dean Christakos & Deva Seetharam

Computing with Infinitely Many Processes under assumptions on concurrency and participation -M.Merritt&G.Taubenfeld. Dean Christakos & Deva Seetharam Computing with Infinitely Many Processes under assumptions on concurrency and participation -M.Merritt&G.Taubenfeld Dean Christakos & Deva Seetharam November 25, 2003 Abstract This paper explores four

More information

EE 121. Office suite. Lecture 3: Introduction to programming and C programming language

EE 121. Office suite. Lecture 3: Introduction to programming and C programming language M Hamed BOUGARA university Institute of Electrical and Electronic Engineering (IGEE) EE 121. Office suite Lecture 3: Introduction to programming and C programming language Dr. F. Kerouh Electronics Department

More information

Tool demonstration: Spin

Tool demonstration: Spin Tool demonstration: Spin 1 Spin Spin is a model checker which implements the LTL model-checking procedure described previously (and much more besides). Developed by Gerard Holzmann of Bell Labs Has won

More information

Decision Procedures in First Order Logic

Decision Procedures in First Order Logic in First Order Logic for Equality Logic Daniel Kroening and Ofer Strichman 1 Outline Introduction Definition, complexity Reducing Uninterpreted Functions to Equality Logic Using Uninterpreted Functions

More information

Outline. Best-first search

Outline. Best-first search Outline Best-first search Greedy best-first search A* search Heuristics Local search algorithms Hill-climbing search Beam search Simulated annealing search Genetic algorithms Constraint Satisfaction Problems

More information

Regression Test Selection for C++ Software

Regression Test Selection for C++ Software Technical Report 99-60-01, Computer Science Department, Oregon State University, January 1999 Regression Test Selection for C++ Authors: Gregg Rothermel Mary Jean Harrold Jeinay Dedhia Software Sanjay

More information

Lectures 20, 21: Axiomatic Semantics

Lectures 20, 21: Axiomatic Semantics Lectures 20, 21: Axiomatic Semantics Polyvios Pratikakis Computer Science Department, University of Crete Type Systems and Static Analysis Based on slides by George Necula Pratikakis (CSD) Axiomatic Semantics

More information

Testing, code coverage and static analysis. COSC345 Software Engineering

Testing, code coverage and static analysis. COSC345 Software Engineering Testing, code coverage and static analysis COSC345 Software Engineering Outline Various testing processes ad hoc / formal / automatic Unit tests and test driven development Code coverage metrics Integration

More information

Control Structures. Outline. In Text: Chapter 8. Control structures Selection. Iteration. Gotos Guarded statements. One-way Two-way Multi-way

Control Structures. Outline. In Text: Chapter 8. Control structures Selection. Iteration. Gotos Guarded statements. One-way Two-way Multi-way Control Structures In Text: Chapter 8 1 Control structures Selection One-way Two-way Multi-way Iteration Counter-controlled Logically-controlled Gotos Guarded statements Outline Chapter 8: Control Structures

More information

Introduction to Optimization Local Value Numbering

Introduction to Optimization Local Value Numbering COMP 506 Rice University Spring 2018 Introduction to Optimization Local Value Numbering source IR IR target code Front End Optimizer Back End code Copyright 2018, Keith D. Cooper & Linda Torczon, all rights

More information

Algorithms (III) Yu Yu. Shanghai Jiaotong University

Algorithms (III) Yu Yu. Shanghai Jiaotong University Algorithms (III) Yu Yu Shanghai Jiaotong University Review of the Previous Lecture Factoring: Given a number N, express it as a product of its prime factors. Many security protocols are based on the assumed

More information

Code generation for modern processors

Code generation for modern processors Code generation for modern processors Definitions (1 of 2) What are the dominant performance issues for a superscalar RISC processor? Refs: AS&U, Chapter 9 + Notes. Optional: Muchnick, 16.3 & 17.1 Instruction

More information

Code generation for modern processors

Code generation for modern processors Code generation for modern processors What are the dominant performance issues for a superscalar RISC processor? Refs: AS&U, Chapter 9 + Notes. Optional: Muchnick, 16.3 & 17.1 Strategy il il il il asm

More information

Computer Programming: C++

Computer Programming: C++ The Islamic University of Gaza Engineering Faculty Department of Computer Engineering Fall 2017 ECOM 2003 Muath i.alnabris Computer Programming: C++ Experiment #4 Loops Part II Contents Loop Control Statement

More information

DECISION CONTROL AND LOOPING STATEMENTS

DECISION CONTROL AND LOOPING STATEMENTS DECISION CONTROL AND LOOPING STATEMENTS DECISION CONTROL STATEMENTS Decision control statements are used to alter the flow of a sequence of instructions. These statements help to jump from one part of

More information

Software Model Checking. Xiangyu Zhang

Software Model Checking. Xiangyu Zhang Software Model Checking Xiangyu Zhang Symbolic Software Model Checking CS510 S o f t w a r e E n g i n e e r i n g Symbolic analysis explicitly explores individual paths, encodes and resolves path conditions

More information