Compilers. Topic 4. The Symbol Table and Block Structure PART II. Mick O Donnell: Alfonso Ortega:

Size: px
Start display at page:

Download "Compilers. Topic 4. The Symbol Table and Block Structure PART II. Mick O Donnell: Alfonso Ortega:"

Transcription

1 Compilers Topi 4 The ol Tle nd Blok Struture PART II Mik O Donnell: mihel.odonnell@um.es Alfonso Orteg: lfonso.orteg@um.es Topi 2: Blok Struture 2 1

2 ol tles with lok strutures Blok Struture Progrmming lnguges with lok strutures: Those lnguges in whih some identifiers only exist inside some setions of the ode, nd not in others. For instne, Algol, PL/I, C, Jv, Psl Exmple of progrm with loks: { int, d; { flot d, f; L1: { int i, h; L2: { int ; 3 ol tles with lok strutures Blok Struture Sopes ssoited with eh line of ode: Every line of ode is inside set of loks or sopes. Eh identifier is only vlid within its ssoited loks. Current sope: the sope defined y the deepest lok of the urrent line of ode. Open sopes: All the sopes tht inlude line of ode (diretly, or through other inner sopes) re sid to e open with respet to tht line. Closed sopes: All the sopes tht do not inlude line of ode (diretly, or indiretly) re sid to e losed with respet to tht line. Sope = Amito o loque 4 2

3 ol tles with lok strutures Blok Struture Exmple { int,, ; = 0; = 0; = 0; { int, d; = + 1; d = ; { string ; int ; print ; Sope 2 Sope 3 Sope 1 5 ol tles with lok strutures Conepts Rules to determine whih identifiers re tive: An identifier is tive if: It is defined in the urrent sope, or It is defined in sope whih ontins the urrent one. The vrile is only vlid AFTER the point of delrtion A vrile delrtion pplies for ny lok whih is emedded within the lok where the vrile is defined, nd strts fter the delrtion. Whenever n identifier is delred oth in this sope, nd in prent sope, then the delrtion in the urrent sope is tken. The nmes of the rguments of proedure re lol to tht proedure, nd they re not essile from outside. The sme identifier nnot e defined twie t the sme level. 6 3

4 Topi 3: Use of ol Tles with Blok Struture 7 ol tles with lok strutures In the following, we re ssuming tht we re operting within syntti nlysis of the progrm (nd sometimes semnti nlysis) This is euse sopes (lok struture) nnot e identified t the time of lexil nlysis, whih only sees one token t time, not how these tokens relte to eh other. 8 4

5 ol tles with lok strutures In lnguges without soping, single symol tle suffies: An identifier lwys refers to the sme vrile (or proedure) However, when emedded sopes re possile, the informtion ssoited with n identifier is prtiulr to the sopes it is delred within E.g., fred might refer to string in one lok nd n int in nother We thus need to store nd retrieve informtion out symols reltive to the set of sopes tht the urrent line is within. Two solutions: A distint symol tle for eh sope, giving informtion only out identifiers visile in tht sope. A single symol tle, whih detils, for eh identifier, whih sopes it ours in, nd its ttriutes in tht sope (e.g. its dttype) 9 ol tles with lok strutures One symol tle per sope One symol tle per sope : the si pproh: Eh lok is given seprte symol tle. When line of ode delres vrile (e.g., in the rgument list of proedure delrtion, or in n expliit type delrtion), n entry is reted in the urrent sope s symol tle. When line of ode refers to vrile, the ompiler first tries to retrieve the identifier s reord from the urrent symol tle. If not found, the symol tle of the prent sope is tried This is repeted until n entry is found in n enlosing sope. If none found, then the vrile is referened without delrtion report error (ssuming type delrtion is required). 10 5

6 { int,, ; = 0; = 0; = 0; { int, d; = + 1; d = ; { string ; int ; print ; ol tles with lok strutures One symol tle per sope Blok 2 Blok 3 Blok 1 11 { int,, ; = 0; = 0; = 0; { int, d; = + 1; d = ; { string ; int ; print ; ol tles with lok strutures One symol tle per sope Blok 2 Blok 3 Blok 1 Event: enter new lok Ation: Crete ol Tle 12 6

7 { int,, ; = 0; = 0; = 0; { int, d; = + 1; d = ; { string ; int ; print ; ol tles with lok strutures One symol tle per sope Blok 2 Blok 3 Blok 1 Event: enter new lok Ation: Crete ol Tle 13 { int,, ; = 0; = 0; = 0; { int, d; = + 1; d = ; { string ; int ; print ; ol tles with lok strutures One symol tle per sope Blok 2 Blok 3 Blok 1 Event: reognise type de Ation: Add to urrent symol tle No No No 14 7

8 { int,, ; = 0; = 0; = 0; { int, d; = + 1; d = ; { string ; int ; print ; ol tles with lok strutures One symol tle per sope Blok 2 Blok 3 Blok 1 Event: vrile ssignment Query: Found in urrent ST? Ation: Mrk s initited No No 15 { int,, ; = 0; = 0; = 0; { int, d; = + 1; d = ; { string ; int ; print ; ol tles with lok strutures One symol tle per sope Blok 2 Blok 3 Blok 1 Event: vrile ssignment Query: Found in urrent ST? Ation: Mrk s initited No 16 8

9 { int,, ; = 0; = 0; = 0; { int, d; = + 1; d = ; { string ; int ; print ; ol tles with lok strutures One symol tle per sope Blok 2 Blok 3 Blok 1 Event: vrile ssignment Query: Found in urrent ST? Ation: Mrk s initited 17 { int,, ; = 0; = 0; = 0; { int, d; = + 1; d = ; { string ; int ; print ; ol tles with lok strutures One symol tle per sope Blok 2 Blok 3 Blok 1 Event: Enter new lok Ation: Crete new Tle ST2 18 9

10 { int,, ; = 0; = 0; = 0; { int, d; = + 1; d = ; { string ; int ; print ; ol tles with lok strutures One symol tle per sope Blok 2 Blok 3 Blok 1 Event: reognise type de Ation: Add to urrent symol tle ST2 d No No 19 { int,, ; = 0; = 0; = 0; { int, d; = + 1; d = ; { string ; int ; print ; ol tles with lok strutures One symol tle per sope Blok 2 Blok 3 Blok 1 Event: vrile ssignment () Query: Found in urrent ST? Ation: Mrk s initited ST2 d No 20 10

11 { int,, ; = 0; = 0; = 0; { int, d; = + 1; d = ; { string ; int ; print ; ol tles with lok strutures One symol tle per sope Blok 2 Blok 3 Blok 1 ST2 Event: vrile referene to Query: Found in urrent ST? NO Query: Found in prent ST? YES Query: Initited in prent ST? YES d No 21 ol tles with lok strutures One symol tle per sope Note: the previous exmple demonstrtes semnti heking When n identifier is found: Vrile Delrtion: i) Return error if not first delrtion of vrile in urrent sope ii) Else, dd entry for vrile in urrent symol tle Vrile Assignment: i) Find the first sope in whih the vrile is delred ii) Return error if not delred in sope iii) Set the STATE to initited Vrile Referene: i) Find the first sope in whih the vrile is delred ii) Return error if the vrile is not delred nd initited 22 11

12 ol tles with lok strutures One symol tle per sope : single pss One pss ompilers: Sometimes the ompiler mkes single pss over the input token strem, nd sometimes two or more psses re mde. If single pss, then one sope is exited, the symol tle of tht sope will not e referened gin. The symol tle of losed sope n thus e lered from memory (for memory effiieny). Therefore, in one-pss ompilers, the list of open sopes n e implemented s LIFO stk. 23 { int,, ; = 0; = 0; = 0; { int, d; = + 1; d = ; { string ; int ; print ; ol tles with lok strutures One symol tle per sope : single pss Blok 2 Blok 3 Blok 1 ST2 d No 24 12

13 { int,, ; = 0; = 0; = 0; { int, d; = + 1; d = ; { string ; int ; print ; ol tles with lok strutures One symol tle per sope : single pss Blok 2 Blok 3 Blok 1 ST2 d 25 { int,, ; = 0; = 0; = 0; { int, d; = + 1; d = ; { string ; int ; print ; ol tles with lok strutures One symol tle per sope : single pss Blok 2 Blok 3 Blok 1 ST2 d 26 13

14 { int,, ; = 0; = 0; = 0; { int, d; = + 1; d = ; { string ; int ; print ; ol tles with lok strutures One symol tle per sope : single pss Blok 2 Blok 3 Blok 1 27 { int,, ; = 0; = 0; = 0; { int, d; = + 1; d = ; { string ; int ; print ; ol tles with lok strutures One symol tle per sope : single pss Blok 2 Blok 3 Blok 1 ST

15 Insertion lgorithm: ol tles with lok strutures One symol tle per sope: single pss sttus insert(id key, SopeTle T) { if exists(key, urrent_sope(t) return FAIL; insert_key( key, urrent_sope(t) ); 29 ol tles with lok strutures One tle per sope, single pss Serh lgorithm: Hsh_entry serh(id key, SopeTle T) { HshTle symtle; symtle = urrent_sope(t); while (not empty_hsh_tle(symtle)) { If exists(key, symtle) return symtle; symtle=next_tle(symtle,t); return NULL; 30 15

16 ol tles with lok strutures One tle per sope: multiple psses Multiple Pss Compilers: However, if the ompiler mkes multiple psses, then eh sope s symol tle needs to e preserved for lter user. One nnot use LIFO stk. One solution: Dt struture to reord struture of sopes (e.g., n ojet for eh sope, with pointer to its prent sope) Eh sope ojet lso hs pointer to the symol tle for tht sope. 31 ol tles with lok strutures One symol tle per sope: multiple psses { int,, ; = 0; = 0; = 0; { int, d; = + 1; d = ; { string ; int ; print ; Blok 2 Blok 3 Blok 1 ST2 d 32 16

17 { int,, ; = 0; = 0; = 0; { int, d; = + 1; d = ; { string ; int ; print ; ol tles with lok strutures One symol tle per sope : multiple psses Blok 2 Blok 3 Blok 1 ST2 d 33 { int,, ; = 0; = 0; = 0; { int, d; = + 1; d = ; { string ; int ; print ; ol tles with lok strutures One symol tle per sope : multiple psses Blok 2 Blok 3 Blok 1 ST2 d ST

18 ol tles with lok strutures One symol tle per sope : multiple psses Multiple Pss Compilers: Note tht the set of symol tles is not stored s stk. Better to use tree struture, eh symol tle pointing to the symol tle for the sope tht ontins it. Open sopes = urrent sope plus ll prent sopes k to the root. ST2 ST4 ST3 ST4 35 Topi 4: Deling with Blok Struture with Single ol Tle 36 18

19 ol tles with lok strutures Just one symol tle An lterntive is to use just single hsh tle. All the identifiers will e inserted in the sme tle. Eh identifier will hve informtion out the sope to whih it elongs. Possile implementtion: Using An rry for the dt out the loks. Other for the identifiers. It my e just one struture tht uses the end for the identifiers of the open loks, nd the eginning for the ids. of the losed ones. On the other hnd, there might e two: one for the open sopes nd one for the losed sopes. Eh lok will ontin the following informtion: Blok numer. Numer of the prent lok. Numer of identifiers in this lok. Pointer to the informtion of the identifiers in this lok. 37 ol tles with lok strutures Multiple sopes, Just one symol tle The prolem: Eh hsh tle requires memory overhed Thus using hsh tle for eh sope is memory ineffiient We my e required to serh in multiple symol tles, Thus less effiient for speed s well Solution: Use single hsh tle for ll sopes Less memory overhed (perhps) Only one serh required

20 ol tles with lok strutures Multiple sopes, Just one symol tle Solution 1: Eh sope hs unique numer 1. Strt sope_id = 0 (for glol sope) 2. For eh new sope, inrement sope_id When entering n identifier into the symol tle, use identifier,sope_id s the key. To find the symol tle entry for n identifier 1. Append the urrent sope_id to the identifier nd look for tht 2. If tht fils, try the prent sope, et. until it is found BUT still my require multiple serhes! 39 ol tles with lok strutures Multiple sopes, Just one symol tle Solution 2: identifier returns linked list of usges of identifier ol tle: Key = identifier Vlue = linked list of pointers to reords, one for eh usge of the identifier. Sope_id Dt pointer A ol dt 40 20

21 ol tles with lok strutures Multiple sopes, Just one symol tle If single pss ompiler, 1. Eh new insertion of n identifier is t front of the linked list 2. A seprte struture keeps trk of ll identifiers defined in the urrent sope 3. When exiting the sope, one uses the list in (2) to delete the frontmost element in eh linked list. A ol tles with lok strutures Multiple sopes, Just one symol tle If single pss ompiler, 1. Eh new insertion of n identifier is t front of the linked list 2. A seprte struture keeps trk of ll identifiers defined in the urrent sope 3. When exiting the sope, one uses the list in (2) to delete the frontmost element in eh linked list. A

22 ol tles with lok strutures Multiple sopes, Just one symol tle Using this pproh: ll entries on the symol tle re in open sopes (potentilly ville within the urrent lok of ode) The front item on the linked list is lwys the pproprite one in the urrent sope (it ws either defined in the urrent sope, or in prent sope of the urrent sope) A Summry of ol Tles 1. ol tle for lnguges without lok struture 2. ol tle for lnguges with lok struture 1. One Tle per sope: single pss 2. One Tle per sope: Multiple Pss 3. One Tle for ll sopes 44 22

23 Pst Exm Questions 45 During the semnti nlysis, the tle of symols is used to verify tht the identifiers re used in n pproprite wy. Wht semnti verifitions re rried out using the tle of symols when: ) se delr un vrile (por ejemplo, int v;) ) se le sign vlor un vrile (por ejemplo, v = 7;) ) se he refereni un vrile (por ejemplo, w = v * 8;) 46 23

24 PAST EXAM QUESTIONS 1. Ddo el siguiente progrm { // Líne 1 int x,y; // Líne 2 { // Líne 3 int z; // Líne 4 { // Líne 5 int p; // Líne 6 // Líne 7 int q; // Líne 8 { // Líne 9 int r; // Líne 10 r = z + 3; // Líne 11 // Líne 12 int s; // Líne 13 // Líne 14 { // Líne 15 int t; // Líne 16 // Líne 17 // Líne 18 () Mostrr el ontenido de l tl de símolos después de ompilr d un de ls línes mrds on suponiendo que se utiliz un ompildor de un psd y un tl de símolos por loque. Los loques deen nomrrse utilizndo l notión Bn, donde n es un numero distinto pr d loque. Pr d identifidor solo dee inluirse su nomre. () Al ompilr l instruión de l líne 8 uánts operiones de úsqued se llevrán o y en qué orden? Espeifir pr d un de ells el motivo de l úsqued y qué loque orresponde l tl en l que se reliz l úsqued. () Al ompilr l instruión de l líne 11 uánts operiones de úsqued se llevrán o y en qué orden? Espeifir pr d un de ells el motivo de l úsqued y qué loque orresponde l tl en l que se reliz l úsqued Se dese relizr un ompildor de un psd pr el lenguje ASPLE que está estudindo en ls prátis y que, por lo tnto, dmite funiones. Pr su tl de símolos se v utilizr un tl hsh pr d ámito. Considere los siguientes progrms ASPLE. Pr d uno de ellos se le pide: egin int ; int ; funtion int FRr(int ; int ) egin int ; # (1) input ; return ++ end # (2) input ; input ; output FRr(,) end egin int ; int ; funtion int FRr(int ) egin int ; # (1) input ; return ++ end # (2) input ; input ; output FRr() end (1) Indir explíitmente los errores de ompilión, en el so de que se produzn. Explique revemente l us de los mismos. (2) Si los progrms son orretos, muestre el ontenido de ls tls de símolos (omplets) en los puntos mrdos on (1) y (2). Explique revemente el ontenido de ls tls

CS 241 Week 4 Tutorial Solutions

CS 241 Week 4 Tutorial Solutions CS 4 Week 4 Tutoril Solutions Writing n Assemler, Prt & Regulr Lnguges Prt Winter 8 Assemling instrutions utomtilly. slt $d, $s, $t. Solution: $d, $s, nd $t ll fit in -it signed integers sine they re 5-it

More information

Type Checking. Roadmap (Where are we?) Last lecture Context-sensitive analysis. This lecture Type checking. Symbol tables

Type Checking. Roadmap (Where are we?) Last lecture Context-sensitive analysis. This lecture Type checking. Symbol tables Type Cheking Rodmp (Where re we?) Lst leture Contet-sensitie nlysis Motition Attriute grmmrs Ad ho Synt-direted trnsltion This leture Type heking Type systems Using synt direted trnsltion Symol tles Leil

More information

CS553 Lecture Introduction to Data-flow Analysis 1

CS553 Lecture Introduction to Data-flow Analysis 1 ! Ide Introdution to Dt-flow nlysis!lst Time! Implementing Mrk nd Sweep GC!Tody! Control flow grphs! Liveness nlysis! Register llotion CS553 Leture Introdution to Dt-flow Anlysis 1 Dt-flow Anlysis! Dt-flow

More information

INTEGRATED WORKFLOW ART DIRECTOR

INTEGRATED WORKFLOW ART DIRECTOR ART DIRECTOR Progrm Resoures INTEGRATED WORKFLOW PROGRAM PLANNING PHASE In this workflow phse proess, you ollorte with the Progrm Mnger, the Projet Mnger, nd the Art Speilist/ Imge Led to updte the resoures

More information

CS453 INTRODUCTION TO DATAFLOW ANALYSIS

CS453 INTRODUCTION TO DATAFLOW ANALYSIS CS453 INTRODUCTION TO DATAFLOW ANALYSIS CS453 Leture Register llotion using liveness nlysis 1 Introdution to Dt-flow nlysis Lst Time Register llotion for expression trees nd lol nd prm vrs Tody Register

More information

From Dependencies to Evaluation Strategies

From Dependencies to Evaluation Strategies From Dependencies to Evlution Strtegies Possile strtegies: 1 let the user define the evlution order 2 utomtic strtegy sed on the dependencies: use locl dependencies to determine which ttriutes to compute

More information

Introduction to Algebra

Introduction to Algebra INTRODUCTORY ALGEBRA Mini-Leture 1.1 Introdution to Alger Evlute lgeri expressions y sustitution. Trnslte phrses to lgeri expressions. 1. Evlute the expressions when =, =, nd = 6. ) d) 5 10. Trnslte eh

More information

CS201 Discussion 10 DRAWTREE + TRIES

CS201 Discussion 10 DRAWTREE + TRIES CS201 Discussion 10 DRAWTREE + TRIES DrwTree First instinct: recursion As very generic structure, we could tckle this problem s follows: drw(): Find the root drw(root) drw(root): Write the line for the

More information

Table-driven look-ahead lexical analysis

Table-driven look-ahead lexical analysis Tle-riven look-he lexil nlysis WUU YANG Computer n Informtion Siene Deprtment Ntionl Chio-Tung University, HsinChu, Tiwn, R.O.C. Astrt. Moern progrmming lnguges use regulr expressions to efine vli tokens.

More information

box Boxes and Arrows 3 true 7.59 'X' An object is drawn as a box that contains its data members, for example:

box Boxes and Arrows 3 true 7.59 'X' An object is drawn as a box that contains its data members, for example: Boxes nd Arrows There re two kinds of vriles in Jv: those tht store primitive vlues nd those tht store references. Primitive vlues re vlues of type long, int, short, chr, yte, oolen, doule, nd flot. References

More information

Fig.25: the Role of LEX

Fig.25: the Role of LEX The Lnguge for Specifying Lexicl Anlyzer We shll now study how to uild lexicl nlyzer from specifiction of tokens in the form of list of regulr expressions The discussion centers round the design of n existing

More information

CS 340, Fall 2016 Sep 29th Exam 1 Note: in all questions, the special symbol ɛ (epsilon) is used to indicate the empty string.

CS 340, Fall 2016 Sep 29th Exam 1 Note: in all questions, the special symbol ɛ (epsilon) is used to indicate the empty string. CS 340, Fll 2016 Sep 29th Exm 1 Nme: Note: in ll questions, the speil symol ɛ (epsilon) is used to indite the empty string. Question 1. [10 points] Speify regulr expression tht genertes the lnguge over

More information

Error Numbers of the Standard Function Block

Error Numbers of the Standard Function Block A.2.2 Numers of the Stndrd Funtion Blok evlution The result of the logi opertion RLO is set if n error ours while the stndrd funtion lok is eing proessed. This llows you to rnh to your own error evlution

More information

Midterm Exam CSC October 2001

Midterm Exam CSC October 2001 Midterm Exm CSC 173 23 Otoer 2001 Diretions This exm hs 8 questions, severl of whih hve suprts. Eh question indites its point vlue. The totl is 100 points. Questions 5() nd 6() re optionl; they re not

More information

Duality in linear interval equations

Duality in linear interval equations Aville online t http://ijim.sriu..ir Int. J. Industril Mthemtis Vol. 1, No. 1 (2009) 41-45 Dulity in liner intervl equtions M. Movhedin, S. Slhshour, S. Hji Ghsemi, S. Khezerloo, M. Khezerloo, S. M. Khorsny

More information

In the last lecture, we discussed how valid tokens may be specified by regular expressions.

In the last lecture, we discussed how valid tokens may be specified by regular expressions. LECTURE 5 Scnning SYNTAX ANALYSIS We know from our previous lectures tht the process of verifying the syntx of the progrm is performed in two stges: Scnning: Identifying nd verifying tokens in progrm.

More information

Reducing a DFA to a Minimal DFA

Reducing a DFA to a Minimal DFA Lexicl Anlysis - Prt 4 Reducing DFA to Miniml DFA Input: DFA IN Assume DFA IN never gets stuck (dd ded stte if necessry) Output: DFA MIN An equivlent DFA with the minimum numer of sttes. Hrry H. Porter,

More information

Distributed Systems Principles and Paradigms. Chapter 11: Distributed File Systems

Distributed Systems Principles and Paradigms. Chapter 11: Distributed File Systems Distriuted Systems Priniples nd Prdigms Mrten vn Steen VU Amsterdm, Dept. Computer Siene steen@s.vu.nl Chpter 11: Distriuted File Systems Version: Deemer 10, 2012 2 / 14 Distriuted File Systems Distriuted

More information

Containers: Queue and List

Containers: Queue and List Continers: Queue n List Queue A ontiner in whih insertion is one t one en (the til) n eletion is one t the other en (the he). Also lle FIFO (First-In, First-Out) Jori Cortell n Jori Petit Deprtment of

More information

Lexical Analysis. Amitabha Sanyal. (www.cse.iitb.ac.in/ as) Department of Computer Science and Engineering, Indian Institute of Technology, Bombay

Lexical Analysis. Amitabha Sanyal. (www.cse.iitb.ac.in/ as) Department of Computer Science and Engineering, Indian Institute of Technology, Bombay Lexicl Anlysis Amith Snyl (www.cse.iit.c.in/ s) Deprtment of Computer Science nd Engineering, Indin Institute of Technology, Bomy Septemer 27 College of Engineering, Pune Lexicl Anlysis: 2/6 Recp The input

More information

Midterm 2 Sample solution

Midterm 2 Sample solution Nme: Instructions Midterm 2 Smple solution CMSC 430 Introduction to Compilers Fll 2012 November 28, 2012 This exm contins 9 pges, including this one. Mke sure you hve ll the pges. Write your nme on the

More information

CMPUT101 Introduction to Computing - Summer 2002

CMPUT101 Introduction to Computing - Summer 2002 CMPUT Introdution to Computing - Summer 22 %XLOGLQJ&RPSXWHU&LUFXLWV Chpter 4.4 3XUSRVH We hve looked t so fr how to uild logi gtes from trnsistors. Next we will look t how to uild iruits from logi gtes,

More information

Lecture 13: Graphs I: Breadth First Search

Lecture 13: Graphs I: Breadth First Search Leture 13 Grphs I: BFS 6.006 Fll 2011 Leture 13: Grphs I: Bredth First Serh Leture Overview Applitions of Grph Serh Grph Representtions Bredth-First Serh Rell: Grph G = (V, E) V = set of verties (ritrry

More information

V = set of vertices (vertex / node) E = set of edges (v, w) (v, w in V)

V = set of vertices (vertex / node) E = set of edges (v, w) (v, w in V) Definitions G = (V, E) V = set of verties (vertex / noe) E = set of eges (v, w) (v, w in V) (v, w) orere => irete grph (igrph) (v, w) non-orere => unirete grph igrph: w is jent to v if there is n ege from

More information

cisc1110 fall 2010 lecture VI.2 call by value function parameters another call by value example:

cisc1110 fall 2010 lecture VI.2 call by value function parameters another call by value example: cisc1110 fll 2010 lecture VI.2 cll y vlue function prmeters more on functions more on cll y vlue nd cll y reference pssing strings to functions returning strings from functions vrile scope glol vriles

More information

CS321 Languages and Compiler Design I. Winter 2012 Lecture 5

CS321 Languages and Compiler Design I. Winter 2012 Lecture 5 CS321 Lnguges nd Compiler Design I Winter 2012 Lecture 5 1 FINITE AUTOMATA A non-deterministic finite utomton (NFA) consists of: An input lphet Σ, e.g. Σ =,. A set of sttes S, e.g. S = {1, 3, 5, 7, 11,

More information

Lexical analysis, scanners. Construction of a scanner

Lexical analysis, scanners. Construction of a scanner Lexicl nlysis scnners (NB. Pges 4-5 re for those who need to refresh their knowledge of DFAs nd NFAs. These re not presented during the lectures) Construction of scnner Tools: stte utomt nd trnsition digrms.

More information

Distance vector protocol

Distance vector protocol istne vetor protool Irene Finohi finohi@i.unirom.it Routing Routing protool Gol: etermine goo pth (sequene of routers) thru network from soure to Grph strtion for routing lgorithms: grph noes re routers

More information

LINX MATRIX SWITCHERS FIRMWARE UPDATE INSTRUCTIONS FIRMWARE VERSION

LINX MATRIX SWITCHERS FIRMWARE UPDATE INSTRUCTIONS FIRMWARE VERSION Overview LINX MATRIX SWITCHERS FIRMWARE UPDATE INSTRUCTIONS FIRMWARE VERSION 4.4.1.0 Due to the omplex nture of this updte, plese fmilirize yourself with these instrutions nd then ontt RGB Spetrum Tehnil

More information

COMP 423 lecture 11 Jan. 28, 2008

COMP 423 lecture 11 Jan. 28, 2008 COMP 423 lecture 11 Jn. 28, 2008 Up to now, we hve looked t how some symols in n lphet occur more frequently thn others nd how we cn sve its y using code such tht the codewords for more frequently occuring

More information

CS 432 Fall Mike Lam, Professor a (bc)* Regular Expressions and Finite Automata

CS 432 Fall Mike Lam, Professor a (bc)* Regular Expressions and Finite Automata CS 432 Fll 2017 Mike Lm, Professor (c)* Regulr Expressions nd Finite Automt Compiltion Current focus "Bck end" Source code Tokens Syntx tree Mchine code chr dt[20]; int min() { flot x = 42.0; return 7;

More information

Implementing Automata. CSc 453. Compilers and Systems Software. 4 : Lexical Analysis II. Department of Computer Science University of Arizona

Implementing Automata. CSc 453. Compilers and Systems Software. 4 : Lexical Analysis II. Department of Computer Science University of Arizona Implementing utomt Sc 5 ompilers nd Systems Softwre : Lexicl nlysis II Deprtment of omputer Science University of rizon collerg@gmil.com opyright c 009 hristin ollerg NFs nd DFs cn e hrd-coded using this

More information

Lesson 4.4. Euler Circuits and Paths. Explore This

Lesson 4.4. Euler Circuits and Paths. Explore This Lesson 4.4 Euler Ciruits nd Pths Now tht you re fmilir with some of the onepts of grphs nd the wy grphs onvey onnetions nd reltionships, it s time to egin exploring how they n e used to model mny different

More information

Distributed Systems Principles and Paradigms

Distributed Systems Principles and Paradigms Distriuted Systems Priniples nd Prdigms Christoph Dorn Distriuted Systems Group, Vienn University of Tehnology.dorn@infosys.tuwien..t http://www.infosys.tuwien..t/stff/dorn Slides dpted from Mrten vn Steen,

More information

COMPUTER EDUCATION TECHNIQUES, INC. (WEBLOGIC_SVR_ADM ) SA:

COMPUTER EDUCATION TECHNIQUES, INC. (WEBLOGIC_SVR_ADM ) SA: In orer to lern whih questions hve een nswere orretly: 1. Print these pges. 2. Answer the questions. 3. Sen this ssessment with the nswers vi:. FAX to (212) 967-3498. Or. Mil the nswers to the following

More information

Discussion 1 Recap. COP4600 Discussion 2 OS concepts, System call, and Assignment 1. Questions. Questions. Outline. Outline 10/24/2010

Discussion 1 Recap. COP4600 Discussion 2 OS concepts, System call, and Assignment 1. Questions. Questions. Outline. Outline 10/24/2010 COP4600 Discussion 2 OS concepts, System cll, nd Assignment 1 TA: Hufeng Jin hj0@cise.ufl.edu Discussion 1 Recp Introduction to C C Bsic Types (chr, int, long, flot, doule, ) C Preprocessors (#include,

More information

Pattern Matching. Pattern Matching. Pattern Matching. Review of Regular Expressions

Pattern Matching. Pattern Matching. Pattern Matching. Review of Regular Expressions Pttern Mthing Pttern Mthing Some of these leture slides hve een dpted from: lgorithms in C, Roert Sedgewik. Gol. Generlize string serhing to inompletely speified ptterns. pplitions. Test if string or its

More information

Problem Final Exam Set 2 Solutions

Problem Final Exam Set 2 Solutions CSE 5 5 Algoritms nd nd Progrms Prolem Finl Exm Set Solutions Jontn Turner Exm - //05 0/8/0. (5 points) Suppose you re implementing grp lgoritm tt uses ep s one of its primry dt strutures. Te lgoritm does

More information

Paradigm 5. Data Structure. Suffix trees. What is a suffix tree? Suffix tree. Simple applications. Simple applications. Algorithms

Paradigm 5. Data Structure. Suffix trees. What is a suffix tree? Suffix tree. Simple applications. Simple applications. Algorithms Prdigm. Dt Struture Known exmples: link tble, hep, Our leture: suffix tree Will involve mortize method tht will be stressed shortly in this ourse Suffix trees Wht is suffix tree? Simple pplitions History

More information

A Tautology Checker loosely related to Stålmarck s Algorithm by Martin Richards

A Tautology Checker loosely related to Stålmarck s Algorithm by Martin Richards A Tutology Checker loosely relted to Stålmrck s Algorithm y Mrtin Richrds mr@cl.cm.c.uk http://www.cl.cm.c.uk/users/mr/ University Computer Lortory New Museum Site Pemroke Street Cmridge, CB2 3QG Mrtin

More information

10.2 Graph Terminology and Special Types of Graphs

10.2 Graph Terminology and Special Types of Graphs 10.2 Grph Terminology n Speil Types of Grphs Definition 1. Two verties u n v in n unirete grph G re lle jent (or neighors) in G iff u n v re enpoints of n ege e of G. Suh n ege e is lle inient with the

More information

Languages. L((a (b)(c))*) = { ε,a,bc,aa,abc,bca,... } εw = wε = w. εabba = abbaε = abba. (a (b)(c)) *

Languages. L((a (b)(c))*) = { ε,a,bc,aa,abc,bca,... } εw = wε = w. εabba = abbaε = abba. (a (b)(c)) * Pln for Tody nd Beginning Next week Interpreter nd Compiler Structure, or Softwre Architecture Overview of Progrmming Assignments The MeggyJv compiler we will e uilding. Regulr Expressions Finite Stte

More information

Quiz2 45mins. Personal Number: Problem 1. (20pts) Here is an Table of Perl Regular Ex

Quiz2 45mins. Personal Number: Problem 1. (20pts) Here is an Table of Perl Regular Ex Long Quiz2 45mins Nme: Personl Numer: Prolem. (20pts) Here is n Tle of Perl Regulr Ex Chrcter Description. single chrcter \s whitespce chrcter (spce, t, newline) \S non-whitespce chrcter \d digit (0-9)

More information

Package Contents. Wireless-G USB Network Adapter with SpeedBooster USB Cable Setup CD-ROM with User Guide (English only) Quick Installation

Package Contents. Wireless-G USB Network Adapter with SpeedBooster USB Cable Setup CD-ROM with User Guide (English only) Quick Installation A Division of Ciso Systems, In. Pkge Contents Wireless-G USB Network Adpter with SpeedBooster USB Cle Setup CD-ROM with User Guide (English only) Quik Instlltion 2,4 GHz 802.11g Wireless Model No. Model

More information

Chapter 9. Greedy Technique. Copyright 2007 Pearson Addison-Wesley. All rights reserved.

Chapter 9. Greedy Technique. Copyright 2007 Pearson Addison-Wesley. All rights reserved. Chpter 9 Greey Tehnique Copyright 2007 Person Aison-Wesley. All rights reserve. Greey Tehnique Construts solution to n optimiztion prolem piee y piee through sequene of hoies tht re: fesile lolly optiml

More information

c s ha2 c s Half Adder Figure 2: Full Adder Block Diagram

c s ha2 c s Half Adder Figure 2: Full Adder Block Diagram Adder Tk: Implement 2-it dder uing 1-it full dder nd 1-it hlf dder omponent (Figure 1) tht re onneted together in top-level module. Derie oth omponent in VHDL. Prepre two implementtion where VHDL omponent

More information

McAfee Web Gateway

McAfee Web Gateway Relese Notes Revision C MAfee We Gtewy 7.6.2.11 Contents Aout this relese Enhnement Resolved issues Instlltion instrutions Known issues Additionl informtion Find produt doumenttion Aout this relese This

More information

Lecture 10 Evolutionary Computation: Evolution strategies and genetic programming

Lecture 10 Evolutionary Computation: Evolution strategies and genetic programming Lecture 10 Evolutionry Computtion: Evolution strtegies nd genetic progrmming Evolution strtegies Genetic progrmming Summry Negnevitsky, Person Eduction, 2011 1 Evolution Strtegies Another pproch to simulting

More information

ΕΠΛ323 - Θεωρία και Πρακτική Μεταγλωττιστών

ΕΠΛ323 - Θεωρία και Πρακτική Μεταγλωττιστών ΕΠΛ323 - Θωρία και Πρακτική Μταγλωττιστών Lecture 3 Lexicl Anlysis Elis Athnsopoulos elisthn@cs.ucy.c.cy Recognition of Tokens if expressions nd reltionl opertors if è if then è then else è else relop

More information

CS 241. Fall 2017 Midterm Review Solutions. October 24, Bits and Bytes 1. 3 MIPS Assembler 6. 4 Regular Languages 7.

CS 241. Fall 2017 Midterm Review Solutions. October 24, Bits and Bytes 1. 3 MIPS Assembler 6. 4 Regular Languages 7. CS 241 Fll 2017 Midterm Review Solutions Octoer 24, 2017 Contents 1 Bits nd Bytes 1 2 MIPS Assemly Lnguge Progrmming 2 3 MIPS Assemler 6 4 Regulr Lnguges 7 5 Scnning 9 1 Bits nd Bytes 1. Give two s complement

More information

COSC 6374 Parallel Computation. Non-blocking Collective Operations. Edgar Gabriel Fall Overview

COSC 6374 Parallel Computation. Non-blocking Collective Operations. Edgar Gabriel Fall Overview COSC 6374 Prllel Computtion Non-loking Colletive Opertions Edgr Griel Fll 2014 Overview Impt of olletive ommunition opertions Impt of ommunition osts on Speedup Crtesin stenil ommunition All-to-ll ommunition

More information

10.5 Graphing Quadratic Functions

10.5 Graphing Quadratic Functions 0.5 Grphing Qudrtic Functions Now tht we cn solve qudrtic equtions, we wnt to lern how to grph the function ssocited with the qudrtic eqution. We cll this the qudrtic function. Grphs of Qudrtic Functions

More information

COMP108 Algorithmic Foundations

COMP108 Algorithmic Foundations Grph Theory Prudene Wong http://www.s.liv..uk/~pwong/tehing/omp108/201617 How to Mesure 4L? 3L 5L 3L ontiner & 5L ontiner (without mrk) infinite supply of wter You n pour wter from one ontiner to nother

More information

this grammar generates the following language: Because this symbol will also be used in a later step, it receives the

this grammar generates the following language: Because this symbol will also be used in a later step, it receives the LR() nlysis Drwcks of LR(). Look-hed symols s eplined efore, concerning LR(), it is possile to consult the net set to determine, in the reduction sttes, for which symols it would e possile to perform reductions.

More information

CS412/413. Introduction to Compilers Tim Teitelbaum. Lecture 4: Lexical Analyzers 28 Jan 08

CS412/413. Introduction to Compilers Tim Teitelbaum. Lecture 4: Lexical Analyzers 28 Jan 08 CS412/413 Introduction to Compilers Tim Teitelum Lecture 4: Lexicl Anlyzers 28 Jn 08 Outline DFA stte minimiztion Lexicl nlyzers Automting lexicl nlysis Jlex lexicl nlyzer genertor CS 412/413 Spring 2008

More information

WORKSHOP 9 HEX MESH USING SWEEP VECTOR

WORKSHOP 9 HEX MESH USING SWEEP VECTOR WORKSHOP 9 HEX MESH USING SWEEP VECTOR WS9-1 WS9-2 Prolem Desription This exerise involves importing urve geometry from n IGES file. The urves re use to rete other urves. From the urves trimme surfes re

More information

What are suffix trees?

What are suffix trees? Suffix Trees 1 Wht re suffix trees? Allow lgorithm designers to store very lrge mount of informtion out strings while still keeping within liner spce Allow users to serch for new strings in the originl

More information

Computational geometry

Computational geometry Leture 23 Computtionl geometry Supplementl reding in CLRS: Chpter 33 exept 33.3 There re mny importnt prolems in whih the reltionships we wish to nlyze hve geometri struture. For exmple, omputtionl geometry

More information

Tries. Yufei Tao KAIST. April 9, Y. Tao, April 9, 2013 Tries

Tries. Yufei Tao KAIST. April 9, Y. Tao, April 9, 2013 Tries Tries Yufei To KAIST April 9, 2013 Y. To, April 9, 2013 Tries In this lecture, we will discuss the following exct mtching prolem on strings. Prolem Let S e set of strings, ech of which hs unique integer

More information

Symbol Table management

Symbol Table management TDDD Compilers nd interpreters TDDB44 Compiler Construction Symol Tles Symol Tles in the Compiler Symol Tle mngement source progrm Leicl nlysis Syntctic nlysis Semntic nlysis nd Intermedite code gen Code

More information

Product of polynomials. Introduction to Programming (in C++) Numerical algorithms. Product of polynomials. Product of polynomials

Product of polynomials. Introduction to Programming (in C++) Numerical algorithms. Product of polynomials. Product of polynomials Product of polynomils Introduction to Progrmming (in C++) Numericl lgorithms Jordi Cortdell, Ricrd Gvldà, Fernndo Orejs Dept. of Computer Science, UPC Given two polynomils on one vrile nd rel coefficients,

More information

CS 551 Computer Graphics. Hidden Surface Elimination. Z-Buffering. Basic idea: Hidden Surface Removal

CS 551 Computer Graphics. Hidden Surface Elimination. Z-Buffering. Basic idea: Hidden Surface Removal CS 55 Computer Grphis Hidden Surfe Removl Hidden Surfe Elimintion Ojet preision lgorithms: determine whih ojets re in front of others Uses the Pinter s lgorithm drw visile surfes from k (frthest) to front

More information

CSc 453. Compilers and Systems Software. 4 : Lexical Analysis II. Department of Computer Science University of Arizona

CSc 453. Compilers and Systems Software. 4 : Lexical Analysis II. Department of Computer Science University of Arizona CSc 453 Compilers nd Systems Softwre 4 : Lexicl Anlysis II Deprtment of Computer Science University of Arizon collerg@gmil.com Copyright c 2009 Christin Collerg Implementing Automt NFAs nd DFAs cn e hrd-coded

More information

WORKSHOP 19 GLOBAL/LOCAL MODELING USING FEM FIELDS

WORKSHOP 19 GLOBAL/LOCAL MODELING USING FEM FIELDS WORKSHOP 19 GLOBAL/LOCAL MODELING USING FEM FIELDS WS19-1 WS19-2 Prolem Desription This exerise is use to emonstrte how to mp isplement results from the nlysis of glol(overll) moel onto the perimeter of

More information

Troubleshooting. Verify the Cisco Prime Collaboration Provisioning Installation (for Advanced or Standard Mode), page

Troubleshooting. Verify the Cisco Prime Collaboration Provisioning Installation (for Advanced or Standard Mode), page Trouleshooting This setion explins the following: Verify the Ciso Prime Collortion Provisioning Instlltion (for Advned or Stndrd Mode), pge 1 Upgrde the Ciso Prime Collortion Provisioning from Smll to

More information

Advanced Programming Handout 5. Enter Okasaki. Persistent vs. Ephemeral. Functional Queues. Simple Example. Persistent vs.

Advanced Programming Handout 5. Enter Okasaki. Persistent vs. Ephemeral. Functional Queues. Simple Example. Persistent vs. Avne Progrmming Hnout 5 Purel Funtionl Dt Strutures: A Cse Stu in Funtionl Progrmming Persistent vs. Ephemerl An ephemerl t struture is one for whih onl one version is ville t time: fter n upte opertion,

More information

To access your mailbox from inside your organization. For assistance, call:

To access your mailbox from inside your organization. For assistance, call: 2001 Ative Voie, In. All rights reserved. First edition 2001. Proteted y one or more of the following United Sttes ptents:,070,2;,3,90;,88,0;,33,102;,8,0;,81,0;,2,7;,1,0;,90,88;,01,11. Additionl U.S. nd

More information

YOU ARE: AND THIS IS:

YOU ARE: AND THIS IS: YOU ARE: AND THIS IS: SoHE CMS Mnul As edited August 4, 015 TABLE OF CONTENTS 3 Logging in 4 Pge types within the dshord 5-6 Exploring the toolr 7-8 Adding pge 9 Editing pge 10 Pge templtes: Met Templte

More information

Shared Memory Architectures. Programming and Synchronization. Today s Outline. Page 1. Message passing review Cosmic Cube discussion

Shared Memory Architectures. Programming and Synchronization. Today s Outline. Page 1. Message passing review Cosmic Cube discussion Tody s Outline Arhitetures Progrmming nd Synhroniztion Disuss pper on Cosmi Cube (messge pssing) Messge pssing review Cosmi Cube disussion > Messge pssing mhine Shred memory model > Communition > Synhroniztion

More information

Dr. D.M. Akbar Hussain

Dr. D.M. Akbar Hussain Dr. D.M. Akr Hussin Lexicl Anlysis. Bsic Ide: Red the source code nd generte tokens, it is similr wht humns will do to red in; just tking on the input nd reking it down in pieces. Ech token is sequence

More information

Agenda & Reading. Class Exercise. COMPSCI 105 SS 2012 Principles of Computer Science. Arrays

Agenda & Reading. Class Exercise. COMPSCI 105 SS 2012 Principles of Computer Science. Arrays COMPSCI 5 SS Principles of Computer Science Arrys & Multidimensionl Arrys Agend & Reding Agend Arrys Creting & Using Primitive & Reference Types Assignments & Equlity Pss y Vlue & Pss y Reference Copying

More information

Calculus Differentiation

Calculus Differentiation //007 Clulus Differentition Jeffrey Seguritn person in rowot miles from the nerest point on strit shoreline wishes to reh house 6 miles frther down the shore. The person n row t rte of mi/hr nd wlk t rte

More information

Width and Bounding Box of Imprecise Points

Width and Bounding Box of Imprecise Points Width nd Bounding Box of Impreise Points Vhideh Keikh Mrten Löffler Ali Mohdes Zhed Rhmti Astrt In this pper we study the following prolem: we re given set L = {l 1,..., l n } of prllel line segments,

More information

Registering as a HPE Reseller. Quick Reference Guide for new Partners in Asia Pacific

Registering as a HPE Reseller. Quick Reference Guide for new Partners in Asia Pacific Registering s HPE Reseller Quick Reference Guide for new Prtners in Asi Pcific Registering s new Reseller prtner There re five min steps to e new Reseller prtner. Crete your Appliction Copyright 2017 Hewlett

More information

Parallelization Optimization of System-Level Specification

Parallelization Optimization of System-Level Specification Prlleliztion Optimiztion of System-Level Speifition Luki i niel. Gjski enter for Emedded omputer Systems University of liforni Irvine, 92697, US {li, gjski} @es.ui.edu strt This pper introdues the prlleliztion

More information

6.045J/18.400J: Automata, Computability and Complexity. Quiz 2: Solutions. Please write your name in the upper corner of each page.

6.045J/18.400J: Automata, Computability and Complexity. Quiz 2: Solutions. Please write your name in the upper corner of each page. 6045J/18400J: Automt, Computbility nd Complexity Mrh 30, 2005 Quiz 2: Solutions Prof Nny Lynh Vinod Vikuntnthn Plese write your nme in the upper orner of eh pge Problem Sore 1 2 3 4 5 6 Totl Q2-1 Problem

More information

Reducing Costs with Duck Typing. Structural

Reducing Costs with Duck Typing. Structural Reducing Costs with Duck Typing Structurl 1 Duck Typing In computer progrmming with object-oriented progrmming lnguges, duck typing is lyer of progrmming lnguge nd design rules on top of typing. Typing

More information

Compilers. Chapter 4: Syntactic Analyser. 3 er course Spring Term. Precedence grammars. Precedence grammars

Compilers. Chapter 4: Syntactic Analyser. 3 er course Spring Term. Precedence grammars. Precedence grammars Complers Chpter 4: yntt Anlyser er ourse prng erm Prt 4g: mple Preedene Grmmrs Alfonso Orteg: lfonso.orteg@um.es nrque Alfonse: enrque.lfonse@um.es Introduton A preedene grmmr ses the nlyss n the preedene

More information

Greedy Algorithm. Algorithm Fall Semester

Greedy Algorithm. Algorithm Fall Semester Greey Algorithm Algorithm 0 Fll Semester Optimiztion prolems An optimiztion prolem is one in whih you wnt to fin, not just solution, ut the est solution A greey lgorithm sometimes works well for optimiztion

More information

Lists in Lisp and Scheme

Lists in Lisp and Scheme Lists in Lisp nd Scheme Lists in Lisp nd Scheme Lists re Lisp s fundmentl dt structures, ut there re others Arrys, chrcters, strings, etc. Common Lisp hs moved on from eing merely LISt Processor However,

More information

UT1553B BCRT True Dual-port Memory Interface

UT1553B BCRT True Dual-port Memory Interface UTMC APPICATION NOTE UT553B BCRT True Dul-port Memory Interfce INTRODUCTION The UTMC UT553B BCRT is monolithic CMOS integrted circuit tht provides comprehensive MI-STD- 553B Bus Controller nd Remote Terminl

More information

CSE 401 Compilers. Agenda. Lecture 4: Implemen:ng Scanners Michael Ringenburg Winter 2013

CSE 401 Compilers. Agenda. Lecture 4: Implemen:ng Scanners Michael Ringenburg Winter 2013 CSE 401 Compilers Leture 4: Implemen:ng Snners Mihel Ringenurg Winter 013 Winter 013 UW CSE 401 (Mihel Ringenurg) Agend Lst week we overed regulr expressions nd finite utomt. Tody, we ll finish our finl

More information

Agilent Mass Hunter Software

Agilent Mass Hunter Software Agilent Mss Hunter Softwre Quick Strt Guide Use this guide to get strted with the Mss Hunter softwre. Wht is Mss Hunter Softwre? Mss Hunter is n integrl prt of Agilent TOF softwre (version A.02.00). Mss

More information

Smart Output Field Installation for M-Series and L-Series Converter

Smart Output Field Installation for M-Series and L-Series Converter Smrt Output Field Instlltion for M-Series nd L-Series Converter Instlltion Proedure -- See setion 5.0, Instlltion Proedure 1. Open the Housing nd Prepre for Instlltion 2. Plug the Rion Cle into the Min

More information

Scope, Functions, and Storage Management

Scope, Functions, and Storage Management Scope, Functions, nd Storge Mngement Block-structured lnguges nd stck storge In-le Blocks (previous set of overheds) ctivtion records storge for locl, glol vriles First-order functions (previous set of

More information

Algorithm Design (5) Text Search

Algorithm Design (5) Text Search Algorithm Design (5) Text Serch Tkshi Chikym School of Engineering The University of Tokyo Text Serch Find sustring tht mtches the given key string in text dt of lrge mount Key string: chr x[m] Text Dt:

More information

CS 430 Spring Mike Lam, Professor. Parsing

CS 430 Spring Mike Lam, Professor. Parsing CS 430 Spring 2015 Mike Lm, Professor Prsing Syntx Anlysis We cn now formlly descrie lnguge's syntx Using regulr expressions nd BNF grmmrs How does tht help us? Syntx Anlysis We cn now formlly descrie

More information

Agilent G3314AA BioConfirm Software

Agilent G3314AA BioConfirm Software Agilent G3314AA BioConfirm Softwre Quik Strt Guide Use this guide to instll nd get strted with the BioConfirm softwre. Wht is BioConfirm Softwre? Agilent G3314AA BioConfirm Softwre lets you onfirm the

More information

2 Computing all Intersections of a Set of Segments Line Segment Intersection

2 Computing all Intersections of a Set of Segments Line Segment Intersection 15-451/651: Design & Anlysis of Algorithms Novemer 14, 2016 Lecture #21 Sweep-Line nd Segment Intersection lst chnged: Novemer 8, 2017 1 Preliminries The sweep-line prdigm is very powerful lgorithmic design

More information

Data sharing in OpenMP

Data sharing in OpenMP Dt shring in OpenMP Polo Burgio polo.burgio@unimore.it Outline Expressing prllelism Understnding prllel threds Memory Dt mngement Dt cluses Synchroniztion Brriers, locks, criticl sections Work prtitioning

More information

Introduction To Files In Pascal

Introduction To Files In Pascal Why other With Files? Introduction To Files In Pscl Too much informtion to input ll t once The informtion must be persistent (RAM is voltile) Etc. In this section of notes you will lern how to red from

More information

Union-Find Problem. Using Arrays And Chains. A Set As A Tree. Result Of A Find Operation

Union-Find Problem. Using Arrays And Chains. A Set As A Tree. Result Of A Find Operation Union-Find Problem Given set {,,, n} of n elements. Initilly ech element is in different set. ƒ {}, {},, {n} An intermixed sequence of union nd find opertions is performed. A union opertion combines two

More information

Compression Outline :Algorithms in the Real World. Lempel-Ziv Algorithms. LZ77: Sliding Window Lempel-Ziv

Compression Outline :Algorithms in the Real World. Lempel-Ziv Algorithms. LZ77: Sliding Window Lempel-Ziv Compression Outline 15-853:Algorithms in the Rel World Dt Compression III Introduction: Lossy vs. Lossless, Benchmrks, Informtion Theory: Entropy, etc. Proility Coding: Huffmn + Arithmetic Coding Applictions

More information

PARALLEL AND DISTRIBUTED COMPUTING

PARALLEL AND DISTRIBUTED COMPUTING PARALLEL AND DISTRIBUTED COMPUTING 2009/2010 1 st Semester Teste Jnury 9, 2010 Durtion: 2h00 - No extr mteril llowed. This includes notes, scrtch pper, clcultor, etc. - Give your nswers in the ville spce

More information

If you are at the university, either physically or via the VPN, you can download the chapters of this book as PDFs.

If you are at the university, either physically or via the VPN, you can download the chapters of this book as PDFs. Lecture 5 Wlks, Trils, Pths nd Connectedness Reding: Some of the mteril in this lecture comes from Section 1.2 of Dieter Jungnickel (2008), Grphs, Networks nd Algorithms, 3rd edition, which is ville online

More information

CSc 453 Compilers and Systems Software. 6 : Top-Down Parsing I

CSc 453 Compilers and Systems Software. 6 : Top-Down Parsing I C 45 Compilers n ystems oftwre 6 : op-down Prsing I Christin Collberg Deprtment of Computer iene University of rizon ollberg@gmil.om Copyright 2009 Christin Collberg eptember 14, 2009 1 Overview 2 Compiler

More information

COSC 6374 Parallel Computation. Dense Matrix Operations

COSC 6374 Parallel Computation. Dense Matrix Operations COSC 6374 Prllel Computtion Dense Mtrix Opertions Edgr Griel Fll Edgr Griel Prllel Computtion Edgr Griel erminology Dense Mtrix: ll elements of the mtrix ontin relevnt vlues ypilly stored s 2-D rry, (e.g.

More information

Compilers Spring 2013 PRACTICE Midterm Exam

Compilers Spring 2013 PRACTICE Midterm Exam Compilers Spring 2013 PRACTICE Midterm Exm This is full length prctice midterm exm. If you wnt to tke it t exm pce, give yourself 7 minutes to tke the entire test. Just like the rel exm, ech question hs

More information

COMPUTER SCIENCE 123. Foundations of Computer Science. 6. Tuples

COMPUTER SCIENCE 123. Foundations of Computer Science. 6. Tuples COMPUTER SCIENCE 123 Foundtions of Computer Science 6. Tuples Summry: This lecture introduces tuples in Hskell. Reference: Thompson Sections 5.1 2 R.L. While, 2000 3 Tuples Most dt comes with structure

More information

CSCI 3130: Formal Languages and Automata Theory Lecture 12 The Chinese University of Hong Kong, Fall 2011

CSCI 3130: Formal Languages and Automata Theory Lecture 12 The Chinese University of Hong Kong, Fall 2011 CSCI 3130: Forml Lnguges nd utomt Theory Lecture 12 The Chinese University of Hong Kong, Fll 2011 ndrej Bogdnov In progrmming lnguges, uilding prse trees is significnt tsk ecuse prse trees tell us the

More information