CPSC 213. Polymorphism. Introduction to Computer Systems. Readings for Next Two Lectures. Back to Procedure Calls

Size: px
Start display at page:

Download "CPSC 213. Polymorphism. Introduction to Computer Systems. Readings for Next Two Lectures. Back to Procedure Calls"

Transcription

1 Redings for Next Two Lectures Text CPSC 213 Switch Sttements, Understnding Pointers - 2nd ed: 3.6.7, st ed: 3.6.6, 3.11 Introduction to Computer Systems Unit 1f Dynmic Control Flow Polymorphism nd Switch Sttements 1 Bck to Procedure Clls 2 Sttic Method Invoctions nd Procedure Clls Polymorphism trget method/procedure ddress is known stticlly in Jv sttic methods re clss methods - invoked by nming the clss, not n object public clss A { sttic () { public clss Foo { sttic foo () { A. (); in C specify procedure nme () { foo () { (); 3 4

2 Polymorphism Polymorphic Disptch Method ddress is determined dynmiclly Invoking method on n object in Jv vrible tht stores the object hs sttic type compiler cn not hrdcode trget ddress in procedure cll object reference is dynmic nd so is its type insted, compiler genertes code to lookup procedure ddress t runtime - object s type must implement the type of the referring vrible ddress is stored in memory in the object s clss jump tble - but object s type my override methods of this bse type Clss Jump tble Polymorphic Disptch every clss is represented by clss object trget method ddress depends on the type of the referenced object the clss object stores the clss s jump tble one cll site cn invoke different methods t different times clss A { () { () { the jump tble stores the ddress of every method implemented by the clss objects store pointer to their clss object sttic foo (A ) { Which gets clled?. ();. (); clss B extends A { () { wiff () { Sttic nd dynmic of method invoction ddress of jump tble is determined dynmiclly sttic br () { foo (new A()); foo (new B()); method s offset into jump tble is determined stticlly 5 Exmple of Jv Disptch Clss A A. () { A. () { 6 Dynmic Jumps in C clss A { () { () { Function pointer clss B extends A { () { wiff () { vrible tht stores pointer to procedure declred - <return-type> (*<vrible-nme>)(<forml-rgument-list>); Clss B wiff n A B. () { B.wiff () { used to mke dynmic cll sttic foo (A ) {. ();. (); - <vrible-nme> (<ctul-rgument-list>); Exmple sttic br () { foo (new A()); foo (new B()); () { foo () { (*Func) (); B foo () r[0] r[1] pc pc m[r[5]] # r0 m[r[0]] # r1 m[r[1]+0*4] # m[r[1]+1*4] # = =.clss. (). () Runtime Stck 7 Func = ; clls Func (); 8

3 Simplified Polymorphism in C (SA-dynmic-cll.c) nd B... Declrtion of B s jump tble nd code Use struct to store jump tble struct B { (*)(); (*)(); (*wiff)(); ; drwing on previous exmple of A... Declrtion of A s jump tble nd code struct A { (*) (); (*) (); ; B_ () { printf ("B_\n"); B_wiff () { printf ("B_wiff\n"); A_ () { printf ("A_\n"); A_ () { printf ("A_\n"); Crete n instnce of B s jump tble struct B* new_b () { struct B* b = (struct B*) mlloc (sizeof (struct B)); b-> = B_; b-> = A_; b->wiff = B_wiff; return b; Crete n instnce of A s jump tble struct A* new_a () { struct A* = (struct A*) mlloc (sizeof (struct A)); -> = A_; -> = A_; return ; 9 10 Disptch Digrm for C (dt lyout) invoking nd on n A nd B... foo (struct A* ) { -> (); -> (); struct A A. () { br () { foo (new_a ()); foo ((struct A*) new_b ()); A. () { Struct B wiff struct A { (*) (); (*) (); ; struct A* new_a () { struct A* = (struct A*) mlloc (sizeof (struct A)); -> = A_; -> = A_; return ; 11 A_ () { A_ () { B_ () { B_wiff () { B. () { B.wiff () { struct B { (*)(); (*)(); (*wiff)(); ; struct B* new_b () { struct B* b = (struct B*) mlloc (sizeof (struct B)); b-> = B_; b-> = A_; b->wiff = B_wiff; return b; 12

4 Disptch Digrm for C (the disptch) struct A A. () { A. () { Struct B ISA for Polymorphic Disptch foo (struct A* ) { -> (); -> (); A_ () { A_ () { B_ () { B_wiff () { How do we compile B. () { wiff r[0] m[r[5]] # r0 = pc m[r[1]+0*4] # -> () pc m[r[1]+1*4] # -> () -> ()? foo (struct A* ) { -> (); -> (); br () { foo (new_a ()); foo ((struct A*) new_b ()); B.wiff () { foo () r[0] m[r[5]] # r0 = pc m[r[1]+0*4] # -> () pc m[r[1]+1*4] # -> () Pseudo code pc m[r[1]+0*4] Current jumps supported by ISA Nme Semntics Assembly Mchine jump bsolute pc j b--- indirect jump pc r[t] + (o==pp*2) j o(rt) ctpp We will benefit from new instruction in the ISA tht jumps to n ddress tht is stored in memory Runtime Stck Double-indirect jump instruction (b+o) jump to ddress stored in memory using bse+offset ddressing Nme Semntics Assembly Mchine jump bsolute pc j b--- indirect jump pc r[t] + (o==pp*2) j o(rt) ctpp j *o(rt) dtpp dbl-ind jump b+o pc m[r[t] + (o==pp*2)] Switch Sttements 15 16

5 Switch Sttement Humn vs Compiler int i; int j; foo () { cse 1: j=11; brek; cse 2: j=12; brek; br () { if (i==0) j=10; else if (i==1) j = 11; else if (i==2) j = 12; else if (i==3) j = 13; else Semntics the sme s simplified nested if sttements where condition of ech if tests the sme vrible unless you leve the brek the end of the cse block So, why bother putting this in the lnguge? is it for humns, fcilitte writing nd reding of code? is it for compilers, permitting more efficient implementtion? Implementing switch sttements we lredy know how to implement if sttements; is there nything more to consider? Benefits for humns the syntx models common idiom: choosing one computtion from set But, switch sttements hve interesting restrictions cse lbels must be sttic, crdinl vlues - crdinl vlue is number tht specifies position reltive to the beginning of n ordered set - for exmple, integers re crdinl vlues, but strings re not cse lbels must be compred for equlity to single dynmic expression - some lnguges permit the expression to be n inequlity Do these restrictions benefit humns? hve you ever wnted to do something like this? switch (treenme) { cse "lrch": cse "cedr": cse "hemlock": switch (i,j) { cse i>0: cse i==0 & j>: cse i<0 & j==: defult: Why Compilers like Switch Sttements 17 Hppy Compilers men Hppy People 18 Notice wht we hve switch condition evlutes to number ech cse rm hs distinct number And so, the implementtion hs simplified form build tble with the ddress of every cse rm, indexed by cse vlue switch by indexing into this tble nd jum to mtching cse rm For exmple cse 1: j=11; brek; cse 2: j=12; brek; lbel jumptble[4] = { L0, L1, L2, L3 ; if (i >3) goto DEFAULT; goto jumptble[i]; L0: j = 10; L1: j = 11; L2: j = 12; L3: j = 13; DEFAULT: CONT: cse 1: j=11; brek; cse 2: j=12; brek; Computtion cn be much more efficient compre the running time to if-bsed lterntive But, could it ll go horribly wrong? lbel jumptble[4] = { L0, L1, L2, L3 ; if (i >3) goto DEFAULT; goto jumptble[i]; L0: j = 10; L1: j = 11; L2: j = 12; L3: j = 13; DEFAULT: CONT: construct switch sttement where this implementtion technique is relly bd ide Guidelines for writing efficient switch sttements if (i==0) j=10; else if (i==1) j = 11; else if (i==2) j = 12; else if (i==3) j = 13; else 19 20

6 The bsic implementtion strtegy Refining the implementtion strtegy Generl form of switch sttement switch (<cond>) { cse <lbel_i>: <code_i> repeted 0 or more times defult: <code_defult> optionl Nive strtegy goto ddress of code_defult if cond > mx_lbel_vlue goto jumptble[lbel_i] stticlly: jumptble[lbel_i] = ddress of code_i forll lbel_i Nive implementtion strtegy goto ddress of code_defult if cond > mx_lbel_vlue goto jumptble[lbel_i] stticlly: jumptble[lbel_i] = ddress of code_i forll lbel_i But there re two dditionl considertions cse lbels re not lwys contiguous the lowest cse lbel is not lwys 0 Non-contiguous cse lbels wht is the problem wht is the solution Cse lbels not strting t 0 wht is the problem wht is the solution cse 1000: j=10; brek; cse 1001: j=11; brek; cse 1002: j=12; brek; cse 1003: j=13; brek; Implementing Switch Sttements 21 Snippet B: In templte form 22 Choose strtegy use jump-tble unless cse lbels re sprse or there re very few of them use nested-if-sttements otherwise Jump-tble strtegy stticlly - build jump tble for ll lbel vlues between lowest nd highest generte code to - goto defult if condition is less thn minimum cse lbel or greter thn mximum - normlize condition to lowest cse lbel - use jumptble to go directly to code selected cse rm goto ddress of code_defult if cond < min_lbel_vlue goto ddress of code_defult if cond > mx_lbel_vlue goto jumptble[cond-min_lbel_vlue] stticlly: jumptble[i-min_lbel_vlue] = ddress of code_i forll i: min_lbel_vlue <= i <= mx_lbel_vlue cse 20: j=10; brek; cse 21: j=11; brek; cse 22: j=12; brek; cse 23: j=13; brek; lbel jumptble[4] = { L20, L21, L22, L23 ; if (i < 20) goto DEFAULT; if (i > 23) goto DEFAULT; goto jumptble[i-20]; L20: j = 10; L21: j = 11; L22: j = 12; L23: j = 13; DEFAULT: CONT: 23 24

7 Snippet B: In Assembly Code Sttic nd Dynmic Control Flow foo: ld $i, r0 # r0 = &i ld 0x0(r0), r0 # r0 = i ld $0xffffffed, r1 # r1 = -19 dd r0, r1 # r0 = i-19 bgt r1, l0 # goto l0 if i>19 br defult # goto defult if i<20 l0: ld $0xffffffe9, r1 # r1 = -23 dd r0, r1 # r1 = i-23 bgt r1, defult # goto defult if i>23 ld $0xffffffec, r1 # r1 = -20 dd r1, r0 # r0 = i-20 ld $jmptble, r1 # r1 = &jmptble j *(r1, r0, 4) # goto jmptble[i-20] Jump instructions specify trget ddress nd jump-tken condition trget ddress cn be sttic or dynmic jump-trget condition cn be sttic (unconditionl) or dynmic (conditionl) Sttic jumps jump trget ddress is sttic cse20: ld $0x, r1 # r1 = 10 br done # goto done... defult: ld $0xe, r1 # r1 = 14 br done # goto done done: ld $j, r0 # r0 = &j st r1, 0x0(r0) # j = r1 br cont # goto cont compiler hrd-codes this ddress into instruction Nme Semntics Assembly Mchine brnch pc (==pc+oo*2) br 8-oo brnch if equl pc (==pc+oo*2) if r[c]==0 beg 9coo brnch if greter pc (==pc+oo*2) if r[c]>0 bgt coo jump pc j b--- jmptble:.long 0x # & (cse 20).long 0x # & (cse 21).long 0x # & (cse 22).long 0x # & (cse 23) Simultor... Dynmic jumps jump trget ddress is dynmic Dynmic Jumps 25 Summry 26 Indirect Jump Jump trget ddress stored in register We lredy introduced this instruction, but used it for sttic procedure clls Nme Semntics Assembly Mchine indirect jump pc r[t] + (o==pp*2) j o(rt) ctpp Sttic vs Dynmic flow control sttic if jump trget is known by compiler dynmic for polymorphic disptch, function pointers, nd switch sttements Polymorphic Disptch in Jv invoking method on n object in jv method ddress depends on object s type, which is not know stticlly Double indirect jumps Jump trget ddress stored in memory Bse-plus-displcement nd indexed modes for memory cecss object hs pointer to clss object; clss object contins method jump tble procedure cll is double-indirect jump i.e., trget ddress in memory Function Pointers in C vrible tht stores the ddress of procedure Nme Semntics Assembly Mchine dbl-ind jump b+o pc m[r[t] + (o==pp*2)] j *o(rt) dtpp dbl-ind jump indexed pc m[r[t] + r[i]*4] j *(rt,ri,4) eti- used to implement dynmic procedure cll, similr to polymorphic disptch Switch Sttements syntx restricted so tht they cn be implemented with jump tble jump-tble implementtion running time is independent of the number of cse lbels but, only works if cse lbel vlues re resonbly dense 27 28

CPSC 213. Introduction to Computer Systems. Dynamic Control Flow Polymorphism and Switch Statements. Unit 1f

CPSC 213. Introduction to Computer Systems. Dynamic Control Flow Polymorphism and Switch Statements. Unit 1f CPSC 213 Introduction to Computer Systems Unit 1f Dynamic Control Flow Polymorphism and Switch Statements 1 Readings for Next Two Lectures Text Switch Statements, Understanding Pointers - 2nd ed: 3.6.7,

More information

Reading. Companion. Text. - yup, 3.10 again - mainly "Function pointers" box. 1ed: 3.6.6, in Java. static methods are class methods

Reading. Companion. Text. - yup, 3.10 again - mainly Function pointers box. 1ed: 3.6.6, in Java. static methods are class methods Reading Companion CPSC 213 Introduction to Computer Systems 2.7.4, 2.7.7-2.7.8 Text Switch Statements, Understanding Pointers 2ed: 3.6.7, 3.10 - yup, 3.10 again - mainly "Function pointers" box 1ed: 3.6.6,

More information

CPSC 213. Introduction to Computer Systems. Dynamic Control Flow. Unit 1f Feb 28, Mar 2, 5, 7 and 9. Winter Session 2017, Term 2

CPSC 213. Introduction to Computer Systems. Dynamic Control Flow. Unit 1f Feb 28, Mar 2, 5, 7 and 9. Winter Session 2017, Term 2 CPSC 213 Introduction to Computer Systems Winter Session 2017, Term 2 Unit 1f Feb 28, Mar 2, 5, 7 and 9 Dynamic Control Flow Overview Reading Companion: 2.7.4, 2.7.7-2.7.8 Reference Text: 3.6.7, 3.10 Learning

More information

Functor (1A) Young Won Lim 10/5/17

Functor (1A) Young Won Lim 10/5/17 Copyright (c) 2016-2017 Young W. Lim. Permission is grnted to copy, distribute nd/or modify this document under the terms of the GNU Free Documenttion License, Version 1.2 or ny lter version published

More information

Outline CS 412/413. Function calls. Stack layout. Tiling a call. Two translations

Outline CS 412/413. Function calls. Stack layout. Tiling a call. Two translations CS 412/413 Introduction to Compilers nd Trnsltors Cornell University Andrew Myers Outline Implementing function clls Implementing functions Optimizing wy the pointer Dynmiclly-llocted structures strings

More information

Functor (1A) Young Won Lim 8/2/17

Functor (1A) Young Won Lim 8/2/17 Copyright (c) 2016-2017 Young W. Lim. Permission is grnted to copy, distribute nd/or modify this document under the terms of the GNU Free Documenttion License, Version 1.2 or ny lter version published

More information

Reference types and their characteristics Class Definition Constructors and Object Creation Special objects: Strings and Arrays

Reference types and their characteristics Class Definition Constructors and Object Creation Special objects: Strings and Arrays Objects nd Clsses Reference types nd their chrcteristics Clss Definition Constructors nd Object Cretion Specil objects: Strings nd Arrys OOAD 1999/2000 Cludi Niederée, Jochim W. Schmidt Softwre Systems

More information

Outline. Tiling, formally. Expression tile as rule. Statement tiles as rules. Function calls. CS 412 Introduction to Compilers

Outline. Tiling, formally. Expression tile as rule. Statement tiles as rules. Function calls. CS 412 Introduction to Compilers CS 412 Introduction to Compilers Andrew Myers Cornell University Lectur8 Finishing genertion 9 Mr 01 Outline Tiling s syntx-directed trnsltion Implementing function clls Implementing functions Optimizing

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

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

Sample Midterm Solutions COMS W4115 Programming Languages and Translators Monday, October 12, 2009

Sample Midterm Solutions COMS W4115 Programming Languages and Translators Monday, October 12, 2009 Deprtment of Computer cience Columbi University mple Midterm olutions COM W4115 Progrmming Lnguges nd Trnsltors Mondy, October 12, 2009 Closed book, no ids. ch question is worth 20 points. Question 5(c)

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

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

MIPS I/O and Interrupt

MIPS I/O and Interrupt MIPS I/O nd Interrupt Review Floting point instructions re crried out on seprte chip clled coprocessor 1 You hve to move dt to/from coprocessor 1 to do most common opertions such s printing, clling functions,

More information

Stack. A list whose end points are pointed by top and bottom

Stack. A list whose end points are pointed by top and bottom 4. Stck Stck A list whose end points re pointed by top nd bottom Insertion nd deletion tke plce t the top (cf: Wht is the difference between Stck nd Arry?) Bottom is constnt, but top grows nd shrinks!

More information

Mid-term exam. Scores. Fall term 2012 KAIST EE209 Programming Structures for EE. Thursday Oct 25, Student's name: Student ID:

Mid-term exam. Scores. Fall term 2012 KAIST EE209 Programming Structures for EE. Thursday Oct 25, Student's name: Student ID: Fll term 2012 KAIST EE209 Progrmming Structures for EE Mid-term exm Thursdy Oct 25, 2012 Student's nme: Student ID: The exm is closed book nd notes. Red the questions crefully nd focus your nswers on wht

More information

UNIT 11. Query Optimization

UNIT 11. Query Optimization UNIT Query Optimiztion Contents Introduction to Query Optimiztion 2 The Optimiztion Process: An Overview 3 Optimiztion in System R 4 Optimiztion in INGRES 5 Implementing the Join Opertors Wei-Png Yng,

More information

Data Flow on a Queue Machine. Bruno R. Preiss. Copyright (c) 1987 by Bruno R. Preiss, P.Eng. All rights reserved.

Data Flow on a Queue Machine. Bruno R. Preiss. Copyright (c) 1987 by Bruno R. Preiss, P.Eng. All rights reserved. Dt Flow on Queue Mchine Bruno R. Preiss 2 Outline Genesis of dt-flow rchitectures Sttic vs. dynmic dt-flow rchitectures Pseudo-sttic dt-flow execution model Some dt-flow mchines Simple queue mchine Prioritized

More information

Pointers and Arrays. More Pointer Examples. Pointers CS 217

Pointers and Arrays. More Pointer Examples. Pointers CS 217 Pointers nd Arrs CS 21 1 2 Pointers More Pointer Emples Wht is pointer A vrile whose vlue is the ddress of nother vrile p is pointer to vrile v Opertions &: ddress of (reference) *: indirection (dereference)

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

CPSC 213. Introduction to Computer Systems. Readings for Next 2 Lectures. Loops (S5-loop) Control Flow. Static Control Flow. Unit 1d.

CPSC 213. Introduction to Computer Systems. Readings for Next 2 Lectures. Loops (S5-loop) Control Flow. Static Control Flow. Unit 1d. Readings for Next 2 Lectures Textbook CPSC 213 Condition Codes - Loops 3.6.1-3.6.5 Introduction to Computer Systems Unit 1d Static Control Flow Control Flow 1 Loops (S5-loop) 2 The flow of control is the

More information

Fall 2018 Midterm 1 October 11, ˆ You may not ask questions about the exam except for language clarifications.

Fall 2018 Midterm 1 October 11, ˆ You may not ask questions about the exam except for language clarifications. 15-112 Fll 2018 Midterm 1 October 11, 2018 Nme: Andrew ID: Recittion Section: ˆ You my not use ny books, notes, extr pper, or electronic devices during this exm. There should be nothing on your desk or

More information

Some Thoughts on Grad School. Undergraduate Compilers Review and Intro to MJC. Structure of a Typical Compiler. Lexing and Parsing

Some Thoughts on Grad School. Undergraduate Compilers Review and Intro to MJC. Structure of a Typical Compiler. Lexing and Parsing Undergrdute Compilers Review nd Intro to MJC Announcements Miling list is in full swing Tody Some thoughts on grd school Finish prsing Semntic nlysis Visitor pttern for bstrct syntx trees Some Thoughts

More information

Fall 2018 Midterm 2 November 15, 2018

Fall 2018 Midterm 2 November 15, 2018 Nme: 15-112 Fll 2018 Midterm 2 November 15, 2018 Andrew ID: Recittion Section: ˆ You my not use ny books, notes, extr pper, or electronic devices during this exm. There should be nothing on your desk or

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

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

Unit #9 : Definite Integral Properties, Fundamental Theorem of Calculus

Unit #9 : Definite Integral Properties, Fundamental Theorem of Calculus Unit #9 : Definite Integrl Properties, Fundmentl Theorem of Clculus Gols: Identify properties of definite integrls Define odd nd even functions, nd reltionship to integrl vlues Introduce the Fundmentl

More information

CSE 401 Midterm Exam 11/5/10 Sample Solution

CSE 401 Midterm Exam 11/5/10 Sample Solution Question 1. egulr expressions (20 points) In the Ad Progrmming lnguge n integer constnt contins one or more digits, but it my lso contin embedded underscores. Any underscores must be preceded nd followed

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

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

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

Lecture Overview. Knowledge-based systems in Bioinformatics, 1MB602. Procedural abstraction. The sum procedure. Integration as a procedure

Lecture Overview. Knowledge-based systems in Bioinformatics, 1MB602. Procedural abstraction. The sum procedure. Integration as a procedure Lecture Overview Knowledge-bsed systems in Bioinformtics, MB6 Scheme lecture Procedurl bstrction Higher order procedures Procedures s rguments Procedures s returned vlues Locl vribles Dt bstrction Compound

More information

Math 142, Exam 1 Information.

Math 142, Exam 1 Information. Mth 14, Exm 1 Informtion. 9/14/10, LC 41, 9:30-10:45. Exm 1 will be bsed on: Sections 7.1-7.5. The corresponding ssigned homework problems (see http://www.mth.sc.edu/ boyln/sccourses/14f10/14.html) At

More information

Control-Flow Analysis and Loop Detection

Control-Flow Analysis and Loop Detection ! Control-Flow Anlysis nd Loop Detection!Lst time! PRE!Tody! Control-flow nlysis! Loops! Identifying loops using domintors! Reducibility! Using loop identifiction to identify induction vribles CS553 Lecture

More information

CMSC 331 First Midterm Exam

CMSC 331 First Midterm Exam 0 00/ 1 20/ 2 05/ 3 15/ 4 15/ 5 15/ 6 20/ 7 30/ 8 30/ 150/ 331 First Midterm Exm 7 October 2003 CMC 331 First Midterm Exm Nme: mple Answers tudent ID#: You will hve seventy-five (75) minutes to complete

More information

L2-Python-Data-Structures

L2-Python-Data-Structures L2-Python-Dt-Structures Mrch 19, 2018 1 Principl built-in types in Python (Python ) numerics: int, flot, long, complex sequences: str, unicode, list, tuple, byterry, buffer, xrnge mppings: dict files:

More information

EECS 281: Homework #4 Due: Thursday, October 7, 2004

EECS 281: Homework #4 Due: Thursday, October 7, 2004 EECS 28: Homework #4 Due: Thursdy, October 7, 24 Nme: Emil:. Convert the 24-bit number x44243 to mime bse64: QUJD First, set is to brek 8-bit blocks into 6-bit blocks, nd then convert: x44243 b b 6 2 9

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

Basics of Logic Design Arithmetic Logic Unit (ALU)

Basics of Logic Design Arithmetic Logic Unit (ALU) Bsics of Logic Design Arithmetic Logic Unit (ALU) CPS 4 Lecture 9 Tody s Lecture Homework #3 Assigned Due Mrch 3 Project Groups ssigned & posted to lckord. Project Specifiction is on We Due April 9 Building

More information

Virtual Machine I: Stack Arithmetic

Virtual Machine I: Stack Arithmetic Virtul Mchine I: Stck Arithmetic Building Modern Computer From First Principles www.nnd2tetris.org Elements of Computing Systems, Nisn & Schocken, MIT Press, www.nnd2tetris.org, Chpter 7: Virtul Mchine

More information

Fall 2017 Midterm Exam 1 October 19, You may not use any books, notes, or electronic devices during this exam.

Fall 2017 Midterm Exam 1 October 19, You may not use any books, notes, or electronic devices during this exam. 15-112 Fll 2017 Midterm Exm 1 October 19, 2017 Nme: Andrew ID: Recittion Section: You my not use ny books, notes, or electronic devices during this exm. You my not sk questions bout the exm except for

More information

PYTHON PROGRAMMING. The History of Python. Features of Python. This Course

PYTHON PROGRAMMING. The History of Python. Features of Python. This Course The History of Python PYTHON PROGRAMMING Dr Christin Hill 7 9 November 2016 Invented by Guido vn Rossum* t the Centrum Wiskunde & Informtic in Amsterdm in the erly 1990s Nmed fter Monty Python s Flying

More information

Topic 2: Lexing and Flexing

Topic 2: Lexing and Flexing Topic 2: Lexing nd Flexing COS 320 Compiling Techniques Princeton University Spring 2016 Lennrt Beringer 1 2 The Compiler Lexicl Anlysis Gol: rek strem of ASCII chrcters (source/input) into sequence of

More information

Chapter Spline Method of Interpolation More Examples Electrical Engineering

Chapter Spline Method of Interpolation More Examples Electrical Engineering Chpter. Spline Method of Interpoltion More Exmples Electricl Engineering Exmple Thermistors re used to mesure the temperture of bodies. Thermistors re bsed on mterils chnge in resistnce with temperture.

More information

Example: 2:1 Multiplexer

Example: 2:1 Multiplexer Exmple: 2:1 Multiplexer Exmple #1 reg ; lwys @( or or s) egin if (s == 1') egin = ; else egin = ; 1 s B. Bs 114 Exmple: 2:1 Multiplexer Exmple #2 Normlly lwys include egin nd sttements even though they

More information

What do all those bits mean now? Number Systems and Arithmetic. Introduction to Binary Numbers. Questions About Numbers

What do all those bits mean now? Number Systems and Arithmetic. Introduction to Binary Numbers. Questions About Numbers Wht do ll those bits men now? bits (...) Number Systems nd Arithmetic or Computers go to elementry school instruction R-formt I-formt... integer dt number text chrs... floting point signed unsigned single

More information

ECE 468/573 Midterm 1 September 28, 2012

ECE 468/573 Midterm 1 September 28, 2012 ECE 468/573 Midterm 1 September 28, 2012 Nme:! Purdue emil:! Plese sign the following: I ffirm tht the nswers given on this test re mine nd mine lone. I did not receive help from ny person or mteril (other

More information

CS 130 : Computer Systems - II. Shankar Balachandran Dept. of Computer Science & Engineering IIT Madras

CS 130 : Computer Systems - II. Shankar Balachandran Dept. of Computer Science & Engineering IIT Madras CS 3 : Computer Systems - II Shnkr Blchndrn (shnkr@cse.iitm.c.in) Dept. of Computer Science & Engineering IIT Mdrs Recp Differentite Between s nd s Truth Tbles b AND b OR NOT September 4, 27 Introduction

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

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

Spring 2018 Midterm Exam 1 March 1, You may not use any books, notes, or electronic devices during this exam.

Spring 2018 Midterm Exam 1 March 1, You may not use any books, notes, or electronic devices during this exam. 15-112 Spring 2018 Midterm Exm 1 Mrch 1, 2018 Nme: Andrew ID: Recittion Section: You my not use ny books, notes, or electronic devices during this exm. You my not sk questions bout the exm except for lnguge

More information

Virtual Machine (Part I)

Virtual Machine (Part I) Hrvrd University CS Fll 2, Shimon Schocken Virtul Mchine (Prt I) Elements of Computing Systems Virtul Mchine I (Ch. 7) Motivtion clss clss Min Min sttic sttic x; x; function function void void min() min()

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

OUTPUT DELIVERY SYSTEM

OUTPUT DELIVERY SYSTEM Differences in ODS formtting for HTML with Proc Print nd Proc Report Lur L. M. Thornton, USDA-ARS, Animl Improvement Progrms Lortory, Beltsville, MD ABSTRACT While Proc Print is terrific tool for dt checking

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

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

binary trees, expression trees

binary trees, expression trees COMP 250 Lecture 21 binry trees, expression trees Oct. 27, 2017 1 Binry tree: ech node hs t most two children. 2 Mximum number of nodes in binry tree? Height h (e.g. 3) 3 Mximum number of nodes in binry

More information

2014 Haskell January Test Regular Expressions and Finite Automata

2014 Haskell January Test Regular Expressions and Finite Automata 0 Hskell Jnury Test Regulr Expressions nd Finite Automt This test comprises four prts nd the mximum mrk is 5. Prts I, II nd III re worth 3 of the 5 mrks vilble. The 0 Hskell Progrmming Prize will be wrded

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

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

9 4. CISC - Curriculum & Instruction Steering Committee. California County Superintendents Educational Services Association

9 4. CISC - Curriculum & Instruction Steering Committee. California County Superintendents Educational Services Association 9. CISC - Curriculum & Instruction Steering Committee The Winning EQUATION A HIGH QUALITY MATHEMATICS PROFESSIONAL DEVELOPMENT PROGRAM FOR TEACHERS IN GRADES THROUGH ALGEBRA II STRAND: NUMBER SENSE: Rtionl

More information

Questions About Numbers. Number Systems and Arithmetic. Introduction to Binary Numbers. Negative Numbers?

Questions About Numbers. Number Systems and Arithmetic. Introduction to Binary Numbers. Negative Numbers? Questions About Numbers Number Systems nd Arithmetic or Computers go to elementry school How do you represent negtive numbers? frctions? relly lrge numbers? relly smll numbers? How do you do rithmetic?

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

Alignment of Long Sequences. BMI/CS Spring 2012 Colin Dewey

Alignment of Long Sequences. BMI/CS Spring 2012 Colin Dewey Alignment of Long Sequences BMI/CS 776 www.biostt.wisc.edu/bmi776/ Spring 2012 Colin Dewey cdewey@biostt.wisc.edu Gols for Lecture the key concepts to understnd re the following how lrge-scle lignment

More information

4452 Mathematical Modeling Lecture 4: Lagrange Multipliers

4452 Mathematical Modeling Lecture 4: Lagrange Multipliers Mth Modeling Lecture 4: Lgrnge Multipliers Pge 4452 Mthemticl Modeling Lecture 4: Lgrnge Multipliers Lgrnge multipliers re high powered mthemticl technique to find the mximum nd minimum of multidimensionl

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

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

10/9/2012. Operator is an operation performed over data at runtime. Arithmetic, Logical, Comparison, Assignment, Etc. Operators have precedence

10/9/2012. Operator is an operation performed over data at runtime. Arithmetic, Logical, Comparison, Assignment, Etc. Operators have precedence /9/22 P f Performing i Si Simple l Clcultions C l l ti with ith C#. Opertors in C# nd Opertor Precedence 2. Arithmetic Opertors 3. Logicl Opertors 4. Bitwise Opertors 5. Comprison Opertors 6. Assignment

More information

CPSC 213. Introduction to Computer Systems. Static Control Flow. Unit 1d

CPSC 213. Introduction to Computer Systems. Static Control Flow. Unit 1d CPSC 213 Introduction to Computer Systems Unit 1d Static Control Flow 1 Reading Companion 2.7.1-2.7.3, 2.7.5-2.7.6 Textbook 3.6.1-3.6.5 2 Control Flow The flow of control is the sequence of instruction

More information

Register Transfer Level (RTL) Design

Register Transfer Level (RTL) Design CSE4: Components nd Design Techniques for Digitl Systems Register Trnsfer Level (RTL) Design Tjn Simunic Rosing Where we re now Wht we hve covered lst time: Register Trnsfer Level (RTL) design Wht we re

More information

CS311H: Discrete Mathematics. Graph Theory IV. A Non-planar Graph. Regions of a Planar Graph. Euler s Formula. Instructor: Işıl Dillig

CS311H: Discrete Mathematics. Graph Theory IV. A Non-planar Graph. Regions of a Planar Graph. Euler s Formula. Instructor: Işıl Dillig CS311H: Discrete Mthemtics Grph Theory IV Instructor: Işıl Dillig Instructor: Işıl Dillig, CS311H: Discrete Mthemtics Grph Theory IV 1/25 A Non-plnr Grph Regions of Plnr Grph The plnr representtion of

More information

Math 464 Fall 2012 Notes on Marginal and Conditional Densities October 18, 2012

Math 464 Fall 2012 Notes on Marginal and Conditional Densities October 18, 2012 Mth 464 Fll 2012 Notes on Mrginl nd Conditionl Densities klin@mth.rizon.edu October 18, 2012 Mrginl densities. Suppose you hve 3 continuous rndom vribles X, Y, nd Z, with joint density f(x,y,z. The mrginl

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

How to Design REST API? Written Date : March 23, 2015

How to Design REST API? Written Date : March 23, 2015 Visul Prdigm How Design REST API? Turil How Design REST API? Written Dte : Mrch 23, 2015 REpresenttionl Stte Trnsfer, n rchitecturl style tht cn be used in building networked pplictions, is becoming incresingly

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

1. SEQUENCES INVOLVING EXPONENTIAL GROWTH (GEOMETRIC SEQUENCES)

1. SEQUENCES INVOLVING EXPONENTIAL GROWTH (GEOMETRIC SEQUENCES) Numbers nd Opertions, Algebr, nd Functions 45. SEQUENCES INVOLVING EXPONENTIAL GROWTH (GEOMETRIC SEQUENCES) In sequence of terms involving eponentil growth, which the testing service lso clls geometric

More information

Representation of Numbers. Number Representation. Representation of Numbers. 32-bit Unsigned Integers 3/24/2014. Fixed point Integer Representation

Representation of Numbers. Number Representation. Representation of Numbers. 32-bit Unsigned Integers 3/24/2014. Fixed point Integer Representation Representtion of Numbers Number Representtion Computer represent ll numbers, other thn integers nd some frctions with imprecision. Numbers re stored in some pproximtion which cn be represented by fixed

More information

Angle Properties in Polygons. Part 1 Interior Angles

Angle Properties in Polygons. Part 1 Interior Angles 2.4 Angle Properties in Polygons YOU WILL NEED dynmic geometry softwre OR protrctor nd ruler EXPLORE A pentgon hs three right ngles nd four sides of equl length, s shown. Wht is the sum of the mesures

More information

COMMON HALF YEARLY EXAMINATION DECEMBER 2018

COMMON HALF YEARLY EXAMINATION DECEMBER 2018 li.net i.net li.net i.net li.net i.net li.net i.net li.net i.net li.net i.net li.net i.net li.net i.net li.net i.net.pds.pds COMMON HALF YEARLY EXAMINATION DECEMBER 2018 STD : XI SUBJECT: COMPUTER SCIENCE

More information

An Efficient Divide and Conquer Algorithm for Exact Hazard Free Logic Minimization

An Efficient Divide and Conquer Algorithm for Exact Hazard Free Logic Minimization An Efficient Divide nd Conquer Algorithm for Exct Hzrd Free Logic Minimiztion J.W.J.M. Rutten, M.R.C.M. Berkelr, C.A.J. vn Eijk, M.A.J. Kolsteren Eindhoven University of Technology Informtion nd Communiction

More information

Allocator Basics. Dynamic Memory Allocation in the Heap (malloc and free) Allocator Goals: malloc/free. Internal Fragmentation

Allocator Basics. Dynamic Memory Allocation in the Heap (malloc and free) Allocator Goals: malloc/free. Internal Fragmentation Alloctor Bsics Dynmic Memory Alloction in the Hep (mlloc nd free) Pges too corse-grined for llocting individul objects. Insted: flexible-sized, word-ligned blocks. Allocted block (4 words) Free block (3

More information

Stack Manipulation. Other Issues. How about larger constants? Frame Pointer. PowerPC. Alternative Architectures

Stack Manipulation. Other Issues. How about larger constants? Frame Pointer. PowerPC. Alternative Architectures Other Issues Stck Mnipultion support for procedures (Refer to section 3.6), stcks, frmes, recursion mnipulting strings nd pointers linkers, loders, memory lyout Interrupts, exceptions, system clls nd conventions

More information

10/12/17. Motivating Example. Lexical and Syntax Analysis (2) Recursive-Descent Parsing. Recursive-Descent Parsing. Recursive-Descent Parsing

10/12/17. Motivating Example. Lexical and Syntax Analysis (2) Recursive-Descent Parsing. Recursive-Descent Parsing. Recursive-Descent Parsing Motivting Exmple Lexicl nd yntx Anlysis (2) In Text: Chpter 4 Consider the grmmr -> cad A -> b Input string: w = cd How to build prse tree top-down? 2 Initilly crete tree contining single node (the strt

More information

Lecture T4: Pattern Matching

Lecture T4: Pattern Matching Introduction to Theoreticl CS Lecture T4: Pttern Mtching Two fundmentl questions. Wht cn computer do? How fst cn it do it? Generl pproch. Don t tlk bout specific mchines or problems. Consider miniml bstrct

More information

Homework. Context Free Languages III. Languages. Plan for today. Context Free Languages. CFLs and Regular Languages. Homework #5 (due 10/22)

Homework. Context Free Languages III. Languages. Plan for today. Context Free Languages. CFLs and Regular Languages. Homework #5 (due 10/22) Homework Context Free Lnguges III Prse Trees nd Homework #5 (due 10/22) From textbook 6.4,b 6.5b 6.9b,c 6.13 6.22 Pln for tody Context Free Lnguges Next clss of lnguges in our quest! Lnguges Recll. Wht

More information

CSCI1950 Z Computa4onal Methods for Biology Lecture 2. Ben Raphael January 26, hhp://cs.brown.edu/courses/csci1950 z/ Outline

CSCI1950 Z Computa4onal Methods for Biology Lecture 2. Ben Raphael January 26, hhp://cs.brown.edu/courses/csci1950 z/ Outline CSCI1950 Z Comput4onl Methods for Biology Lecture 2 Ben Rphel Jnury 26, 2009 hhp://cs.brown.edu/courses/csci1950 z/ Outline Review of trees. Coun4ng fetures. Chrcter bsed phylogeny Mximum prsimony Mximum

More information

Systems I. Logic Design I. Topics Digital logic Logic gates Simple combinational logic circuits

Systems I. Logic Design I. Topics Digital logic Logic gates Simple combinational logic circuits Systems I Logic Design I Topics Digitl logic Logic gtes Simple comintionl logic circuits Simple C sttement.. C = + ; Wht pieces of hrdwre do you think you might need? Storge - for vlues,, C Computtion

More information

CPSC 213. Introduction to Computer Systems. Reading. Control Flow. Loops (S5-loop) Static Control Flow. Unit 1d. Companion.

CPSC 213. Introduction to Computer Systems. Reading. Control Flow. Loops (S5-loop) Static Control Flow. Unit 1d. Companion. Reading Companion CPSC 213 2.7.1-2.7.3, 2.7.5-2.7.6 Textbook 3.6.1-3.6.5 Introduction to Computer Systems Unit 1d Static Control Flow Control Flow 1 Loops (S5-loop) 2 The flow of control is the sequence

More information

CPSC 213. Introduction to Computer Systems. Static Control Flow. Unit 1d

CPSC 213. Introduction to Computer Systems. Static Control Flow. Unit 1d CPSC 213 Introduction to Computer Systems Unit 1d Static Control Flow 1 Reading Companion 2.7.1-2.7.3, 2.7.5-2.7.6 Textbook 3.6.1-3.6.5 2 Control Flow The flow of control is the sequence of instruction

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

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

Problem Set 2 Fall 16 Due: Wednesday, September 21th, in class, before class begins.

Problem Set 2 Fall 16 Due: Wednesday, September 21th, in class, before class begins. Problem Set 2 Fll 16 Due: Wednesdy, September 21th, in clss, before clss begins. 1. LL Prsing For the following sub-problems, consider the following context-free grmmr: S T$ (1) T A (2) T bbb (3) A T (4)

More information

Presentation Martin Randers

Presentation Martin Randers Presenttion Mrtin Rnders Outline Introduction Algorithms Implementtion nd experiments Memory consumption Summry Introduction Introduction Evolution of species cn e modelled in trees Trees consist of nodes

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

Definition of Regular Expression

Definition of Regular Expression Definition of Regulr Expression After the definition of the string nd lnguges, we re redy to descrie regulr expressions, the nottion we shll use to define the clss of lnguges known s regulr sets. Recll

More information

6.3 Volumes. Just as area is always positive, so is volume and our attitudes towards finding it.

6.3 Volumes. Just as area is always positive, so is volume and our attitudes towards finding it. 6.3 Volumes Just s re is lwys positive, so is volume nd our ttitudes towrds finding it. Let s review how to find the volume of regulr geometric prism, tht is, 3-dimensionl oject with two regulr fces seprted

More information

Introduction to Julia for Bioinformatics

Introduction to Julia for Bioinformatics Introduction to Juli for Bioinformtics This introduction ssumes tht you hve bsic knowledge of some scripting lnguge nd provides n exmple of the Juli syntx. Continuous Assessment Problems In this course

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

Slides for Data Mining by I. H. Witten and E. Frank

Slides for Data Mining by I. H. Witten and E. Frank Slides for Dt Mining y I. H. Witten nd E. Frnk Simplicity first Simple lgorithms often work very well! There re mny kinds of simple structure, eg: One ttriute does ll the work All ttriutes contriute eqully

More information

CSCE 531, Spring 2017, Midterm Exam Answer Key

CSCE 531, Spring 2017, Midterm Exam Answer Key CCE 531, pring 2017, Midterm Exm Answer Key 1. (15 points) Using the method descried in the ook or in clss, convert the following regulr expression into n equivlent (nondeterministic) finite utomton: (

More information