Compiler Design Spring 2017
|
|
- Shannon Todd Craig
- 5 years ago
- Views:
Transcription
1 Compiler Design Spring Reaching definitions Dr. Zoltán Majó Compiler Group Java HotSpot Virtual Machine Oracle Corporation
2 Admin issues Brief reminder: Code review takes place 15:15 You ve received room information by 33
3 Last lecture: Definition (of reaching definitions) A definition d reaches a point P if there is a path from d to P such that d is not killed along that path. Remember: There are arbitrarily many paths Not feasible to reason / process all of them Reason about claims at program points instead Example claim: D=={d 1, d 2, d 5 P before_s D is the set of definitions that reaches P before_s How do we define a appropriate transfer function? 34
4 Transfer function d 1 : var = d 1 reaches the end of the basic block if there is no statement following d 1 that might kill d 1 Define for basic block B kill B = { d d is killed in B } gen B ={ d d appears in B and no subsequent statement in B kills d } 35
5 a: {d 1, d 2, d 3, d 5 } b: {d 4 } c: {d 6 } gen = {d 2 } kill = {d 1, d 2, d 3, d 5 } d 1 : a = b + 1 d 2 : a = if (Tcond) gen = {d 3 } kill = {d 1, d 2, d 5 } d 3 : a = d 4 : b = gen = {d 4 } kill = P gen = {d 5, d 6 } kill = {d 1, d 2, d 3 } d 5 : a = d 6 : c = 40
6 Running example i: {d 1, d 4, d 7 } j: {d 2, d 5 } a: {d 3, d 6 } gen = {d 1, d 2, d 3 } kill = {d 4, d 5, d 6, d 7 } gen = {d 4, d 5 } kill = {d 1, d 2, d 7 } ENTRY d 1 : i = m 1 d 2 : j = n d 3 : a = d 4 : i = i + 1 d 5 : j = j - 1 gen = {d 6 } kill = {d 3 } d 6 : a = gen = {d 7 } kill = {d 1, d 4 } d 7 : i = From Aho et al Compilers, p 604 EXIT 43
7 Transfer function d 1 : var = So far: Effect of a basic block in isolation kill B = { d d is killed in B } gen B ={ d d appears in B and no subsequent statement in B kills d } (Local analysis) How do we extend transfer functions to definitions that reach P before_b and P after_b 44
8 Transfer function IN(B) = {d 1, d 2,, d n } d : var = For a basic block B we define IN(B) = { d d reaches P before_b } OUT(B) = { d d reaches P after_b } d OUT(B) OUT(B) = {d 1, d 2,, d m } d is in B and reaches the end of B, i.e. d gen B d IN(B) and d not killed by statements in B, i.e. d kill B OUT(B) = gen B (IN(B) kill B ) 45
9 Transfer function... B1 B2 B3 Given OUT(B1). What should be IN(B2) and IN(B3)? IN(B2) = OUT(B1), IN(B3) = OUT(B1) 46
10 47
11 Transfer function B2 B3... B1 Given OUT(B2) and OUT(B3) What should be IN(B1)? A definition d reaches a point P if there is a path from d to P such that d is not killed along that path. Must consider all paths leading to P 48
12 49
13 Transfer function B2 B3... B1 Given OUT(B i ) IN(B) = B i, Bi is predecessor of B in CFG OUT(B i ) 50
14 We have the ingredients (again) Control flow (basic blocks, CGF), points, paths Same as for constant propagation in previous lecture Transfer function Specific for reaching definitions How does the analysis work? 51
15 Simplifications in examples Do not show points before/after basic block Omit conditional test Evaluation of condition If statement Capture control transfers through edges No explicit jump or branch statements 52
16 i: {d 1, d 4, d 7 } j: {d 2, d 5 } a: {d 3, d 6 } gen = {d 1, d 2, d 3 } kill = {d 4, d 5, d 6, d 7 } ENTRY d 1 : i = m 1 d 2 : j = n d 3 : a = IN(B1) =? OUT(B1) =? gen = {d 4, d 5 } kill = {d 1, d 2, d 7 } d 4 : i = i + 1 d 5 : j = j - 1 IN(B2) =? OUT(B2) =? gen = {d 6 } kill = {d 3 } d 6 : a = IN(B3) =? OUT(B3) =? gen = {d 7 } kill = {d 1, d 4 } d 7 : i = IN(B4) =? OUT(B4) =? From Aho et al Compilers, p 604 EXIT 53
17 Finding IN(B) and OUT(B) gen and kill capture what happens inside a basic block Or the effect of each statement We need IN and OUT for each basic block IN(B) = Bi, Bi is predecessor of B in CFG OUT(Bi) OUT(B) = gen B (IN(B) kill B ) N basic blocks, 2 N sets IN / OUT 54
18 Finding IN(B) and OUT(B) (cont d) System with 2 N unknowns Solve by iterating until a fixed point is found How to start iteration? Safe assumption OUT[ENTRY] = 55
19 Finding reaching definitions OUT[ENTRY] = Initialize OUT[B] = for B ENTRY while (changes to any OUT(B)) { for (each basic block B ENTRY) { IN(B) = B i, Bi is predecessor of B in CFG OUT(B i ) OUT(B) = gen B (IN(B) kill B ) } } 56
20 Finding reaching definitions OUT[ENTRY] = Initialize OUT[B] = for B ENTRY while (changes to any OUT(B)) { for (each basic block B ENTRY) { IN(B) = B i, Bi is predecessor of B in CFG OUT(B i ) OUT(B) = gen B (IN(B) kill B ) } } 57
21 59
22 Initialize OUT[B] = while (changes to any OUT(B)) { for (each basic block B ENTRY) { IN(B) = B i, Bi is predecessor of B in CFG OUT(B i ) OUT(B) = gen B (IN(B) kill B ) } gen = {d 1, d 2, d 3 } kill = {d 4, d 5, d 6, d 7 } ENTRY d 1 : i = m 1 d 2 : j = n d 3 : a = IN(B1) OUT(B1) {d1,d2,d3} gen = {d 4, d 5 } kill = {d 1, d 2, d 7 } d 4 : i = i + 1 d 5 : j = j - 1 IN(B2) OUT(B2) {d1,d2,d3,d5,d6,d7} {d3,d4,d5,d6} gen = {d 6 } kill = {d 3 } d 6 : a = IN(B3) OUT(B3) {d3,d4,d5,d6} {d4,d5,d6} gen = {d 7 } kill = {d 1, d 4 } d 7 : i = IN(B4) OUT(B4) {d3,d4,d5,d6} {d3,d5,d6,d7} EXIT 60
23 Comments Solution not unique Could always use OUT(B) = all definitions Not really useful Iterative algorithm finds least fixed point Order of visiting basic blocks matters For speed of iteration, not for the result Iteration terminates Finite number of basic blocks, finite number of definitions IN and OUT can only grow 61
24 Why? void foo(int x) { } int a, b, c; a = x + 1; b = a; if ( ) { } else { } c = b + 1; return c; // no a, b d 1 : a = x + 1 d 2 : b = a if (Tcond) d 3 : c = b + 1 return c // no a, b IN = {d 1,d 2 } 62
25 Why? void foo(int x) { } int a, b, c; a = x + 1; b = a; if ( ) { } else { } c = b + 1; return c; // no a, b d 1 : a = x + 1 d 2 : b = a if (Tcond) d 3 : c = a + 1 return c // no a, b IN = {d 1,d 2 } 63
26 Comments Change appears to be minor but it is not d 2 can be removed (if there is no other use of b see next topic) Value of variable a can be picked up from register There are other reasons for the compiler to compute reaching definitions 64
27 Food for thought void foo(int x) { } int a, b, c; a = x + 1; if ( ) { b = x; } else { } c = b + 1; return c; // no a, b d 1 : a = x + 1 if (Tcond) d 2 : b = x IN = {d 1,d 2 } d3: c = b + 1 return c 65
28 66
29 Food for thought d 1 : a = x + 1 if (Tcond1) // no a, b d 2 : b = x d 3 : a = y + 1 if (Tcond2) d 5 : c = a + 1 return c IN = {d 3,d 2 } // no a, b d 4 : c = b
30 Program is broken As far as we can tell, d 4 may read an undefined value of b Maybe not cannot decide in general Could we use reaching definitions to identify such trouble spots Back to the use of flow analysis for program checking 68
31 Uninitialized variables Reaching definitions: set of definitions that reach start of a basic block Idea: insert fake definitions into the ENTRY node One for each variable fake means there is no correspondence in the source program Identify by tag, number, (here number > 100) Start iteration with OUT(ENTRY) = set of fake definitions If a fake definition d that sets destination dest reaches a block B, and there is a use of dest in B prior to any definition of dest in B, then dest is potentially uninitialized Compiler can (in general) only issue warning, cannot be sure variable is uninitialized 69
32 Uninitialized variables d 100 : a = d 101 : b = d 102 : c = ENTRY IN: {d 1, d 101, d 102 } IN: {d 3,d 2, d 101, d 102 } IN: {d 100, d 101, d 102 } IN: {d 1,d 2, d 101, d 102 } // no a, b d 1 : a = x + 1 if (Tcond1) d3: a = y + 1 if (Tcond2) d2: b = x IN: {d 1,d 101,d 102 } IN: {d 3,d 2,d 101, d 102 } // no a, b d4: c = b + 1 IN: {d 3,d 2,d 4,d 101, d 102 } x or y are global or parameters so we do not need a fake definition d5: c = a + 1 return c EXIT 70
33 71
34 Uninitialized variables d 100 : a = d 101 : b = ENTRY // no a or b if (Tcond1) d 1 : a = x + 1 d 2 : b = x + 2 IN: {d 1,d 2, d 101, d 100 } x or y are global or parameters so we do not need a fake definition d 3 : x = a + 1 d 4 : b = y + 1 d 5 : y = b + 1
35 73
36 Uninitialized variables ENTRY d 100 : a = // no a or b if (Tcond1) d 1 : a = x + 1 d 2 : a = x + 2 IN: {d 1,d 2 } d 3 : a = a + 1 return a x is a global or parameter so we do not need a fake definition
37 75
38 Program analysis Compiler needs information Specific problem Devise flow analysis to compute information Let compiler use information to deal with specific problem 76
Compiler Design Spring 2017
Compiler Design Spring 2017 8.6 Live variables Dr. Zoltán Majó Compiler Group Java HotSpot Virtual Machine Oracle Corporation Last lecture Definition: A variable V is live at point P if there is a path
More information: Compiler Design. 9.5 Live variables 9.6 Available expressions. Thomas R. Gross. Computer Science Department ETH Zurich, Switzerland
252-210: Compiler Design 9.5 Live variables 9.6 Available expressions Thomas R. Gross Computer Science Department ETH Zurich, Switzerland Outline Warp up reaching definifons Live variables Available expressions
More informationLecture 5 Introduction to Data Flow Analysis
Lecture 5 Introduction to Data Flow Analysis I. Structure of data flow analysis II. III. IV. Example 1: Reaching definition analysis Example 2: Liveness analysis Framework Phillip B. Gibbons 15-745: Intro
More informationDataflow Analysis. A sample program int fib10(void) { int n = 10; int older = 0; int old = 1; Simple Constant Propagation
-74 Lecture 2 Dataflow Analysis Basic Blocks Related Optimizations SSA Copyright Seth Copen Goldstein 200-8 Dataflow Analysis Last time we looked at code transformations Constant propagation Copy propagation
More informationLecture 4 Introduc-on to Data Flow Analysis
Lecture 4 Introduc-on to Data Flow Analysis I. Structure of data flow analysis II. Example 1: Reaching defini?on analysis III. Example 2: Liveness analysis IV. Generaliza?on 15-745: Intro to Data Flow
More informationTopic-I-C Dataflow Analysis
Topic-I-C Dataflow Analysis 2012/3/2 \course\cpeg421-08s\topic4-a.ppt 1 Global Dataflow Analysis Motivation We need to know variable def and use information between basic blocks for: constant folding dead-code
More informationCMSC 631 Program Analysis and Understanding. Spring Data Flow Analysis
CMSC 631 Program Analysis and Understanding Spring 2013 Data Flow Analysis Data Flow Analysis A framework for proving facts about programs Reasons about lots of little facts Little or no interaction between
More information3/11/18. Final Code Generation and Code Optimization
Final Code Generation and Code Optimization 1 2 3 for ( i=0; i < N; i++) { base = &a[0]; crt = *(base + i); } original code base = &a[0]; for ( i=0; i < N; i++) { crt = *(base + i); } optimized code e1
More information: Compiler Design
252-210: Compiler Design 9.2 Points and paths 9.3 Transfer func6ons Thomas R. Gross Computer Science Department ETH Zurich, Switzerland Outline Points Paths Transfer funceons 2 Terminology Local {analysis
More informationDataflow Analysis Lecture 2. Simple Constant Propagation. A sample program int fib10(void) {
-4 Lecture Dataflow Analysis Basic Blocks Related Optimizations Copyright Seth Copen Goldstein 00 Dataflow Analysis Last time we looked at code transformations Constant propagation Copy propagation Common
More informationCSC D70: Compiler Optimization Dataflow-2 and Loops
CSC D70: Compiler Optimization Dataflow-2 and Loops Prof. Gennady Pekhimenko University of Toronto Winter 2018 The content of this lecture is adapted from the lectures of Todd Mowry and Phillip Gibbons
More informationData Flow Analysis (I)
Compiler Design Data Flow Analysis (I) Hwansoo Han Control Flow Graph What is CFG? Represents program structure for internal use of compilers Used in various program analyses Generated from AST or a sequential
More informationAdventures in Dataflow Analysis
Adventures in Dataflow Analysis CSE 401 Section 9-ish Jack Eggleston, Aaron Johnston, & Nate Yazdani Announcements - Code Generation due Announcements - Code Generation due - Compiler Additions due next
More informationCompiler Design Spring 2017
Compiler Design Spring 2017 3.4 Bottom-up parsing Dr. Zoltán Majó Compiler Group Java HotSpot Virtual Machine Oracle Corporation 1 Bottom up parsing Goal: Obtain rightmost derivation in reverse w S Reduce
More informationDataflow Analysis. Chapter 9, Section 9.2, 9.3, 9.4
Dataflow Analysis Chapter 9, Section 9.2, 9.3, 9.4 2 Dataflow Analysis Dataflow analysis is a sub area of static program analysis Used in the compiler back end for optimizations of three address code and
More information(b). Identify all basic blocks in your three address code. B1: 1; B2: 2; B3: 3,4,5,6; B4: 7,8,9; B5: 10; B6: 11; B7: 12,13,14; B8: 15;
(a). Translate the program into three address code as defined in Section 6.2, dragon book. (1) i := 2 (2) if i > n goto (7) (3) a[i] := TRUE (4) t2 := i+1 (5) i := t2 (6) goto (2) (7) count := 0 (8) s
More informationCompiler Design. Data Flow Analysis. Hwansoo Han
Compiler Design Data Flow Analysis Hwansoo Han Control Flow Graph What is CFG? Represents program structure for internal use of compilers Used in various program analyses Generated from AST or a sequential
More informationCSC D70: Compiler Optimization Static Single Assignment (SSA)
CSC D70: Compiler Optimization Static Single Assignment (SSA) Prof. Gennady Pekhimenko University of Toronto Winter 08 The content of this lecture is adapted from the lectures of Todd Mowry and Phillip
More informationCOSE312: Compilers. Lecture 17 Intermediate Representation (2)
COSE312: Compilers Lecture 17 Intermediate Representation (2) Hakjoo Oh 2017 Spring Hakjoo Oh COSE312 2017 Spring, Lecture 17 May 31, 2017 1 / 19 Common Intermediate Representations Three-address code
More informationData flow analysis. DataFlow analysis
Data flow analysis DataFlow analysis compile time reasoning about the runtime flow of values in the program represent facts about runtime behavior represent effect of executing each basic block propagate
More informationDataflow Analysis. Dragon book, Chapter 9, Section 9.2, 9.3, 9.4
Dataflow Analysis Dragon book, Chapter 9, Section 9.2, 9.3, 9.4 2 Dataflow Analysis Dataflow analysis is a sub-area of static program analysis Used in the compiler back end for optimizations of three-address
More informationData-Flow Analysis. Compiler Design CSE 504. Preliminaries
Data-Flow Analysis Compiler Design CSE 504 1 Preliminaries 2 Live Variables 3 Data Flow Equations 4 Other Analyses Last modifled: Thu May 02 2013 at 09:01:11 EDT Version: 1.3 15:28:44 2015/01/25 Compiled
More informationWe define a dataflow framework. A dataflow framework consists of:
So far been talking about various dataflow problems (e.g. reaching definitions, live variable analysis) in very informal terms. Now we will discuss a more fundamental approach to handle many of the dataflow
More informationGeneralizing Data-flow Analysis
Generalizing Data-flow Analysis Announcements PA1 grades have been posted Today Other types of data-flow analysis Reaching definitions, available expressions, reaching constants Abstracting data-flow analysis
More informationWorst-Case Execution Time Analysis. LS 12, TU Dortmund
Worst-Case Execution Time Analysis Prof. Dr. Jian-Jia Chen LS 12, TU Dortmund 02, 03 May 2016 Prof. Dr. Jian-Jia Chen (LS 12, TU Dortmund) 1 / 53 Most Essential Assumptions for Real-Time Systems Upper
More informationLecture Notes: The Halting Problem; Reductions
Lecture Notes: The Halting Problem; Reductions COMS W3261 Columbia University 20 Mar 2012 1 Review Key point. Turing machines can be encoded as strings, and other Turing machines can read those strings
More informationEDA045F: Program Analysis LECTURE 10: TYPES 1. Christoph Reichenbach
EDA045F: Program Analysis LECTURE 10: TYPES 1 Christoph Reichenbach In the last lecture... Performance Counters Challenges in Dynamic Performance Analysis Taint Analysis Binary Instrumentation 2 / 44 Types
More informationData Flow Analysis. Lecture 6 ECS 240. ECS 240 Data Flow Analysis 1
Data Flow Analysis Lecture 6 ECS 240 ECS 240 Data Flow Analysis 1 The Plan Introduce a few example analyses Generalize to see the underlying theory Discuss some more advanced issues ECS 240 Data Flow Analysis
More informationCSE 311 Lecture 28: Undecidability of the Halting Problem. Emina Torlak and Kevin Zatloukal
CSE 311 Lecture 28: Undecidability of the Halting Problem Emina Torlak and Kevin Zatloukal 1 Topics Final exam Logistics, format, and topics. Countability and uncomputability A quick recap of Lecture 27.
More informationMA 1128: Lecture 08 03/02/2018. Linear Equations from Graphs And Linear Inequalities
MA 1128: Lecture 08 03/02/2018 Linear Equations from Graphs And Linear Inequalities Linear Equations from Graphs Given a line, we would like to be able to come up with an equation for it. I ll go over
More informationReasoning About Imperative Programs. COS 441 Slides 10b
Reasoning About Imperative Programs COS 441 Slides 10b Last time Hoare Logic: { P } C { Q } Agenda If P is true in the initial state s. And C in state s evaluates to s. Then Q must be true in s. Program
More informationLecture 10: Data Flow Analysis II
CS 515 Programming Language and Compilers I Lecture 10: Data Flow Analysis II (The lectures are based on the slides copyrighted by Keith Cooper and Linda Torczon from Rice University.) Zheng (Eddy) Zhang
More informationNote: Please use the actual date you accessed this material in your citation.
MIT OpenCourseWare http://ocw.mit.edu 18.06 Linear Algebra, Spring 2005 Please use the following citation format: Gilbert Strang, 18.06 Linear Algebra, Spring 2005. (Massachusetts Institute of Technology:
More informationRecitation 9: Probability Matrices and Real Symmetric Matrices. 3 Probability Matrices: Definitions and Examples
Math b TA: Padraic Bartlett Recitation 9: Probability Matrices and Real Symmetric Matrices Week 9 Caltech 20 Random Question Show that + + + + +... = ϕ, the golden ratio, which is = + 5. 2 2 Homework comments
More information: Advanced Compiler Design Compu=ng DF(X) 3.4 Algorithm for inser=on of φ func=ons 3.5 Algorithm for variable renaming
263-2810: Advanced Compiler Design 3.3.2 Compu=ng DF(X) 3.4 Algorithm for inser=on of φ func=ons 3.5 Algorithm for variable renaming Thomas R. Gross Computer Science Department ETH Zurich, Switzerland
More informationLinear Programming Duality
Summer 2011 Optimization I Lecture 8 1 Duality recap Linear Programming Duality We motivated the dual of a linear program by thinking about the best possible lower bound on the optimal value we can achieve
More informationIE 5531: Engineering Optimization I
IE 5531: Engineering Optimization I Lecture 5: The Simplex method, continued Prof. John Gunnar Carlsson September 22, 2010 Prof. John Gunnar Carlsson IE 5531: Engineering Optimization I September 22, 2010
More informationComplexity Theory: The P vs NP question
The $1M question Complexity Theory: The P vs NP question Lecture 28 (December 1, 2009) The Clay Mathematics Institute Millenium Prize Problems 1. Birch and Swinnerton-Dyer Conjecture 2. Hodge Conjecture
More informationDecision, Computation and Language
Decision, Computation and Language Non-Deterministic Finite Automata (NFA) Dr. Muhammad S Khan (mskhan@liv.ac.uk) Ashton Building, Room G22 http://www.csc.liv.ac.uk/~khan/comp218 Finite State Automata
More informationAM 121: Intro to Optimization
AM 121: Intro to Optimization Models and Methods Lecture 6: Phase I, degeneracy, smallest subscript rule. Yiling Chen SEAS Lesson Plan Phase 1 (initialization) Degeneracy and cycling Smallest subscript
More informationPageRank: The Math-y Version (Or, What To Do When You Can t Tear Up Little Pieces of Paper)
PageRank: The Math-y Version (Or, What To Do When You Can t Tear Up Little Pieces of Paper) In class, we saw this graph, with each node representing people who are following each other on Twitter: Our
More informationEFFICIENT PREDICATE ABSTRACTION OF PROGRAM SUMMARIES
EFFICIENT PREDICATE ABSTRACTION OF PROGRAM SUMMARIES Arie Gurfinkel, Sagar Chaki and Samir Sapra Carnegie Mellon Uni In NFM11 Presented by Nimrod Partush OUTLINE Introduction Predicate Abstraction CEGAR
More informationDataflow analysis. Theory and Applications. cs6463 1
Dataflow analysis Theory and Applications cs6463 1 Control-flow graph Graphical representation of runtime control-flow paths Nodes of graph: basic blocks (straight-line computations) Edges of graph: flows
More informationMath Precalculus I University of Hawai i at Mānoa Spring
Math 135 - Precalculus I University of Hawai i at Mānoa Spring - 2013 Created for Math 135, Spring 2008 by Lukasz Grabarek and Michael Joyce Send comments and corrections to lukasz@math.hawaii.edu Contents
More informationWhat is SSA? each assignment to a variable is given a unique name all of the uses reached by that assignment are renamed
Another Form of Data-Flow Analysis Propagation of values for a variable reference, where is the value produced? for a variable definition, where is the value consumed? Possible answers reaching definitions,
More informationTheory of Computation
Theory of Computation Dr. Sarmad Abbasi Dr. Sarmad Abbasi () Theory of Computation 1 / 38 Lecture 21: Overview Big-Oh notation. Little-o notation. Time Complexity Classes Non-deterministic TMs The Class
More informationLecture 6 September 21, 2016
ICS 643: Advanced Parallel Algorithms Fall 2016 Lecture 6 September 21, 2016 Prof. Nodari Sitchinava Scribe: Tiffany Eulalio 1 Overview In the last lecture, we wrote a non-recursive summation program and
More informationLogic Design II (17.342) Spring Lecture Outline
Logic Design II (17.342) Spring 2012 Lecture Outline Class # 10 April 12, 2012 Dohn Bowden 1 Today s Lecture First half of the class Circuits for Arithmetic Operations Chapter 18 Should finish at least
More information18.01 Single Variable Calculus Fall 2006
MIT OpenCourseWare http://ocw.mit.edu 8.0 Single Variable Calculus Fall 2006 For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms. Lecture 0 8.0 Fall 2006 Lecture
More informationFoundations of
91.304 Foundations of (Theoretical) Computer Science Chapter 3 Lecture Notes (Section 3.2: Variants of Turing Machines) David Martin dm@cs.uml.edu With some modifications by Prof. Karen Daniels, Fall 2012
More informationDesigning Information Devices and Systems I Spring 2019 Homework 7
Last Updated: 2019-03-16 22:56 1 EECS 16A Designing Information Devices and Systems I Spring 2019 Homework 7 This homework is due March 15, 2019 at 23:59. Self-grades are due March 19, 2019, at 23:59.
More informationMaterial Covered on the Final
Material Covered on the Final On the final exam, you are responsible for: Anything covered in class, except for stories about my good friend Ken Kennedy All lecture material after the midterm ( below the
More informationDesigning Information Devices and Systems I Spring 2018 Lecture Notes Note 11
EECS 16A Designing Information Devices and Systems I Spring 2018 Lecture Notes Note 11 11.1 Context Our ultimate goal is to design systems that solve people s problems. To do so, it s critical to understand
More informationMAT1302F Mathematical Methods II Lecture 19
MAT302F Mathematical Methods II Lecture 9 Aaron Christie 2 April 205 Eigenvectors, Eigenvalues, and Diagonalization Now that the basic theory of eigenvalues and eigenvectors is in place most importantly
More informationLoop Invariants and Binary Search. Chapter 4.4, 5.1
Loop Invariants and Binary Search Chapter 4.4, 5.1 Outline Iterative Algorithms, Assertions and Proofs of Correctness Binary Search: A Case Study Outline Iterative Algorithms, Assertions and Proofs of
More informationTopics on Compilers
Assignment 2 4541.775 Topics on Compilers Sample Solution 1. Test for dependences on S. Write down the subscripts. Which positions are separable, which are coupled? Which dependence test would you apply
More informationPreptests 55 Answers and Explanations (By Ivy Global) Section 4 Logic Games
Section 4 Logic Games Questions 1 6 There aren t too many deductions we can make in this game, and it s best to just note how the rules interact and save your time for answering the questions. 1. Type
More informationCSE 311: Foundations of Computing. Lecture 27: Undecidability
CSE 311: Foundations of Computing Lecture 27: Undecidability Last time: Countable sets A set is countable iff we can order the elements of as = {,,, Countable sets: N-the natural numbers Z - the integers
More informationLecture 6: Introducing Complexity
COMP26120: Algorithms and Imperative Programming Lecture 6: Introducing Complexity Ian Pratt-Hartmann Room KB2.38: email: ipratt@cs.man.ac.uk 2015 16 You need this book: Make sure you use the up-to-date
More informationTopic Contents. Factoring Methods. Unit 3: Factoring Methods. Finding the square root of a number
Topic Contents Factoring Methods Unit 3 The smallest divisor of an integer The GCD of two numbers Generating prime numbers Computing prime factors of an integer Generating pseudo random numbers Raising
More informationData Structures in Java
Data Structures in Java Lecture 21: Introduction to NP-Completeness 12/9/2015 Daniel Bauer Algorithms and Problem Solving Purpose of algorithms: find solutions to problems. Data Structures provide ways
More informationCTL satisfability via tableau A C++ implementation
CTL satisfability via tableau A C++ implementation Nicola Prezza April 30, 2015 Outline 1 Introduction 2 Parsing 3 Data structures 4 Initial sets of labels and edges 5 Cull 6 Examples and benchmarks The
More informationLecture 6. 2 Adaptively-Secure Non-Interactive Zero-Knowledge
CMSC 858K Advanced Topics in Cryptography February 12, 2004 Lecturer: Jonathan Katz Lecture 6 Scribe(s): Omer Horvitz John Trafton Zhongchao Yu Akhil Gupta 1 Introduction In this lecture, we show how to
More informationSkylines. Yufei Tao. ITEE University of Queensland. INFS4205/7205, Uni of Queensland
Yufei Tao ITEE University of Queensland Today we will discuss problems closely related to the topic of multi-criteria optimization, where one aims to identify objects that strike a good balance often optimal
More informationWe have seen that the symbols,,, and can guide the logical
CHAPTER 7 Quantified Statements We have seen that the symbols,,, and can guide the logical flow of algorithms. We have learned how to use them to deconstruct many English sentences into a symbolic form.
More informationECEN 651: Microprogrammed Control of Digital Systems Department of Electrical and Computer Engineering Texas A&M University
ECEN 651: Microprogrammed Control of Digital Systems Department of Electrical and Computer Engineering Texas A&M University Prof. Mi Lu TA: Ehsan Rohani Laboratory Exercise #4 MIPS Assembly and Simulation
More informationLecture 1: Asymptotic Complexity. 1 These slides include material originally prepared by Dr.Ron Cytron, Dr. Jeremy Buhler, and Dr. Steve Cole.
Lecture 1: Asymptotic Complexity 1 These slides include material originally prepared by Dr.Ron Cytron, Dr. Jeremy Buhler, and Dr. Steve Cole. Announcements TA office hours officially start this week see
More information/633 Introduction to Algorithms Lecturer: Michael Dinitz Topic: Matroids and Greedy Algorithms Date: 10/31/16
60.433/633 Introduction to Algorithms Lecturer: Michael Dinitz Topic: Matroids and Greedy Algorithms Date: 0/3/6 6. Introduction We talked a lot the last lecture about greedy algorithms. While both Prim
More informationx 1 + x 2 2 x 1 x 2 1 x 2 2 min 3x 1 + 2x 2
Lecture 1 LPs: Algebraic View 1.1 Introduction to Linear Programming Linear programs began to get a lot of attention in 1940 s, when people were interested in minimizing costs of various systems while
More information1 Closest Pair of Points on the Plane
CS 31: Algorithms (Spring 2019): Lecture 5 Date: 4th April, 2019 Topic: Divide and Conquer 3: Closest Pair of Points on a Plane Disclaimer: These notes have not gone through scrutiny and in all probability
More informationAnnouncements. Using a 72-hour extension, due Monday at 11:30AM.
The Big Picture Announcements Problem Set 9 due right now. Using a 72-hour extension, due Monday at 11:30AM. On-time Problem Set 8's graded, should be returned at the end of lecture. Final exam review
More informationLecture 27: Theory of Computation. Marvin Zhang 08/08/2016
Lecture 27: Theory of Computation Marvin Zhang 08/08/2016 Announcements Roadmap Introduction Functions Data Mutability Objects This week (Applications), the goals are: To go beyond CS 61A and see examples
More informationEby, MATH 0310 Spring 2017 Page 53. Parentheses are IMPORTANT!! Exponents only change what they! So if a is not inside parentheses, then it
Eby, MATH 010 Spring 017 Page 5 5.1 Eponents Parentheses are IMPORTANT!! Eponents only change what they! So if a is not inside parentheses, then it get raised to the power! Eample 1 4 b) 4 c) 4 ( ) d)
More informationSoftware Verification
Software Verification Grégoire Sutre LaBRI, University of Bordeaux, CNRS, France Summer School on Verification Technology, Systems & Applications September 2008 Grégoire Sutre Software Verification VTSA
More informationCSC 5170: Theory of Computational Complexity Lecture 4 The Chinese University of Hong Kong 1 February 2010
CSC 5170: Theory of Computational Complexity Lecture 4 The Chinese University of Hong Kong 1 February 2010 Computational complexity studies the amount of resources necessary to perform given computations.
More informationCSE20: Discrete Mathematics
Spring 2018 Summary Today: Induction, Program Correctness Reading: Chap. 5 Division Theorem Theorem: For every integer a and positive integer d 1, there exist integers q, r such that a = qd + r and 0 r
More informationConvolutional Coding LECTURE Overview
MIT 6.02 DRAFT Lecture Notes Spring 2010 (Last update: March 6, 2010) Comments, questions or bug reports? Please contact 6.02-staff@mit.edu LECTURE 8 Convolutional Coding This lecture introduces a powerful
More informationScalar Optimisation Part 1
calar Optimisation Part 1 Michael O Boyle January, 2014 1 Course tructure L1 Introduction and Recap 4/5 lectures on classical optimisation 2 lectures on scalar optimisation Today example optimisations
More informationCS 301. Lecture 18 Decidable languages. Stephen Checkoway. April 2, 2018
CS 301 Lecture 18 Decidable languages Stephen Checkoway April 2, 2018 1 / 26 Decidable language Recall, a language A is decidable if there is some TM M that 1 recognizes A (i.e., L(M) = A), and 2 halts
More informationStatic Program Analysis
Static Program Analysis Xiangyu Zhang The slides are compiled from Alex Aiken s Michael D. Ernst s Sorin Lerner s A Scary Outline Type-based analysis Data-flow analysis Abstract interpretation Theorem
More informationCourse 4 Finite Automata/Finite State Machines
Course 4 Finite Automata/Finite State Machines The structure and the content of the lecture is based on (1) http://www.eecs.wsu.edu/~ananth/cpts317/lectures/index.htm, (2) W. Schreiner Computability and
More informationA Note on Turing Machine Design
CS103 Handout 17 Fall 2013 November 11, 2013 Problem Set 7 This problem explores Turing machines, nondeterministic computation, properties of the RE and R languages, and the limits of RE and R languages.
More informationCompiling Techniques
Lecture 11: Introduction to 13 November 2015 Table of contents 1 Introduction Overview The Backend The Big Picture 2 Code Shape Overview Introduction Overview The Backend The Big Picture Source code FrontEnd
More informationClass Note #14. In this class, we studied an algorithm for integer multiplication, which. 2 ) to θ(n
Class Note #14 Date: 03/01/2006 [Overall Information] In this class, we studied an algorithm for integer multiplication, which improved the running time from θ(n 2 ) to θ(n 1.59 ). We then used some of
More informationScalar Optimisation Part 2
Scalar Optimisation Part 2 Michael O Boyle January 2014 1 Course Structure L1 Introduction and Recap 4-5 lectures on classical optimisation 2 lectures on scalar optimisation Last lecture on redundant expressions
More informationA non-turing-recognizable language
CS 360: Introduction to the Theory of Computing John Watrous, University of Waterloo A non-turing-recognizable language 1 OVERVIEW Thus far in the course we have seen many examples of decidable languages
More informationLecture 23 Branch-and-Bound Algorithm. November 3, 2009
Branch-and-Bound Algorithm November 3, 2009 Outline Lecture 23 Modeling aspect: Either-Or requirement Special ILPs: Totally unimodular matrices Branch-and-Bound Algorithm Underlying idea Terminology Formal
More informationHOW TO WRITE PROOFS. Dr. Min Ru, University of Houston
HOW TO WRITE PROOFS Dr. Min Ru, University of Houston One of the most difficult things you will attempt in this course is to write proofs. A proof is to give a legal (logical) argument or justification
More informationProgramming Language Concepts, CS2104 Lecture 3
Programming Language Concepts, CS2104 Lecture 3 Statements, Kernel Language, Abstract Machine 31 Aug 2007 CS2104, Lecture 3 1 Reminder of last lecture Programming language definition: syntax, semantics
More informationIntro to Theory of Computation
Intro to Theory of Computation LECTURE 9 Last time: Converting a PDA to a CFG Pumping Lemma for CFLs Today: Pumping Lemma for CFLs Review of CFGs/PDAs Sofya Raskhodnikova 2/9/2016 Sofya Raskhodnikova;
More informationCongratulations you're done with CS103 problem sets! Please evaluate this course on Axess!
The Big Picture Announcements Problem Set 9 due right now. We'll release solutions right after lecture. Congratulations you're done with CS103 problem sets! Practice final exam is Monday, December 8 from
More informationORF 522. Linear Programming and Convex Analysis
ORF 5 Linear Programming and Convex Analysis Initial solution and particular cases Marco Cuturi Princeton ORF-5 Reminder: Tableaux At each iteration, a tableau for an LP in standard form keeps track of....................
More informationCSE373: Data Structures and Algorithms Lecture 3: Math Review; Algorithm Analysis. Catie Baker Spring 2015
CSE373: Data Structures and Algorithms Lecture 3: Math Review; Algorithm Analysis Catie Baker Spring 2015 Today Registration should be done. Homework 1 due 11:59pm next Wednesday, April 8 th. Review math
More informationIntroduction to Operations Research Prof. G. Srinivasan Department of Management Studies Indian Institute of Technology, Madras
Introduction to Operations Research Prof. G. Srinivasan Department of Management Studies Indian Institute of Technology, Madras Module - 03 Simplex Algorithm Lecture 15 Infeasibility In this class, we
More informationNatural Language Processing Prof. Pushpak Bhattacharyya Department of Computer Science & Engineering, Indian Institute of Technology, Bombay
Natural Language Processing Prof. Pushpak Bhattacharyya Department of Computer Science & Engineering, Indian Institute of Technology, Bombay Lecture - 21 HMM, Forward and Backward Algorithms, Baum Welch
More informationYour Comments. I have three midterms this week; specifically, two tomorrow. I am studying for chemistry and calculus tonight.
Your Comments I wish we had a day off for exams that would be fantastic WE SHOULD NOT HAE HAD CLASS TODAY!!!!! BOOOOOOOo!!! I have three midterms this week; specifically, two tomorrow. I am studying for
More informationLinear Classification: Perceptron
Linear Classification: Perceptron Yufei Tao Department of Computer Science and Engineering Chinese University of Hong Kong 1 / 18 Y Tao Linear Classification: Perceptron In this lecture, we will consider
More informationDesigning Information Devices and Systems I Fall 2018 Lecture Notes Note Positioning Sytems: Trilateration and Correlation
EECS 6A Designing Information Devices and Systems I Fall 08 Lecture Notes Note. Positioning Sytems: Trilateration and Correlation In this note, we ll introduce two concepts that are critical in our positioning
More information(Refer Slide Time: 1:13)
Linear Algebra By Professor K. C. Sivakumar Department of Mathematics Indian Institute of Technology, Madras Lecture 6 Elementary Matrices, Homogeneous Equaions and Non-homogeneous Equations See the next
More informationCS 4110 Programming Languages & Logics. Lecture 25 Records and Subtyping
CS 4110 Programming Languages & Logics Lecture 25 Records and Subtyping 31 October 2016 Announcements 2 Homework 6 returned: x = 34 of 37, σ = 3.8 Preliminary Exam II in class on Wednesday, November 16
More information