Beyond Superlocal: Dominators, Data-Flow Analysis, and DVNT. COMP 506 Rice University Spring target code. source code OpJmizer
|
|
- Virginia Johnston
- 6 years ago
- Views:
Transcription
1 COMP 506 Rice University Spring 2017 Beyond Superlocal: Dominators, Data-Flow Analysis, and DVNT source code Front End IR OpJmizer IR Back End target code Copyright 2017, Keith D. Cooper & Linda Torczon, all rights reserved. Students enrolled in Comp 506 at Rice University have explicit permission to make copies of these materials for their personal use. Faculty from other educajonal insjtujons may use these materials for nonprofit educajonal purposes, provided this copyright nojce is preserved SecJon numbers refer to EaC2e.
2 Two Weeks Ago Review Key ideas in opjmizajon Safety Profitability Opportunity Superlocal Value Numbering Control-flow graph construcjon Clever use of renaming and a scoped-hash table Found more opportunijes B A p c + d r c + d m a + b n a + b C q a + b r c + d D e b + 18 E e a + 17 s a + b t c + d u e + f u e + f F v a + b w c + d x e + f To do bexer, we need to understand what informajon we can always use on entry to F and G. G y a + b z c + d We want to find inter-block improvements in F and G COMP 506, Spring
3 Redundancy Elimina?on as an Example An expression x+y is redundant if and only if, along every path from the procedure s entry, it has been evaluated, and its cons7tuent subexpressions (x & y) have not been re-defined. From Lecture 14 Slide 7, with emphasis added We need to understand the proper?es of those paths Specifically, what blocks occur on any path from entry to p If we can find those blocks, we can use their hash tables For example: A is on every path to any other node; and C is on every path to D, E, and F. Only A is on every path to G. B m a + b n a + b COMP 506, Spring A p c + d r c + d G C y a + b z c + d q a + b r c + d D e b + 18 E e a + 17 s a + b t c + d u e + f u e + f F v a + b w c + d x e + f
4 Dominance in a Control-Flow Graph Defini?on In a flow graph, x dominates y if and only if every path from the entry node of the control-flow graph to y includes x By definijon, x dominates x We associate a DOM set with each node DOM(x) contains the set of nodes that dominate x DOM(x ) 1 Immediate dominator For any node x, there must be a y in DOM(x ) closest to x We call this y the immediate dominator of x x cannot be its own immediate dominator, unless x is n 0 As a maxer of notajon, we write this as IDOM(x ) Original idea: R.T. Prosser. ApplicaJons of Boolean matrices to the analysis of flow diagrams, COMP Proceedings 506, Spring of the 2017 Eastern Joint Computer Conference, Spartan Books, New York, pages ,
5 Dominance Dominators have many uses in analysis & transforma?on Finding loops Building SSA form Making code mojon decisions B A is n 0 A p c + d r c + d m a + b n a + b C q a + b r c + d Dominator sets Block DOM IDOM A A B A,B A C A,C A D A,C,D C E A,C,E C F A,C,F C G A,G A Dominator tree A B C G D E F G D e b + 18 E e a + 17 s a + b t c + d u e + f u e + f F y a + b z c + d v a + b w c + d x e + f COMP 506, Spring
6 Compu?ng Dominators To use dominance informa?on, we need to compute DOM sets A node n dominates node m iff n is on every path from n 0 to m Every node dominates itself, by definijon n s immediate dominator is the node in DOM(n ) that is closest to n in the graph 1 Compu?ng DOM We formulate the computajon of DOM sets as a data-flow analysis problem Simultaneous equajons over sets associated with the nodes in the CFG EquaJons relate the set value at a node n to those of its predecessors and successors in the CFG EquaJons must be well-formed We want a unique solujon We want an efficient technique to compute that solujon COMP 1 IDOM(n) 506, Spring n, unless 2017 n is n 0, by convenjon. 6
7 Compu?ng Dominators Equa?ons for Dominance DOM(n 0 ) = { n 0 } DOM(n) = { n } ( p preds(n) DOM(p)) IniJally, DOM(n) = N, n n 0. We can do bexer. Compu?ng DOM These equajons define the data-flow problem DOM has among the simplest equajons of any data-flow problem These equajons have a unique fixed-point solujon That is, an iterajve algorithm will find a unique answer The simplicity of the DOM equajons lead to efficient solujons COMP If necessary, 506, Spring add 2017 a unique entry node n 0 that has no predecessors in the CFG. 7
8 Compu?ng Dominators How do we compute a solu?on to these equa?ons? Build a control-flow graph to idenjfy the blocks & their predecessors IniJalize DOM(n ) appropriately, for all n in the CFG Set DOM(n) to N, for all n n 0 Set DOM(n 0 ) to { n 0 } Repeatedly apply the second equajon, unjl the sets stop changing DOM(n 0 ) { n 0 } for x n 1 to n n DOM(x) { all nodes in graph, N } change true while (change) change false for x n 0 to n n TEMP { x } ( y pred (x) DOM(y )) if DOM(x) TEMP then change true DOM(x) TEMP Round-robin itera?ve algorithm for DOM The round-robin solver is easier to analyze and understand than other solvers. COMP The results 506, Spring with 2017 round-robin easily carry over to other forms of iterajve solvers. 8
9 Compu?ng Dominators Immediate Ques?ons That You Should Ask Termina?on: Does the algorithm halt? Correctness: Does it compute DOM sets correctly? Efficiency: How quickly does it compute DOM? The study of data-flow analysis is a subject unto itself Long history in the literature MathemaJcal bases for answers to our quesjons I will summarize that knowledge DOM(n 0 ) { n 0 } for x n 1 to n n DOM(x) { all nodes in graph, N } change true while (change) change false for x n 0 to n n TEMP { x } ( y pred (x) DOM(y )) if DOM(x) TEMP then change true DOM(x) TEMP Round-robin itera?ve algorithm for DOM COMP 506, Spring
10 Compu?ng Dominators Why do we believe that this algorithm halts? Each DOM set can contain at most N elements a finite number of elements New DOM sets are produced as the intersecjon of old DOM sets (D 1 D 2 ) D 1 (D 1 D 2 ) D 2 New sets are never larger than old sets Since the inijal sets are finite, they can only shrink a finite number of Jmes They must stop changing ater a finite number of updates The algorithm halts ater a finite number of updates DOM(n 0 ) { n 0 } for x n 1 to n n DOM(x) { all nodes in graph, N } change true while (change) change false for x n 0 to n n TEMP { x } ( y pred (x) DOM(y )) if DOM(x) TEMP then change true DOM(x) TEMP Round-robin itera?ve algorithm for DOM COMP 506, Spring
11 Semila_ce for DOM The possible DOM sets fit into a structure called a semila_ce With n = N nodes in the graph, there are 2 n possible DOM sets Think of each n (in binary) as a bit vector of the n nodes, D 0, D 1, D 2, D n One-to-one correspondence between numbers (0 to n-1) and subsets of N IntersecJon imposes an order on the D i s D i D j is no larger than max( D i, D j ) intersec7on is monotonic on the D i s D i D j iff D i D j = D j D i > D j iff D i D j and D i D j Two special elements: and top and bo^om D i = D i, for all D i is D n, the set of all nodes D i =, for all D i is D 0, the empty set Introduces the nojon of a descending chain Sequence of values x 0, x 1, x 2, x k where each x i is a set in D and x i > x i+1, 1 i < n If all descending chains are finite, then the algorithm halts Since D is finite, the chains must be finite COMP 506, Spring
12 Dominators The La_ce for Four Nodes 1111 > > > > COMP 506, Spring
13 Dominators 1110 = 1110 The La_ce for Four Nodes 1111 > > > > COMP 506, Spring
14 Dominators = 0011 The La_ce for Four Nodes 1111 > > > > COMP 506, Spring
15 Dominators = 0000 ( ) The La_ce for Four Nodes 1111 > > > > COMP 506, Spring
16 Dominators And, we can go on and on The La_ce for Four Nodes 1111 > > > > COMP 506, Spring
17 Second Lab: Two Op?ons Moved to middle of class for axendance reasons 1. Generate ILOC code out of your parser Add acjons to your grammar file, and support code, to generate working ILOC code for input programs wrixen in demo This lab builds on your lab 1 experience and code I have a small library of demo programs both small tests and larger programs Demonstrate correctness using an ILOC simulator 2. Take ILOC code generated by my parser & improve it Build a framework that reads in the ILOC code & holds it in some data structure Process that ILOC code to build a control-flow graph Perform value-numbering on the blocks in the ILOC code Demonstrate correctness & measure improvement using an ILOC simulator In either case, I will provide a demo to ILOC compiler and the ILOC simulator as tools to help you test and generate examples. COMP 506, Spring
18 Compu?ng Dominators Why do we believe that this algorithm computes the right answer? With enough math, we can prove that this formulajon has only one fixed point When the while loop halts, the values of the DOM sets are uniquely determined. If there is only one fixed point, then any fixed point we compute is the right one DOM(n 0 ) { n 0 } for x n 1 to n n DOM(x) { all nodes in graph, N } change true while (change) change false for x n 0 to n n TEMP { x } ( y pred (x) DOM(y )) if DOM(x) TEMP then change true DOM(x) TEMP Round-robin itera?ve algorithm for DOM COMP See Kam 506, & Ullman Spring 2017 [210] & [211] in EaC2e 18
19 Compu?ng Dominators How fast can we compute the answers to DOM? Since there is only one answer, we get the same answer no maxer what order we take in the inner loop Order maxers (a lot) A reverse postorder solver will halt in d(g) + 3 iterajons of the while loop d(g) is the maximum number of back edges in any acyclic path in G In pracjce, d(g) is small (< 4) DOM(n 0 ) { n 0 } for x n 1 to n n DOM(x) { all nodes in graph, N } change true while (change) change false for x n 0 to n n TEMP { x } ( y pred (x) DOM(y )) if DOM(x) TEMP then change true DOM(x) TEMP Round-robin itera?ve algorithm for DOM COMP See Kam 506, & Ullman Spring 2017 [210] & [211] in EaC2e 19
20 Ordering the Nodes to Maximize Propaga?on Postorder Numbers 1 Reverse Postorder Numbers RPO ordering visits predecessors before visijng a node (ignoring cycles) For problems that propagate informajon from successors to predecessors, use RPO on the reversed CFG Not the same as reverse preorder (see graph to the right) B 0 B 1 B 2 COMP 506, Spring B 3 B 6 B 4 B 7 Counter example from Exercise 9.4(b) B 5 B 8
21 Example Dominator Calcula?on Added a unique entry node B 0 B 1 B 2 B 3 Itera?on Progress of itera?ve solu?on for DOM DOM(n) N N N N N N N 1 0 0,1 0,1,2 0,1,3 0,1,3,4 0,1,3,5 0,1,3,6 0,1, ,1 0,1,2 0,1,3 0,1,3,4 0,1,3,5 0,1,3,6 0,1,7 B 4 B 5 B 6 B 7 Flow Graph COMP 506, Spring
22 Example Dominator Calcula?on Progress of itera?ve solu?on for DOM B 0 B 1 B 2 B 3 Itera?on DOM(n) N N N N N N N 1 0 0,1 0,1,2 0,1,3 0,1,3,4 0,1,3,5 0,1,3,6 0,1, ,1 0,1,2 0,1,3 0,1,3,4 0,1,3,5 0,1,3,6 0,1,7 B 4 B 5 Results of itera?ve solu?on for DOM B 7 B DOM 0 0,1 0,1,2 0,1,3 0,1,3,4 0,1,3,5 0,1,3,6 0,1,7 IDOM Flow Graph There are asymptojcally faster algorithms. With the right data structures, the iterajve algorithm can be made extremely fast (compejjve out to 10,000 or 20,000 nodes) COMP 506, Spring 2017 See Cooper, Harvey, & Kennedy [100], or in EaC2e. 22
23 Speeding Up DOM No?ce that the IDOM sets encode the dominator tree B 0 B DOM 0 0,1 0,1,2 0,1,3 0,1,3,4 0,1,3,5 0,1,3,6 0,1,7 IDOM B 2 B 3 B 4 B 5 B 6 B 7 Flow Graph Dominator tree We don t need to compute or store DOM We can get away with IDOM and read DOM by walking the tree represented in the IDOM sets This observajon leads to a compact data structure and a very fast algorithm COMP 506, Spring
24 Speeding Up DOM No?ce that the IDOM sets encode the dominator tree DOM 0 0,1 0,1,2 0,1,3 0,1,3,4 0,1,3,5 0,1,3,6 0,1,7 IDOM Dominator tree Key opera?on in the algorithm is intersec?on two DOM sets Number the nodes in the flow graph with their RPO number To intersect DOM(x) and DOM(y), start at x and y and walk up the tree from each of them If RPO( f 1 ) > RPO( f 2 ), move up from f 1 If RPO( f 1 ) < RPO( f 2 ), move up from f 2 If RPO( f 1 ) = RPO( f 2 ), f 1 is the closest common ancestor of x and y, and chain above f 1 dominates both x and y This two-finger algorithm is extremely fast ( in EaC2e) COMP 506, Spring
25 Dominators Can Improve Superlocal Value Numbering SVN did not help with blocks F or G MulJple predecessors Must decide what facts hold in F and in G For G, combine B & F? Merging state is expensive Fall back on what s known Can use table from IDOM(x) to start x Use C for F and A for G Imposes a DOM-based applicajon order B A p 0 c + d r 0 c + d G m 0 a + b n 0 a + b C r 2 φ(r 0,r 1 ) y 0 a + b z 0 c + d q 0 a + b r 1 c + d D e 0 b + 18 E e 1 a + 17 s 0 a + b t 0 c + d u 0 e + f u 1 e + f F e 3 φ(e 0,e 1 ) u 2 φ(u 0,u 1 ) v 0 a + b w 0 c + d x 0 e + f Leads to Dominator VN Technique (DVNT) COMP 506, Spring
26 Dominator-Based Value Numbering The DVNT Algorithm Use superlocal algorithm on extended basic blocks Retain use of scoped hash tables Need to use the SSA name space to avoid bookkeeping headaches Start each node with table from its IDOM DVNT generalizes the superlocal algorithm No values flow along back edges Constant folding, algebraic idenjjes as before (i.e., around loops) Larger scope leads to ( poten7ally) bexer results LVN + SVN + good start for EBBs missed by SVN COMP 506, Spring
27 Dominator-Based Value Numbering B A p c + d r c + d m a + b n a + b C q a + b r c + d DVNT advantages Find more redundancy LiXle addijonal cost Retains online character D e b + 18 E e a + 17 s a + b t c + d u e + f u e + f G F y a + b z c + d v a + b w c + d x e + f DVNT shortcomings Misses some opportunijes No loop-carried redundancies or constants COMP 506, Spring 2017 See [53] or in EaC2e 27
Lecture 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 informationLecture 11: Data Flow Analysis III
CS 515 Programming Language and Compilers I Lecture 11: Data Flow Analysis III (The lectures are based on the slides copyrighted by Keith Cooper and Linda Torczon from Rice University.) Zheng (Eddy) Zhang
More informationCSE P 501 Compilers. Value Numbering & Op;miza;ons Hal Perkins Winter UW CSE P 501 Winter 2016 S-1
CSE P 501 Compilers Value Numbering & Op;miza;ons Hal Perkins Winter 2016 UW CSE P 501 Winter 2016 S-1 Agenda Op;miza;on (Review) Goals Scope: local, superlocal, regional, global (intraprocedural), interprocedural
More informationConstruction of Static Single-Assignment Form
COMP 506 Rice University Spring 2018 Construction of Static Single-Assignment Form Part II source IR IR target code Front End Optimizer Back End code Copyright 2018, Keith D. Cooper & Linda Torczon, all
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 informationSyntax Analysis, VII The Canonical LR(1) Table Construction. Comp 412 COMP 412 FALL Chapter 3 in EaC2e. source code. IR IR target.
COMP 412 FALL 2017 Syntax Analysis, VII The Canonical LR(1) Table Construction Comp 412 source code IR IR target Front End Optimizer Back End code Copyright 2017, Keith D. Cooper & Linda Torczon, all rights
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 informationSyntax Analysis, VII The Canonical LR(1) Table Construction. Comp 412
COMP 412 FALL 2018 Syntax Analysis, VII The Canonical LR(1) Table Construction Comp 412 source code IR IR target Front End Optimizer Back End code Copyright 2018, Keith D. Cooper & Linda Torczon, all rights
More informationSyntax Analysis, VI Examples from LR Parsing. Comp 412
COMP 412 FALL 2017 Syntax Analysis, VI Examples from LR Parsing Comp 412 source code IR IR target code Front End Optimizer Back End Copyright 2017, Keith D. Cooper & Linda Torczon, all rights reserved.
More informationParsing VI LR(1) Parsers
Parsing VI LR(1) Parsers N.B.: This lecture uses a left-recursive version of the SheepNoise grammar. The book uses a rightrecursive version. The derivations (& the tables) are different. Copyright 2005,
More informationLecture Overview SSA Maximal SSA Semipruned SSA o Placing -functions o Renaming Translation out of SSA Using SSA: Sparse Simple Constant Propagation
1 Lecture Overview SSA Maximal SSA Semipruned SSA o Placing -functions o Renaming Translation out of SSA Using SSA: Sparse Simple Constant Propagation [Chapter 9] 2 SSA Revisited It is desirable to use
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 informationComputing Static Single Assignment (SSA) Form
Computing Static Single Assignment (SSA) Form Overview What is SSA? Advantages of SSA over use-def chains Flavors of SSA Dominance frontiers revisited Inserting φ-nodes Renaming the variables Translating
More informationLexical Analysis Part II: Constructing a Scanner from Regular Expressions
Lexical Analysis Part II: Constructing a Scanner from Regular Expressions CS434 Spring 2005 Department of Computer Science University of Alabama Joel Jones Copyright 2003, Keith D. Cooper, Ken Kennedy
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 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 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 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 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 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 informationVerifying the LLVM. Steve Zdancewic DeepSpec Summer School 2017
Verifying the LLVM Steve Zdancewic DeepSpec Summer School 2017 Vminus OperaAonal SemanAcs Only 5 kinds of instrucaons: Binary arithmeac Memory Load Memory Store Terminators Phi nodes What is the state
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 informationCS415 Compilers Syntax Analysis Bottom-up Parsing
CS415 Compilers Syntax Analysis Bottom-up Parsing These slides are based on slides copyrighted by Keith Cooper, Ken Kennedy & Linda Torczon at Rice University Review: LR(k) Shift-reduce Parsing Shift reduce
More informationn CS 160 or CS122 n Sets and Functions n Propositions and Predicates n Inference Rules n Proof Techniques n Program Verification n CS 161
Discrete Math at CSU (Rosen book) Sets and Functions (Rosen, Sections 2.1,2.2, 2.3) TOPICS Discrete math Set Definition Set Operations Tuples 1 n CS 160 or CS122 n Sets and Functions n Propositions and
More informationOverview. Discrete Event Systems Verification of Finite Automata. What can finite automata be used for? What can finite automata be used for?
Computer Engineering and Networks Overview Discrete Event Systems Verification of Finite Automata Lothar Thiele Introduction Binary Decision Diagrams Representation of Boolean Functions Comparing two circuits
More informationTuring Machine Recap
Turing Machine Recap DFA with (infinite) tape. One move: read, write, move, change state. High-level Points Church-Turing thesis: TMs are the most general computing devices. So far no counter example Every
More informationOne Dimensional (1D) and Two Dimensional (2D) Spring Mass Chains
One Dimensional (1D) and Two Dimensional (2D) Spring Mass Chains Massimo Ruzzene D. Guggenheim School of Aerospace Engineering G. Woodruff School of Mechanical Engineering Georgia InsJtute of Technology
More informationBinary Decision Diagrams. Graphs. Boolean Functions
Binary Decision Diagrams Graphs Binary Decision Diagrams (BDDs) are a class of graphs that can be used as data structure for compactly representing boolean functions. BDDs were introduced by R. Bryant
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 informationMapping Reducibility. Human-aware Robotics. 2017/11/16 Chapter 5.3 in Sipser Ø Announcement:
Mapping Reducibility 2017/11/16 Chapter 5.3 in Sipser Ø Announcement: q Slides for this lecture are here: http://www.public.asu.edu/~yzhan442/teaching/cse355/lectures/mapping.pdf 1 Last time Reducibility
More informationComputational Models Lecture 8 1
Computational Models Lecture 8 1 Handout Mode Ronitt Rubinfeld and Iftach Haitner. Tel Aviv University. May 11/13, 2015 1 Based on frames by Benny Chor, Tel Aviv University, modifying frames by Maurice
More informationAnnouncements. Solution to Assignment 3 is posted Assignment 4 is available. c D. Poole and A. Mackworth 2017 CPSC 322 Lecture 8 1 / 25
Announcements Solution to Assignment 3 is posted Assignment 4 is available c D. Poole and A. Mackworth 2017 CPSC 322 Lecture 8 1 / 25 Review: So far... Constraint satisfaction problems defined in terms
More informationCP405 Theory of Computation
CP405 Theory of Computation BB(3) q 0 q 1 q 2 0 q 1 1R q 2 0R q 2 1L 1 H1R q 1 1R q 0 1L Growing Fast BB(3) = 6 BB(4) = 13 BB(5) = 4098 BB(6) = 3.515 x 10 18267 (known) (known) (possible) (possible) Language:
More informationMath 31 Lesson Plan. Day 2: Sets; Binary Operations. Elizabeth Gillaspy. September 23, 2011
Math 31 Lesson Plan Day 2: Sets; Binary Operations Elizabeth Gillaspy September 23, 2011 Supplies needed: 30 worksheets. Scratch paper? Sign in sheet Goals for myself: Tell them what you re going to tell
More informationCS 243 Lecture 11 Binary Decision Diagrams (BDDs) in Pointer Analysis
CS 243 Lecture 11 Binary Decision Diagrams (BDDs) in Pointer Analysis 1. Relations in BDDs 2. Datalog -> Relational Algebra 3. Relational Algebra -> BDDs 4. Context-Sensitive Pointer Analysis 5. Performance
More informationHow to write maths (well)
How to write maths (well) Dr Euan Spence 29 September 2017 These are the slides from a talk I gave to the new first-year students at Bath, annotated with some of the things I said (which appear in boxes
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 informationSanjit A. Seshia EECS, UC Berkeley
EECS 219C: Computer-Aided Verification Explicit-State Model Checking: Additional Material Sanjit A. Seshia EECS, UC Berkeley Acknowledgments: G. Holzmann Checking if M satisfies : Steps 1. Compute Buchi
More informationBinary Decision Diagrams
Binary Decision Diagrams Binary Decision Diagrams (BDDs) are a class of graphs that can be used as data structure for compactly representing boolean functions. BDDs were introduced by R. Bryant in 1986.
More informationRandomized Algorithms
Randomized Algorithms Prof. Tapio Elomaa tapio.elomaa@tut.fi Course Basics A new 4 credit unit course Part of Theoretical Computer Science courses at the Department of Mathematics There will be 4 hours
More informationCSCI1950 Z Computa4onal Methods for Biology Lecture 5
CSCI1950 Z Computa4onal Methods for Biology Lecture 5 Ben Raphael February 6, 2009 hip://cs.brown.edu/courses/csci1950 z/ Alignment vs. Distance Matrix Mouse: ACAGTGACGCCACACACGT Gorilla: CCTGCGACGTAACAAACGC
More informationCPSC 421: Tutorial #1
CPSC 421: Tutorial #1 October 14, 2016 Set Theory. 1. Let A be an arbitrary set, and let B = {x A : x / x}. That is, B contains all sets in A that do not contain themselves: For all y, ( ) y B if and only
More informationCSE 373: Data Structures and Algorithms Pep Talk; Algorithm Analysis. Riley Porter Winter 2017
CSE 373: Data Structures and Algorithms Pep Talk; Algorithm Analysis Riley Porter Announcements Op4onal Java Review Sec4on: PAA A102 Tuesday, January 10 th, 3:30-4:30pm. Any materials covered will be posted
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 informationLecture 23: Rice Theorem and Turing machine behavior properties 21 April 2009
CS 373: Theory of Computation Sariel Har-Peled and Madhusudan Parthasarathy Lecture 23: Rice Theorem and Turing machine behavior properties 21 April 2009 This lecture covers Rice s theorem, as well as
More informationCSE 473: Artificial Intelligence Spring 2014
CSE 473: Artificial Intelligence Spring 2014 Hanna Hajishirzi Problem Spaces and Search slides from Dan Klein, Stuart Russell, Andrew Moore, Dan Weld, Pieter Abbeel, Luke Zettelmoyer Outline Agents that
More informationThe Turing Machine. Computability. The Church-Turing Thesis (1936) Theory Hall of Fame. Theory Hall of Fame. Undecidability
The Turing Machine Computability Motivating idea Build a theoretical a human computer Likened to a human with a paper and pencil that can solve problems in an algorithmic way The theoretical provides a
More informationCS415 Compilers Syntax Analysis Top-down Parsing
CS415 Compilers Syntax Analysis Top-down Parsing These slides are based on slides copyrighted by Keith Cooper, Ken Kennedy & Linda Torczon at Rice University Announcements Midterm on Thursday, March 13
More informationCS Lecture 3. More Bayesian Networks
CS 6347 Lecture 3 More Bayesian Networks Recap Last time: Complexity challenges Representing distributions Computing probabilities/doing inference Introduction to Bayesian networks Today: D-separation,
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 informationMath 308 Midterm Answers and Comments July 18, Part A. Short answer questions
Math 308 Midterm Answers and Comments July 18, 2011 Part A. Short answer questions (1) Compute the determinant of the matrix a 3 3 1 1 2. 1 a 3 The determinant is 2a 2 12. Comments: Everyone seemed to
More informationWeek 2: Defining Computation
Computational Complexity Theory Summer HSSP 2018 Week 2: Defining Computation Dylan Hendrickson MIT Educational Studies Program 2.1 Turing Machines Turing machines provide a simple, clearly defined way
More informationCISC 4090: Theory of Computation Chapter 1 Regular Languages. Section 1.1: Finite Automata. What is a computer? Finite automata
CISC 4090: Theory of Computation Chapter Regular Languages Xiaolan Zhang, adapted from slides by Prof. Werschulz Section.: Finite Automata Fordham University Department of Computer and Information Sciences
More informationChapter 4: Computation tree logic
INFOF412 Formal verification of computer systems Chapter 4: Computation tree logic Mickael Randour Formal Methods and Verification group Computer Science Department, ULB March 2017 1 CTL: a specification
More informationClasses of Boolean Functions
Classes of Boolean Functions Nader H. Bshouty Eyal Kushilevitz Abstract Here we give classes of Boolean functions that considered in COLT. Classes of Functions Here we introduce the basic classes of functions
More informationRecall from last time. Lecture 3: Conditional independence and graph structure. Example: A Bayesian (belief) network.
ecall from last time Lecture 3: onditional independence and graph structure onditional independencies implied by a belief network Independence maps (I-maps) Factorization theorem The Bayes ball algorithm
More informationComputational Models Lecture 8 1
Computational Models Lecture 8 1 Handout Mode Ronitt Rubinfeld and Iftach Haitner. Tel Aviv University. April 18/ May 2, 2016 1 Based on frames by Benny Chor, Tel Aviv University, modifying frames by Maurice
More informationComplexity Theory VU , SS The Polynomial Hierarchy. Reinhard Pichler
Complexity Theory Complexity Theory VU 181.142, SS 2018 6. The Polynomial Hierarchy Reinhard Pichler Institut für Informationssysteme Arbeitsbereich DBAI Technische Universität Wien 15 May, 2018 Reinhard
More informationOutline. Complexity Theory EXACT TSP. The Class DP. Definition. Problem EXACT TSP. Complexity of EXACT TSP. Proposition VU 181.
Complexity Theory Complexity Theory Outline Complexity Theory VU 181.142, SS 2018 6. The Polynomial Hierarchy Reinhard Pichler Institut für Informationssysteme Arbeitsbereich DBAI Technische Universität
More informationCS 188: Artificial Intelligence Spring Announcements
CS 188: Artificial Intelligence Spring 2011 Lecture 16: Bayes Nets IV Inference 3/28/2011 Pieter Abbeel UC Berkeley Many slides over this course adapted from Dan Klein, Stuart Russell, Andrew Moore Announcements
More informationComputational Models Lecture 8 1
Computational Models Lecture 8 1 Handout Mode Nachum Dershowitz & Yishay Mansour. Tel Aviv University. May 17 22, 2017 1 Based on frames by Benny Chor, Tel Aviv University, modifying frames by Maurice
More informationCS Algorithms and Complexity
CS 50 - Algorithms and Complexity Linear Programming, the Simplex Method, and Hard Problems Sean Anderson 2/15/18 Portland State University Table of contents 1. The Simplex Method 2. The Graph Problem
More informationECE 5775 (Fall 17) High-Level Digital Design Automation. Control Flow Graph
ECE 5775 (Fall 17) High-Level Digital Design Automation Control Flow Graph Announcements ECE colloquium on Monday 9/11 from 4:30pm, PHL 233 Smart Healthcare by Prof. Niraj Jha of Princeton Lab 1 is due
More informationCSCI 1010 Models of Computa3on. Lecture 02 Func3ons and Circuits
CSCI 1010 Models of Computa3on Lecture 02 Func3ons and Circuits Overview Func3ons and languages Designing circuits from func3ons Minterms and the DNF Maxterms and CNF Circuit complexity Algebra of Boolean
More informationComputational Tasks and Models
1 Computational Tasks and Models Overview: We assume that the reader is familiar with computing devices but may associate the notion of computation with specific incarnations of it. Our first goal is to
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 information8 Priority Queues. 8 Priority Queues. Prim s Minimum Spanning Tree Algorithm. Dijkstra s Shortest Path Algorithm
8 Priority Queues 8 Priority Queues A Priority Queue S is a dynamic set data structure that supports the following operations: S. build(x 1,..., x n ): Creates a data-structure that contains just the elements
More informationCHAPTER 1: Functions
CHAPTER 1: Functions 1.1: Functions 1.2: Graphs of Functions 1.3: Basic Graphs and Symmetry 1.4: Transformations 1.5: Piecewise-Defined Functions; Limits and Continuity in Calculus 1.6: Combining Functions
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 informationCS 6140: Machine Learning Spring What We Learned Last Week 2/26/16
Logis@cs CS 6140: Machine Learning Spring 2016 Instructor: Lu Wang College of Computer and Informa@on Science Northeastern University Webpage: www.ccs.neu.edu/home/luwang Email: luwang@ccs.neu.edu Sign
More informationIntroduction to Automata
Introduction to Automata Seungjin Choi Department of Computer Science and Engineering Pohang University of Science and Technology 77 Cheongam-ro, Nam-gu, Pohang 37673, Korea seungjin@postech.ac.kr 1 /
More informationJASS 06 Report Summary. Circuit Complexity. Konstantin S. Ushakov. May 14, 2006
JASS 06 Report Summary Circuit Complexity Konstantin S. Ushakov May 14, 2006 Abstract Computer science deals with many computational models. In real life we have normal computers that are constructed using,
More informationQuiz 1 Solutions. Problem 2. Asymptotics & Recurrences [20 points] (3 parts)
Introduction to Algorithms October 13, 2010 Massachusetts Institute of Technology 6.006 Fall 2010 Professors Konstantinos Daskalakis and Patrick Jaillet Quiz 1 Solutions Quiz 1 Solutions Problem 1. We
More informationCHAPTER-17. Decision Tree Induction
CHAPTER-17 Decision Tree Induction 17.1 Introduction 17.2 Attribute selection measure 17.3 Tree Pruning 17.4 Extracting Classification Rules from Decision Trees 17.5 Bayesian Classification 17.6 Bayes
More informationCS481F01 Solutions 8
CS481F01 Solutions 8 A. Demers 7 Dec 2001 1. Prob. 111 from p. 344 of the text. One of the following sets is r.e. and the other is not. Which is which? (a) { i L(M i ) contains at least 481 elements }
More information16. Binary Search Trees. [Ottman/Widmayer, Kap. 5.1, Cormen et al, Kap ]
423 16. Binary Search Trees [Ottman/Widmayer, Kap. 5.1, Cormen et al, Kap. 12.1-12.3] Dictionary implementation 424 Hashing: implementation of dictionaries with expected very fast access times. Disadvantages
More informationWeek 3: Reductions and Completeness
Computational Complexity Theory Summer HSSP 2018 Week 3: Reductions and Completeness Dylan Hendrickson MIT Educational Studies Program 3.1 Reductions Suppose I know how to solve some problem quickly. How
More informationDecision Problems with TM s. Lecture 31: Halting Problem. Universe of discourse. Semi-decidable. Look at following sets: CSCI 81 Spring, 2012
Decision Problems with TM s Look at following sets: Lecture 31: Halting Problem CSCI 81 Spring, 2012 Kim Bruce A TM = { M,w M is a TM and w L(M)} H TM = { M,w M is a TM which halts on input w} TOTAL TM
More informationMathematics for Decision Making: An Introduction. Lecture 8
Mathematics for Decision Making: An Introduction Lecture 8 Matthias Köppe UC Davis, Mathematics January 29, 2009 8 1 Shortest Paths and Feasible Potentials Feasible Potentials Suppose for all v V, there
More informationSYLLABUS SEFS 540 / ESRM 490 B Optimization Techniques for Natural Resources Spring 2017
SYLLABUS SEFS 540 / ESRM 490 B Optimization Techniques for Natural Resources Spring 2017 Lectures: Winkenwerder Hall 107, 4:50-5:50pm, MW Labs: Mary Gates Hall 030, 1:30-2:50pm, Th Course Web Site: http://faculty.washington.edu/toths/course.shtml
More informationReduced Ordered Binary Decision Diagrams
Reduced Ordered Binary Decision Diagrams Lecture #12 of Advanced Model Checking Joost-Pieter Katoen Lehrstuhl 2: Software Modeling & Verification E-mail: katoen@cs.rwth-aachen.de December 13, 2016 c JPK
More informationGame Theory and Algorithms Lecture 7: PPAD and Fixed-Point Theorems
Game Theory and Algorithms Lecture 7: PPAD and Fixed-Point Theorems March 17, 2011 Summary: The ultimate goal of this lecture is to finally prove Nash s theorem. First, we introduce and prove Sperner s
More informationCS 553 Compiler Construction Fall 2006 Homework #2 Dominators, Loops, SSA, and Value Numbering
CS 553 Compiler Construction Fall 2006 Homework #2 Dominators, Loops, SSA, and Value Numbering Answers Write your answers on another sheet of paper. Homework assignments are to be completed individually.
More informationProblem Solving in Math (Math 43900) Fall 2013
Problem Solving in Math (Math 43900) Fall 203 Week six (October ) problems recurrences Instructor: David Galvin Definition of a recurrence relation We met recurrences in the induction hand-out. Sometimes
More informationCS5314 Randomized Algorithms. Lecture 15: Balls, Bins, Random Graphs (Hashing)
CS5314 Randomized Algorithms Lecture 15: Balls, Bins, Random Graphs (Hashing) 1 Objectives Study various hashing schemes Apply balls-and-bins model to analyze their performances 2 Chain Hashing Suppose
More information35. SOLVING ABSOLUTE VALUE EQUATIONS
35. SOLVING ABSOLUTE VALUE EQUATIONS solving equations involving absolute value This section presents the tool needed to solve absolute value equations like these: x = 5 2 3x = 7 5 2 3 4x = 7 Each of these
More informationAIMS Education Foundation
Topic Potential and kinetic energy Key Question How does a paper model of a jumping frog illustrate the conversion of elastic potential energy to kinetic energy to gravitational potential energy? Learning
More information16. Binary Search Trees. [Ottman/Widmayer, Kap. 5.1, Cormen et al, Kap ]
418 16. Binary Search Trees [Ottman/Widmayer, Kap. 5.1, Cormen et al, Kap. 12.1-12.3] 419 Dictionary implementation Hashing: implementation of dictionaries with expected very fast access times. Disadvantages
More information1 Some loose ends from last time
Cornell University, Fall 2010 CS 6820: Algorithms Lecture notes: Kruskal s and Borůvka s MST algorithms September 20, 2010 1 Some loose ends from last time 1.1 A lemma concerning greedy algorithms and
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 informationCMPT 710/407 - Complexity Theory Lecture 4: Complexity Classes, Completeness, Linear Speedup, and Hierarchy Theorems
CMPT 710/407 - Complexity Theory Lecture 4: Complexity Classes, Completeness, Linear Speedup, and Hierarchy Theorems Valentine Kabanets September 13, 2007 1 Complexity Classes Unless explicitly stated,
More informationCS151 Complexity Theory
Introduction CS151 Complexity Theory Lecture 5 April 13, 2004 Power from an unexpected source? we know PEXP, which implies no polytime algorithm for Succinct CVAL poly-size Boolean circuits for Succinct
More information27. THESE SENTENCES CERTAINLY LOOK DIFFERENT
27 HESE SENENCES CERAINLY LOOK DIEREN comparing expressions versus comparing sentences a motivating example: sentences that LOOK different; but, in a very important way, are the same Whereas the = sign
More informationSolution suggestions for examination of Logic, Algorithms and Data Structures,
Department of VT12 Software Engineering and Managment DIT725 (TIG023) Göteborg University, Chalmers 24/5-12 Solution suggestions for examination of Logic, Algorithms and Data Structures, Date : April 26,
More informationRela%ons and Their Proper%es. Slides by A. Bloomfield
Rela%ons and Their Proper%es Slides by A. Bloomfield What is a rela%on Let A and B be sets. A binary rela%on R is a subset of A B Example Let A be the students in a the CS major A = {Alice, Bob, Claire,
More informationPart V. Matchings. Matching. 19 Augmenting Paths for Matchings. 18 Bipartite Matching via Flows
Matching Input: undirected graph G = (V, E). M E is a matching if each node appears in at most one Part V edge in M. Maximum Matching: find a matching of maximum cardinality Matchings Ernst Mayr, Harald
More informationIntroduction to Languages and Computation
Introduction to Languages and Computation George Voutsadakis 1 1 Mathematics and Computer Science Lake Superior State University LSSU Math 400 George Voutsadakis (LSSU) Languages and Computation July 2014
More informationCS5371 Theory of Computation. Lecture 12: Computability III (Decidable Languages relating to DFA, NFA, and CFG)
CS5371 Theory of Computation Lecture 12: Computability III (Decidable Languages relating to DFA, NFA, and CFG) Objectives Recall that decidable languages are languages that can be decided by TM (that means,
More informationBinary Decision Diagrams
Binary Decision Diagrams Literature Some pointers: H.R. Andersen, An Introduction to Binary Decision Diagrams, Lecture notes, Department of Information Technology, IT University of Copenhagen Tools: URL:
More informationFrequent Itemsets and Association Rule Mining. Vinay Setty Slides credit:
Frequent Itemsets and Association Rule Mining Vinay Setty vinay.j.setty@uis.no Slides credit: http://www.mmds.org/ Association Rule Discovery Supermarket shelf management Market-basket model: Goal: Identify
More information