Principles of Programming Languages

Size: px
Start display at page:

Download "Principles of Programming Languages"

Transcription

1 Principles of Progrmming Lnguges h"p:// 15/ Prof. Andre Corrdini Deprtment of Computer Science, Pis Lesson 6! Towrds Gener=on of Lexicl Anlyzers Finite stte utomt (FSA) From Regulr Expressions to FSA The Lex- Flex lexicl nlyzer genertor

2 We hve seen tht: Tokens re defined with regulr expressions RE à Trnsi=on digrms à code, y hnd!!! Exmple: id letter ( letter digit ) * letter or digit strt 9 letter cse 9: c = nextchr(); if (isletter(c)) stte = 10; else stte = fil(); rek; cse 10: c = nextchr(); if (isletter(c)) stte = 10; else if (isdigit(c)) stte = 10; else stte = 11; rek; 10 other 11 * return(gettoken(), instll_id()) We present more system?c nd formlized pproch 2

3 Design of Lexicl Anlyzer Genertor 1. From the RE of ech token uild n NFA (non- determinis=c finite utomton) tht ccepts the sme regulr lnguge 2. Comine the NFAs into single one 3. Either 1. Simulte directly the NFA, or 2. Determinize the NFA nd simulte the resul=ng DFA (determinis=c FA) 4. Solve conflicts Optionl regulr expressions NFA DFA 3

4 Non- determinis=c Finite Automt An NFA is 5-tuple (S, Σ, δ, s 0, F) where S is finite set of sttes Σ is finite set of symols, the lphet δ is mpping from S (Σ {}) to set of sttes δ : S (Σ {}) à 2 S s 0 S is the strt stte F S is the set of ccepting (or finl) sttes 4

5 Trnsi=on Grph An NFA cn e digrmmticlly represented y leled directed grph clled trnsition grph strt S = {0,1,2,3} Σ = {,} s 0 = 0 F = {3} 5

6 Trnsi=on Tle The mpping δ of n NFA cn e represented in trnsition tle δ(0,) = {0,1} δ(0,) = {0} δ(1,) = {2} δ(2,) = {3} Stte Input Input 0 {0, 1} {0} 1 {2} 2 {3} 6

7 The Lnguge Defined y n NFA An NFA ccepts n input string w (over Σ) if nd only if there is t lest one pth with edges leled with symols from w in sequence from the strt stte to some ccep=ng stte in the trnsi=on grph Note tht - trnsi=ons do not contriute with symols A stte trnsi=on from one stte to nother on the pth is clled move The lnguge defined y n NFA A is the set of input strings it ccepts, denoted L(A) 7

8 Exmples strt A Which NFA, if ny, ccepts???? Which re the lnguges ccepted y A 1 nd A 2? 8 A 1 strt

9 From Regulr Expression to NFA: Thompson s Construc=on Given RE, it uilds y structurl induc;on NFA tht: Accepts exctly the lnguge of the RE Hs single ccep=ng stte Hs no trnsi=ons to the ini=l stte Hs no trnsi=ons from the finl stte 9

10 Thompson s Construc=on r : RE à N(r) : NFA strt i f strt i f r 1 r 2 r 1 r 2 strt i strt i N(r 1 ) N(r 2 ) f r* strt Complexity: liner in the size of the RE i N(r 1 ) N(r 2 ) N(r) f f 10

11 An exmple: RE à Syntx Tree à NFA..! ( )* *.!! strt ! 8!

12 Comining the NFAs of Set of Regulr Expressions strt 1 2 { ction 1 } { ction 2 } *+ { ction 3 } strt strt 7 8 strt

13 Simul=ng the Comined NFA Given n input string w, we look for prefix ccepted y the NFA, i.e. tht is the lexeme of token We strt with the set of sttes rechle y strt with - trnsi=ons For ech symol we collect ll sttes to which we cn move from the current sttes Complexity: liner in (length of w) * (numer of sttes), using efficient represent=on of set of sttes Conflicts: severl prefixes of w cn e legl lexemes

14 Simul=ng the Comined NFA Exmple 1 strt ction 1 ction 3 6 ction none 7 8 ction 3 Must find the longest mtch: Continue until no further moves re possile When lst stte is ccepting: execute ction Conflict resolu?on I 14

15 Simul=ng the Comined NFA Exmple 2 strt ction 1 ction 3 6 ction none ction 2 ction 3 Conflict resolu?on II Lex: When two or more ccepting sttes re reched, the first ction given in the specifiction is executed 15

16 Design of Lexicl Anlyzer Genertor: RE to NFA to DFA Specifiction with regulr expressions NFA p 1 { ction 1 } p 2 { ction 2 } p n { ction n } strt s 0 N(p 1 ) N(p 2 ) N(p n ) ction 1 ction 2 ction n Simul=ng the DFA is more efficient, ut The size of the DFA could e DFA Suset construction exponen=l w.r.t. the NFA 16

17 Determinis=c Finite Automt A determinis=c finite utomton is specil cse of n NFA No stte hs n - trnsi=on For ech stte s nd input symol there is t most one edge leled leving s Ech entry in the trnsi=on tle is single stte At most one pth exists to ccept string Simul=on lgorithm is simple Altern=ve defini=on: For ech stte s nd input symol there is exctly one edge leled leving s Esily shown to e equivlent (sink stte ) 17

18 Exmple DFA strt A DFA tht ccepts the sme lnguge of A 2, ( )* strt A

19 Conversion of n NFA into DFA The suset construction lgorithm converts n NFA into DFA using: -closure(s) = {s} {t s t} -closure(t) = s T -closure(s) move(t, ) = {t s t nd s T} The lgorithm produces: Dsttes is the set of sttes of the new DFA consisting of sets of sttes of the NFA Dtrn is the trnsition tle of the new DFA 19

20 - closure nd move Exmples strt closure({0}) = {0,1,3,7} move({0,1,3,7},) = {2,4,7} - closure({2,4,7}) = {2,4,7} move({2,4,7},) = {7} - closure({7}) = {7} move({7},) = {8} - closure({8}) = {8} move({8},) = 0 2 none Also used to simulte NFAs (!) 20

21 Simul=ng n NFA using - closure nd move S := -closure({s 0 }) S prev := := nextchr() while S do S prev := S S := -closure(move(s,)) := nextchr() end do if S prev F then execute ction in S prev return yes else return no 21

22 The Suset Construc=on Algorithm: from NFA to n equivlent DFA Initilly, -closure(s 0 ) is the only stte in Dsttes nd it is unmrked while there is n unmrked stte T in Dsttes do mrk T for ech input symol Σ do U := -closure(move(t,)) if U is not in Dsttes then dd U s n unmrked stte to Dsttes end if Dtrn[T, ] := U end do end do 22

23 Suset Construc=on Exmple 1 strt strt A C B D E Dsttes A = {0,1,2,4,7} B = {1,2,3,4,6,7,8} C = {1,2,4,5,6,7} D = {1,2,4,5,6,7,9} E = {1,2,4,5,6,7,10} 23

24 Suset Construc=on Exmple 2 strt strt 1 3 A C D B E F Dsttes A = {0,1,3,7} B = {2,4,7} C = {8} D = {7} E = {5,8} F = {6,8} 24

25 Minimizing the Numer of Sttes of DFA Given DFA, let us show how to get DFA which ccepts the sme regulr lnguge with miniml numer of sttes strt A C B D E strt AC B D E 25

26 On the Minimiz=on Algorithm Two sttes q nd q' in DFA M = (Q, Σ, δ, q 0, F ) re equivlent (or indis-nguishle) if for ll strings w Σ*, the sttes on which w ends on when red from q nd q' re oth ccept, or oth non- ccept. An utomton is irreducile if it contins no useless (unrechle) sttes, nd no two dis=nct sttes re equivlent The Minimiz?on Algorithm cretes n irreducile utomton ccep=ng the sme lnguge Pr==on- refinement: strts with pr==on of sttes {Accep=ng, Non- ccep=ng} nd refines it =ll done 26

27 Minimiz=on Algorithm (Pr==on Refinement) Code DFA minimize(dfa (Q, Σ, d, q 0, F ) ) remove ny stte q unrechle from q 0 Pr==on P = {F, Q - F } oolen Consistent = flse while ( Consistent == flse ) Consistent = true for(every Set S P, chr Σ, Set T P ) // collect sttes of T tht rech S using Set temp = {q T d(q,) S } if (temp!= Ø && temp!= T ) Consistent = flse P = (P\{T} ) {temp,t- temp} return defineminimizor( (Q, Σ, d, q 0, F ), P ) 27

28 Minimiz=on Algorithm. (Pr==on Refinement) Code DFA defineminimizor (DFA (Q, Σ, δ, q 0, F ), Pr==on P ) Set Q' =P Stte q' 0 = the set in P which contins q 0 F' = { S P S F } for (ech S P, Σ) define δ' (S,) = the set T P which contins the sttes δ(s,) for ech s S return (Q', Σ, δ', q' 0, F' ) 28

29 Minimiz=on Algorithm: Exmple P 1 = {{A, B, C, D}, {E}} ({A,B,C,D}, ) not consistent P 2 = {{A, B, C}, {D}, {E}} ({A,B,C}, ) not consistent P 3 = {{A, C}, {B}, {D}, {E}} Consistent! strt A C B D E strt AC B D E 29

30 Is the constructed utomton miniml? The previous lgorithm gurnteed to produce n irreducile DFA. Why should tht FA e the smllest possile FA for its ccepted lnguge? THM (Myhill- Nerode): The minimiz;on lgorithm produces the smllest possile utomton for its ccepted lnguge. 30

31 Proof of Myhill- Nerode theorem Proof. Show tht ny irreducile utomton is the smllest for its ccepted lnguge L: Two strings u,v Σ* re indis-nguishle if for ll strings w, uw L ó vw L. Thus if u nd v re dis?nguishle, their pths from the strt stte must hve different endpoints. Therefore the numer of sttes in ny DFA for L must e lrger thn or equl to the numer of mutully dis=nguishle strings for L. But in n irreducile DFA every stte gives rise to nother mutully dis=nguishle string! Therefore, ny other DFA for the sme lnguge must hve t lest s mny sttes s the irreducile DFA 31

32 The Lex nd Flex Scnner Genertors Lex nd its newer cousin flex re scnner genertors Scnner genertors system=clly trnslte regulr defini=ons into C source code for efficient scnning Generted code is esy to integrte in C pplic=ons 32

33 Cre=ng Lexicl Anlyzer with Lex nd Flex lex source progrm lex.l lex (or flex) lex.yy.c lex.yy.c C compiler.out input strem.out sequence of tokens 33

34 Lex Specific=on A lex specifiction consists of three prts: regulr definitions, C declrtions in %{ %} %% trnsltion rules %% user-defined uxiliry procedures The trnsltion rules re of the form: p 1 { ction 1 } p 2 { ction 2 } p n { ction n } 34

35 Regulr Expressions in Lex x mtch the chrcter x \. mtch the chrcter. string mtch contents of string of chrcters. mtch ny chrcter except newline ^ mtch eginning of line $ mtch the end of line [xyz] mtch one chrcter x, y, or z (use \ to escpe -) [^xyz]mtch ny chrcter except x, y, nd z [-z] mtch one of to z r* closure (mtch zero or more occurrences) r+ positive closure (mtch one or more occurrences) r? optionl (mtch zero or one occurrence) r 1 r 2 mtch r 1 then r 2 (conctention) r 1 r 2 mtch r 1 or r 2 (union) ( r ) grouping r 1 \r 2 mtch r 1 when followed y r 2 {d}mtch the regulr expression defined y d 35

36 Exmple Lex Specific=on 1 Trnsltion rules %{ #include <stdio.h> %} %% [0-9]+ { printf( %s\n, yytext); }. \n { } %% min() { yylex(); } Contins the mtching lexeme Invokes the lexicl nlyzer lex spec.l gcc lex.yy.c -ll./.out < spec.l 36

37 Exmple Lex Specific=on 2 Trnsltion rules %{ #include <stdio.h> int ch = 0, wd = 0, nl = 0; %} delim [ \t]+ %% \n { ch++; wd++; nl++; } ^{delim} { ch+=yyleng; } {delim} { ch+=yyleng; wd++; }. { ch++; } %% min() { yylex(); printf("%8d%8d%8d\n", nl, wd, ch); } Regulr definition 37

38 Exmple Lex Specific=on 3 Trnsltion rules %{ #include <stdio.h> %} digit [0-9] letter [A-Z-z] Regulr definitions id {letter}({letter} {digit})* %% {digit}+ { printf( numer: %s\n, yytext); } {id} { printf( ident: %s\n, yytext); }. { printf( other: %s\n, yytext); } %% min() { yylex(); } 38

39 Exmple Lex Specific=on 4 %{ /* definitions of mnifest constnts */ #define LT (256) %} delim [ \t\n] ws {delim}+ letter [A-Z-z] digit [0-9] id {letter}({letter} {digit})* numer {digit}+(\.{digit}+)?(e[+\-]?{digit}+)? %% {ws} { } if {return IF;} then {return THEN;} else {return ELSE;} {id} {yylvl = instll_id(); return ID;} {numer} {yylvl = instll_num(); return NUMBER;} < {yylvl = LT; return RELOP;} <= {yylvl = LE; return RELOP;} = {yylvl = EQ; return RELOP;} <> {yylvl = NE; return RELOP;} > {yylvl = GT; return RELOP;} >= {yylvl = GE; return RELOP;} %% int instll_id() { } Token ttriute Return token to prser Instll yytext (of length yyleng) 39 s identifier in symol tle

flex Regular Expressions and Lexical Scanning Regular Expressions and flex Examples on Alphabet A = {a,b} (Standard) Regular Expressions on Alphabet A

flex Regular Expressions and Lexical Scanning Regular Expressions and flex Examples on Alphabet A = {a,b} (Standard) Regular Expressions on Alphabet A flex Regulr Expressions nd Lexicl Scnning Using flex to Build Scnner flex genertes lexicl scnners: progrms tht discover tokens. Tokens re the smllest meningful units of progrm (or other string). flex is

More information

Regular Sets and Expressions

Regular Sets and Expressions Regulr Sets nd Expressions Finite utomt re importnt in science, mthemtics, nd engineering. Engineers like them ecuse they re super models for circuits (And, since the dvent of VLSI systems sometimes finite

More information

Homework 3 Solutions

Homework 3 Solutions CS 341: Foundtions of Computer Science II Prof. Mrvin Nkym Homework 3 Solutions 1. Give NFAs with the specified numer of sttes recognizing ech of the following lnguges. In ll cses, the lphet is Σ = {,1}.

More information

One Minute To Learn Programming: Finite Automata

One Minute To Learn Programming: Finite Automata Gret Theoreticl Ides In Computer Science Steven Rudich CS 15-251 Spring 2005 Lecture 9 Fe 8 2005 Crnegie Mellon University One Minute To Lern Progrmming: Finite Automt Let me tech you progrmming lnguge

More information

Java CUP. Java CUP Specifications. User Code Additions You may define Java code to be included within the generated parser:

Java CUP. Java CUP Specifications. User Code Additions You may define Java code to be included within the generated parser: Jv CUP Jv CUP is prser-genertion tool, similr to Ycc. CUP uilds Jv prser for LALR(1) grmmrs from production rules nd ssocited Jv code frgments. When prticulr production is recognized, its ssocited code

More information

Bypassing Space Explosion in Regular Expression Matching for Network Intrusion Detection and Prevention Systems

Bypassing Space Explosion in Regular Expression Matching for Network Intrusion Detection and Prevention Systems Bypssing Spce Explosion in Regulr Expression Mtching for Network Intrusion Detection n Prevention Systems Jignesh Ptel, Alex Liu n Eric Torng Dept. of Computer Science n Engineering Michign Stte University

More information

A Visual and Interactive Input abb Automata. Theory Course with JFLAP 4.0

A Visual and Interactive Input abb Automata. Theory Course with JFLAP 4.0 Strt Puse Step Noninverted Tree A Visul nd Interctive Input Automt String ccepted! 5 nodes generted. Theory Course with JFLAP 4.0 q0 even 's, even 's q2 even 's, odd 's q1 odd 's, even 's q3 odd 's, odd

More information

FORMAL LANGUAGES, AUTOMATA AND THEORY OF COMPUTATION EXERCISES ON REGULAR LANGUAGES

FORMAL LANGUAGES, AUTOMATA AND THEORY OF COMPUTATION EXERCISES ON REGULAR LANGUAGES FORMAL LANGUAGES, AUTOMATA AND THEORY OF COMPUTATION EXERCISES ON REGULAR LANGUAGES Introduction This compendium contins exercises out regulr lnguges for the course Forml Lnguges, Automt nd Theory of Computtion

More information

Solution to Problem Set 1

Solution to Problem Set 1 CSE 5: Introduction to the Theory o Computtion, Winter A. Hevi nd J. Mo Solution to Prolem Set Jnury, Solution to Prolem Set.4 ). L = {w w egin with nd end with }. q q q q, d). L = {w w h length t let

More information

FAULT TREES AND RELIABILITY BLOCK DIAGRAMS. Harry G. Kwatny. Department of Mechanical Engineering & Mechanics Drexel University

FAULT TREES AND RELIABILITY BLOCK DIAGRAMS. Harry G. Kwatny. Department of Mechanical Engineering & Mechanics Drexel University SYSTEM FAULT AND Hrry G. Kwtny Deprtment of Mechnicl Engineering & Mechnics Drexel University OUTLINE SYSTEM RBD Definition RBDs nd Fult Trees System Structure Structure Functions Pths nd Cutsets Reliility

More information

Unambiguous Recognizable Two-dimensional Languages

Unambiguous Recognizable Two-dimensional Languages Unmbiguous Recognizble Two-dimensionl Lnguges Mrcell Anselmo, Dor Gimmrresi, Mri Mdoni, Antonio Restivo (Univ. of Slerno, Univ. Rom Tor Vergt, Univ. of Ctni, Univ. of Plermo) W2DL, My 26 REC fmily I REC

More information

Reasoning to Solve Equations and Inequalities

Reasoning to Solve Equations and Inequalities Lesson4 Resoning to Solve Equtions nd Inequlities In erlier work in this unit, you modeled situtions with severl vriles nd equtions. For exmple, suppose you were given usiness plns for concert showing

More information

LINEAR TRANSFORMATIONS AND THEIR REPRESENTING MATRICES

LINEAR TRANSFORMATIONS AND THEIR REPRESENTING MATRICES LINEAR TRANSFORMATIONS AND THEIR REPRESENTING MATRICES DAVID WEBB CONTENTS Liner trnsformtions 2 The representing mtrix of liner trnsformtion 3 3 An ppliction: reflections in the plne 6 4 The lgebr of

More information

Polynomial Functions. Polynomial functions in one variable can be written in expanded form as ( )

Polynomial Functions. Polynomial functions in one variable can be written in expanded form as ( ) Polynomil Functions Polynomil functions in one vrible cn be written in expnded form s n n 1 n 2 2 f x = x + x + x + + x + x+ n n 1 n 2 2 1 0 Exmples of polynomils in expnded form re nd 3 8 7 4 = 5 4 +

More information

Binary Representation of Numbers Autar Kaw

Binary Representation of Numbers Autar Kaw Binry Representtion of Numbers Autr Kw After reding this chpter, you should be ble to: 1. convert bse- rel number to its binry representtion,. convert binry number to n equivlent bse- number. In everydy

More information

Example 27.1 Draw a Venn diagram to show the relationship between counting numbers, whole numbers, integers, and rational numbers.

Example 27.1 Draw a Venn diagram to show the relationship between counting numbers, whole numbers, integers, and rational numbers. 2 Rtionl Numbers Integers such s 5 were importnt when solving the eqution x+5 = 0. In similr wy, frctions re importnt for solving equtions like 2x = 1. Wht bout equtions like 2x + 1 = 0? Equtions of this

More information

CS99S Laboratory 2 Preparation Copyright W. J. Dally 2001 October 1, 2001

CS99S Laboratory 2 Preparation Copyright W. J. Dally 2001 October 1, 2001 CS99S Lortory 2 Preprtion Copyright W. J. Dlly 2 Octoer, 2 Ojectives:. Understnd the principle of sttic CMOS gte circuits 2. Build simple logic gtes from MOS trnsistors 3. Evlute these gtes to oserve logic

More information

Pointed Regular Expressions

Pointed Regular Expressions Pointed Regulr Expressions Andre Asperti 1, Cludio Scerdoti Coen 1, nd Enrico Tssi 2 1 Deprtment of Computer Science, University of Bologn sperti@cs.unio.it scerdot@cs.unio.it 2 INRIA-Micorsoft tssi@cs.unio.it

More information

Use Geometry Expressions to create a more complex locus of points. Find evidence for equivalence using Geometry Expressions.

Use Geometry Expressions to create a more complex locus of points. Find evidence for equivalence using Geometry Expressions. Lerning Objectives Loci nd Conics Lesson 3: The Ellipse Level: Preclculus Time required: 120 minutes In this lesson, students will generlize their knowledge of the circle to the ellipse. The prmetric nd

More information

9 CONTINUOUS DISTRIBUTIONS

9 CONTINUOUS DISTRIBUTIONS 9 CONTINUOUS DISTIBUTIONS A rndom vrible whose vlue my fll nywhere in rnge of vlues is continuous rndom vrible nd will be ssocited with some continuous distribution. Continuous distributions re to discrete

More information

Regular Languages and Finite Automata

Regular Languages and Finite Automata N Lecture Notes on Regulr Lnguges nd Finite Automt for Prt IA of the Computer Science Tripos Mrcelo Fiore Cmbridge University Computer Lbortory First Edition 1998. Revised 1999, 2000, 2001, 2002, 2003,

More information

Solutions for Selected Exercises from Introduction to Compiler Design

Solutions for Selected Exercises from Introduction to Compiler Design Solutions for Selected Exercises from Introduction to Compiler Design Torben Æ. Mogensen Lst updte: My 30, 2011 1 Introduction This document provides solutions for selected exercises from Introduction

More information

Outline of the Lecture. Software Testing. Unit & Integration Testing. Components. Lecture Notes 3 (of 4)

Outline of the Lecture. Software Testing. Unit & Integration Testing. Components. Lecture Notes 3 (of 4) Outline of the Lecture Softwre Testing Lecture Notes 3 (of 4) Integrtion Testing Top-down ottom-up ig-ng Sndwich System Testing cceptnce Testing istriution of ults in lrge Industril Softwre System (ISST

More information

Mathematics. Vectors. hsn.uk.net. Higher. Contents. Vectors 128 HSN23100

Mathematics. Vectors. hsn.uk.net. Higher. Contents. Vectors 128 HSN23100 hsn.uk.net Higher Mthemtics UNIT 3 OUTCOME 1 Vectors Contents Vectors 18 1 Vectors nd Sclrs 18 Components 18 3 Mgnitude 130 4 Equl Vectors 131 5 Addition nd Subtrction of Vectors 13 6 Multipliction by

More information

Introduction to Lex. General Description Input file Output file How matching is done Regular expressions Local names Using Lex

Introduction to Lex. General Description Input file Output file How matching is done Regular expressions Local names Using Lex Introduction to Lex General Description Input file Output file How matching is done Regular expressions Local names Using Lex General Description Lex is a program that automatically generates code for

More information

Modular Generic Verification of LTL Properties for Aspects

Modular Generic Verification of LTL Properties for Aspects Modulr Generic Verifiction of LTL Properties for Aspects Mx Goldmn Shmuel Ktz Computer Science Deprtment Technion Isrel Institute of Technology {mgoldmn, ktz}@cs.technion.c.il ABSTRACT Aspects re seprte

More information

5 a LAN 6 a gateway 7 a modem

5 a LAN 6 a gateway 7 a modem STARTER With the help of this digrm, try to descrie the function of these components of typicl network system: 1 file server 2 ridge 3 router 4 ckone 5 LAN 6 gtewy 7 modem Another Novell LAN Router Internet

More information

Math 135 Circles and Completing the Square Examples

Math 135 Circles and Completing the Square Examples Mth 135 Circles nd Completing the Squre Exmples A perfect squre is number such tht = b 2 for some rel number b. Some exmples of perfect squres re 4 = 2 2, 16 = 4 2, 169 = 13 2. We wish to hve method for

More information

Appendix D: Completing the Square and the Quadratic Formula. In Appendix A, two special cases of expanding brackets were considered:

Appendix D: Completing the Square and the Quadratic Formula. In Appendix A, two special cases of expanding brackets were considered: Appendi D: Completing the Squre nd the Qudrtic Formul Fctoring qudrtic epressions such s: + 6 + 8 ws one of the topics introduced in Appendi C. Fctoring qudrtic epressions is useful skill tht cn help you

More information

Generating In-Line Monitors For Rabin Automata

Generating In-Line Monitors For Rabin Automata Generting In-Line Monitors For Rin Automt Hugues Chot, Rphel Khoury, nd Ndi Twi Lvl University, Deprtment of Computer Science nd Softwre Engineering, Pvillon Adrien-Pouliot, 1065, venue de l Medecine Queec

More information

Regular Repair of Specifications

Regular Repair of Specifications Regulr Repir of Specifictions Michel Benedikt Oxford University michel.enedikt@coml.ox.c.uk Griele Puppis Oxford University griele.puppis@coml.ox.c.uk Cristin Riveros Oxford University cristin.riveros@coml.ox.c.uk

More information

DATABASDESIGN FÖR INGENJÖRER - 1056F

DATABASDESIGN FÖR INGENJÖRER - 1056F DATABASDESIGN FÖR INGENJÖRER - 06F Sommr 00 En introuktionskurs i tssystem http://user.it.uu.se/~ul/t-sommr0/ lt. http://www.it.uu.se/eu/course/homepge/esign/st0/ Kjell Orsorn (Rusln Fomkin) Uppsl Dtse

More information

Example A rectangular box without lid is to be made from a square cardboard of sides 18 cm by cutting equal squares from each corner and then folding

Example A rectangular box without lid is to be made from a square cardboard of sides 18 cm by cutting equal squares from each corner and then folding 1 Exmple A rectngulr box without lid is to be mde from squre crdbord of sides 18 cm by cutting equl squres from ech corner nd then folding up the sides. 1 Exmple A rectngulr box without lid is to be mde

More information

PROF. BOYAN KOSTADINOV NEW YORK CITY COLLEGE OF TECHNOLOGY, CUNY

PROF. BOYAN KOSTADINOV NEW YORK CITY COLLEGE OF TECHNOLOGY, CUNY MAT 0630 INTERNET RESOURCES, REVIEW OF CONCEPTS AND COMMON MISTAKES PROF. BOYAN KOSTADINOV NEW YORK CITY COLLEGE OF TECHNOLOGY, CUNY Contents 1. ACT Compss Prctice Tests 1 2. Common Mistkes 2 3. Distributive

More information

and thus, they are similar. If k = 3 then the Jordan form of both matrices is

and thus, they are similar. If k = 3 then the Jordan form of both matrices is Homework ssignment 11 Section 7. pp. 249-25 Exercise 1. Let N 1 nd N 2 be nilpotent mtrices over the field F. Prove tht N 1 nd N 2 re similr if nd only if they hve the sme miniml polynomil. Solution: If

More information

4.11 Inner Product Spaces

4.11 Inner Product Spaces 314 CHAPTER 4 Vector Spces 9. A mtrix of the form 0 0 b c 0 d 0 0 e 0 f g 0 h 0 cnnot be invertible. 10. A mtrix of the form bc d e f ghi such tht e bd = 0 cnnot be invertible. 4.11 Inner Product Spces

More information

Automata theory. An algorithmic approach. Lecture Notes. Javier Esparza

Automata theory. An algorithmic approach. Lecture Notes. Javier Esparza Automt theory An lgorithmic pproch 0 Lecture Notes Jvier Esprz My 3, 2016 2 3 Plese red this! Mny yers go I don t wnt to sy how mny, it s depressing I tught course on the utomt-theoretic pproch to model

More information

Solving the String Statistics Problem in Time O(n log n)

Solving the String Statistics Problem in Time O(n log n) Solving the String Sttistics Prolem in Time O(n log n) Gerth Stølting Brodl 1,,, Rune B. Lyngsø 3, Ann Östlin1,, nd Christin N. S. Pedersen 1,2, 1 BRICS, Deprtment of Computer Science, University of Arhus,

More information

Automated Grading of DFA Constructions

Automated Grading of DFA Constructions Automted Grding of DFA Constructions Rjeev Alur nd Loris D Antoni Sumit Gulwni Dileep Kini nd Mhesh Viswnthn Deprtment of Computer Science Microsoft Reserch Deprtment of Computer Science University of

More information

Experiment 6: Friction

Experiment 6: Friction Experiment 6: Friction In previous lbs we studied Newton s lws in n idel setting, tht is, one where friction nd ir resistnce were ignored. However, from our everydy experience with motion, we know tht

More information

Section 5-4 Trigonometric Functions

Section 5-4 Trigonometric Functions 5- Trigonometric Functions Section 5- Trigonometric Functions Definition of the Trigonometric Functions Clcultor Evlution of Trigonometric Functions Definition of the Trigonometric Functions Alternte Form

More information

Vectors 2. 1. Recap of vectors

Vectors 2. 1. Recap of vectors Vectors 2. Recp of vectors Vectors re directed line segments - they cn be represented in component form or by direction nd mgnitude. We cn use trigonometry nd Pythgors theorem to switch between the forms

More information

EQUATIONS OF LINES AND PLANES

EQUATIONS OF LINES AND PLANES EQUATIONS OF LINES AND PLANES MATH 195, SECTION 59 (VIPUL NAIK) Corresponding mteril in the ook: Section 12.5. Wht students should definitely get: Prmetric eqution of line given in point-direction nd twopoint

More information

How fast can we sort? Sorting. Decision-tree model. Decision-tree for insertion sort Sort a 1, a 2, a 3. CS 3343 -- Spring 2009

How fast can we sort? Sorting. Decision-tree model. Decision-tree for insertion sort Sort a 1, a 2, a 3. CS 3343 -- Spring 2009 CS 4 -- Spring 2009 Sorting Crol Wenk Slides courtesy of Chrles Leiserson with smll chnges by Crol Wenk CS 4 Anlysis of Algorithms 1 How fst cn we sort? All the sorting lgorithms we hve seen so fr re comprison

More information

. At first sight a! b seems an unwieldy formula but use of the following mnemonic will possibly help. a 1 a 2 a 3 a 1 a 2

. At first sight a! b seems an unwieldy formula but use of the following mnemonic will possibly help. a 1 a 2 a 3 a 1 a 2 7 CHAPTER THREE. Cross Product Given two vectors = (,, nd = (,, in R, the cross product of nd written! is defined to e: " = (!,!,! Note! clled cross is VECTOR (unlike which is sclr. Exmple (,, " (4,5,6

More information

2 DIODE CLIPPING and CLAMPING CIRCUITS

2 DIODE CLIPPING and CLAMPING CIRCUITS 2 DIODE CLIPPING nd CLAMPING CIRCUITS 2.1 Ojectives Understnding the operting principle of diode clipping circuit Understnding the operting principle of clmping circuit Understnding the wveform chnge of

More information

Bayesian Updating with Continuous Priors Class 13, 18.05, Spring 2014 Jeremy Orloff and Jonathan Bloom

Bayesian Updating with Continuous Priors Class 13, 18.05, Spring 2014 Jeremy Orloff and Jonathan Bloom Byesin Updting with Continuous Priors Clss 3, 8.05, Spring 04 Jeremy Orloff nd Jonthn Bloom Lerning Gols. Understnd prmeterized fmily of distriutions s representing continuous rnge of hypotheses for the

More information

Lecture 5. Inner Product

Lecture 5. Inner Product Lecture 5 Inner Product Let us strt with the following problem. Given point P R nd line L R, how cn we find the point on the line closest to P? Answer: Drw line segment from P meeting the line in right

More information

Physics 43 Homework Set 9 Chapter 40 Key

Physics 43 Homework Set 9 Chapter 40 Key Physics 43 Homework Set 9 Chpter 4 Key. The wve function for n electron tht is confined to x nm is. Find the normliztion constnt. b. Wht is the probbility of finding the electron in. nm-wide region t x

More information

Integration by Substitution

Integration by Substitution Integrtion by Substitution Dr. Philippe B. Lvl Kennesw Stte University August, 8 Abstrct This hndout contins mteril on very importnt integrtion method clled integrtion by substitution. Substitution is

More information

1.00/1.001 Introduction to Computers and Engineering Problem Solving Fall 2011 - Final Exam

1.00/1.001 Introduction to Computers and Engineering Problem Solving Fall 2011 - Final Exam 1./1.1 Introduction to Computers nd Engineering Problem Solving Fll 211 - Finl Exm Nme: MIT Emil: TA: Section: You hve 3 hours to complete this exm. In ll questions, you should ssume tht ll necessry pckges

More information

0.1 Basic Set Theory and Interval Notation

0.1 Basic Set Theory and Interval Notation 0.1 Bsic Set Theory nd Intervl Nottion 3 0.1 Bsic Set Theory nd Intervl Nottion 0.1.1 Some Bsic Set Theory Notions Like ll good Mth ooks, we egin with definition. Definition 0.1. A set is well-defined

More information

Geometry 7-1 Geometric Mean and the Pythagorean Theorem

Geometry 7-1 Geometric Mean and the Pythagorean Theorem Geometry 7-1 Geometric Men nd the Pythgoren Theorem. Geometric Men 1. Def: The geometric men etween two positive numers nd is the positive numer x where: = x. x Ex 1: Find the geometric men etween the

More information

1. Introduction. 1.1. Texts and their processing

1. Introduction. 1.1. Texts and their processing Chpter 1 3 21/7/97 1. Introduction 1.1. Texts nd their processing One of the simplest nd nturl types of informtion representtion is y mens of written texts. Dt to e processed often does not decompose into

More information

Graphs on Logarithmic and Semilogarithmic Paper

Graphs on Logarithmic and Semilogarithmic Paper 0CH_PHClter_TMSETE_ 3//00 :3 PM Pge Grphs on Logrithmic nd Semilogrithmic Pper OBJECTIVES When ou hve completed this chpter, ou should be ble to: Mke grphs on logrithmic nd semilogrithmic pper. Grph empiricl

More information

Gene Expression Programming: A New Adaptive Algorithm for Solving Problems

Gene Expression Programming: A New Adaptive Algorithm for Solving Problems Gene Expression Progrmming: A New Adptive Algorithm for Solving Prolems Cândid Ferreir Deprtmento de Ciêncis Agráris Universidde dos Açores 9701-851 Terr-Chã Angr do Heroísmo, Portugl Complex Systems,

More information

Linear Equations in Two Variables

Linear Equations in Two Variables Liner Equtions in Two Vribles In this chpter, we ll use the geometry of lines to help us solve equtions. Liner equtions in two vribles If, b, ndr re rel numbers (nd if nd b re not both equl to 0) then

More information

9.3. The Scalar Product. Introduction. Prerequisites. Learning Outcomes

9.3. The Scalar Product. Introduction. Prerequisites. Learning Outcomes The Sclr Product 9.3 Introduction There re two kinds of multipliction involving vectors. The first is known s the sclr product or dot product. This is so-clled becuse when the sclr product of two vectors

More information

Basic Research in Computer Science BRICS RS-02-13 Brodal et al.: Solving the String Statistics Problem in Time O(n log n)

Basic Research in Computer Science BRICS RS-02-13 Brodal et al.: Solving the String Statistics Problem in Time O(n log n) BRICS Bsic Reserch in Computer Science BRICS RS-02-13 Brodl et l.: Solving the String Sttistics Prolem in Time O(n log n) Solving the String Sttistics Prolem in Time O(n log n) Gerth Stølting Brodl Rune

More information

P.3 Polynomials and Factoring. P.3 an 1. Polynomial STUDY TIP. Example 1 Writing Polynomials in Standard Form. What you should learn

P.3 Polynomials and Factoring. P.3 an 1. Polynomial STUDY TIP. Example 1 Writing Polynomials in Standard Form. What you should learn 33337_0P03.qp 2/27/06 24 9:3 AM Chpter P Pge 24 Prerequisites P.3 Polynomils nd Fctoring Wht you should lern Polynomils An lgeric epression is collection of vriles nd rel numers. The most common type of

More information

Small Business Networking

Small Business Networking Why network is n essentil productivity tool for ny smll business Effective technology is essentil for smll businesses looking to increse the productivity of their people nd business. Introducing technology

More information

Learning Workflow Petri Nets

Learning Workflow Petri Nets Lerning Workflow Petri Nets Jvier Esprz, Mrtin Leucker, nd Mximilin Schlund Technische Universität München, Boltzmnnstr. 3, 85748 Grching, Germny {esprz,leucker,schlund}@in.tum.de Abstrct. Workflow mining

More information

Factoring Polynomials

Factoring Polynomials Fctoring Polynomils Some definitions (not necessrily ll for secondry school mthemtics): A polynomil is the sum of one or more terms, in which ech term consists of product of constnt nd one or more vribles

More information

MATH 150 HOMEWORK 4 SOLUTIONS

MATH 150 HOMEWORK 4 SOLUTIONS MATH 150 HOMEWORK 4 SOLUTIONS Section 1.8 Show tht the product of two of the numbers 65 1000 8 2001 + 3 177, 79 1212 9 2399 + 2 2001, nd 24 4493 5 8192 + 7 1777 is nonnegtive. Is your proof constructive

More information

Rotating DC Motors Part II

Rotating DC Motors Part II Rotting Motors rt II II.1 Motor Equivlent Circuit The next step in our consiertion of motors is to evelop n equivlent circuit which cn be use to better unerstn motor opertion. The rmtures in rel motors

More information

Lec 2: Gates and Logic

Lec 2: Gates and Logic Lec 2: Gtes nd Logic Kvit Bl CS 34, Fll 28 Computer Science Cornell University Announcements Clss newsgroup creted Posted on we-pge Use it for prtner finding First ssignment is to find prtners Due this

More information

Virtual Machine. Part II: Program Control. Building a Modern Computer From First Principles. www.nand2tetris.org

Virtual Machine. Part II: Program Control. Building a Modern Computer From First Principles. www.nand2tetris.org Virtul Mchine Prt II: Progrm Control Building Modern Computer From First Principles www.nnd2tetris.org Elements of Computing Systems, Nisn & Schocken, MIT Press, www.nnd2tetris.org, Chpter 8: Virtul Mchine,

More information

Learning Outcomes. Computer Systems - Architecture Lecture 4 - Boolean Logic. What is Logic? Boolean Logic 10/28/2010

Learning Outcomes. Computer Systems - Architecture Lecture 4 - Boolean Logic. What is Logic? Boolean Logic 10/28/2010 /28/2 Lerning Outcomes At the end of this lecture you should: Computer Systems - Architecture Lecture 4 - Boolen Logic Eddie Edwrds eedwrds@doc.ic.c.uk http://www.doc.ic.c.uk/~eedwrds/compsys (Hevily sed

More information

Unit 6: Exponents and Radicals

Unit 6: Exponents and Radicals Eponents nd Rdicls -: The Rel Numer Sstem Unit : Eponents nd Rdicls Pure Mth 0 Notes Nturl Numers (N): - counting numers. {,,,,, } Whole Numers (W): - counting numers with 0. {0,,,,,, } Integers (I): -

More information

www.mathsbox.org.uk e.g. f(x) = x domain x 0 (cannot find the square root of negative values)

www.mathsbox.org.uk e.g. f(x) = x domain x 0 (cannot find the square root of negative values) www.mthsbo.org.uk CORE SUMMARY NOTES Functions A function is rule which genertes ectl ONE OUTPUT for EVERY INPUT. To be defined full the function hs RULE tells ou how to clculte the output from the input

More information

Small Business Networking

Small Business Networking Why network is n essentil productivity tool for ny smll business Effective technology is essentil for smll businesses looking to increse the productivity of their people nd processes. Introducing technology

More information

1. In the Bohr model, compare the magnitudes of the electron s kinetic and potential energies in orbit. What does this imply?

1. In the Bohr model, compare the magnitudes of the electron s kinetic and potential energies in orbit. What does this imply? Assignment 3: Bohr s model nd lser fundmentls 1. In the Bohr model, compre the mgnitudes of the electron s kinetic nd potentil energies in orit. Wht does this imply? When n electron moves in n orit, the

More information

The remaining two sides of the right triangle are called the legs of the right triangle.

The remaining two sides of the right triangle are called the legs of the right triangle. 10 MODULE 6. RADICAL EXPRESSIONS 6 Pythgoren Theorem The Pythgoren Theorem An ngle tht mesures 90 degrees is lled right ngle. If one of the ngles of tringle is right ngle, then the tringle is lled right

More information

19. The Fermat-Euler Prime Number Theorem

19. The Fermat-Euler Prime Number Theorem 19. The Fermt-Euler Prime Number Theorem Every prime number of the form 4n 1 cn be written s sum of two squres in only one wy (side from the order of the summnds). This fmous theorem ws discovered bout

More information

SE3BB4: Software Design III Concurrent System Design. Sample Solutions to Assignment 1

SE3BB4: Software Design III Concurrent System Design. Sample Solutions to Assignment 1 SE3BB4: Softwre Design III Conurrent System Design Winter 2011 Smple Solutions to Assignment 1 Eh question is worth 10pts. Totl of this ssignment is 70pts. Eh ssignment is worth 9%. If you think your solution

More information

Small Business Networking

Small Business Networking Why network is n essentil productivity tool for ny smll business Effective technology is essentil for smll businesses looking to increse the productivity of their people nd business. Introducing technology

More information

How To Network A Smll Business

How To Network A Smll Business Why network is n essentil productivity tool for ny smll business Effective technology is essentil for smll businesses looking to increse the productivity of their people nd processes. Introducing technology

More information

Algebra Review. How well do you remember your algebra?

Algebra Review. How well do you remember your algebra? Algebr Review How well do you remember your lgebr? 1 The Order of Opertions Wht do we men when we write + 4? If we multiply we get 6 nd dding 4 gives 10. But, if we dd + 4 = 7 first, then multiply by then

More information

SPECIAL PRODUCTS AND FACTORIZATION

SPECIAL PRODUCTS AND FACTORIZATION MODULE - Specil Products nd Fctoriztion 4 SPECIAL PRODUCTS AND FACTORIZATION In n erlier lesson you hve lernt multipliction of lgebric epressions, prticulrly polynomils. In the study of lgebr, we come

More information

Protocol Analysis. 17-654/17-764 Analysis of Software Artifacts Kevin Bierhoff

Protocol Analysis. 17-654/17-764 Analysis of Software Artifacts Kevin Bierhoff Protocol Anlysis 17-654/17-764 Anlysis of Softwre Artifcts Kevin Bierhoff Tke-Awys Protocols define temporl ordering of events Cn often be cptured with stte mchines Protocol nlysis needs to py ttention

More information

Concept Formation Using Graph Grammars

Concept Formation Using Graph Grammars Concept Formtion Using Grph Grmmrs Istvn Jonyer, Lwrence B. Holder nd Dine J. Cook Deprtment of Computer Science nd Engineering University of Texs t Arlington Box 19015 (416 Ytes St.), Arlington, TX 76019-0015

More information

A.7.1 Trigonometric interpretation of dot product... 324. A.7.2 Geometric interpretation of dot product... 324

A.7.1 Trigonometric interpretation of dot product... 324. A.7.2 Geometric interpretation of dot product... 324 A P P E N D I X A Vectors CONTENTS A.1 Scling vector................................................ 321 A.2 Unit or Direction vectors...................................... 321 A.3 Vector ddition.................................................

More information

Engineer-to-Engineer Note

Engineer-to-Engineer Note Engineer-to-Engineer Note EE-280 Technicl notes on using Anlog Devices DSPs, processors nd development tools Visit our Web resources http://www.nlog.com/ee-notes nd http://www.nlog.com/processors or e-mil

More information

Measuring Similarity between Graphs Based on the Levenshtein Distance

Measuring Similarity between Graphs Based on the Levenshtein Distance Appl. Mth. Inf. Sci. 7, No. 1L, 169-175 (01) 169 Applied Mthemtics & Informtion Sciences An Interntionl Journl Mesuring Similrity etween Grphs Bsed on the Levenshtein Distnce Bin Co, ing Li nd Jinwei in

More information

Compiler Construction

Compiler Construction Compiler Construction Regular expressions Scanning Görel Hedin Reviderad 2013 01 23.a 2013 Compiler Construction 2013 F02-1 Compiler overview source code lexical analysis tokens intermediate code generation

More information

Answer, Key Homework 10 David McIntyre 1

Answer, Key Homework 10 David McIntyre 1 Answer, Key Homework 10 Dvid McIntyre 1 This print-out should hve 22 questions, check tht it is complete. Multiple-choice questions my continue on the next column or pge: find ll choices efore mking your

More information

Small Business Networking

Small Business Networking Why network is n essentil productivity tool for ny smll business Effective technology is essentil for smll businesses looking to increse the productivity of their people nd processes. Introducing technology

More information

Pentominoes. Pentominoes. Bruce Baguley Cascade Math Systems, LLC. The pentominoes are a simple-looking set of objects through which some powerful

Pentominoes. Pentominoes. Bruce Baguley Cascade Math Systems, LLC. The pentominoes are a simple-looking set of objects through which some powerful Pentominoes Bruce Bguley Cscde Mth Systems, LLC Astrct. Pentominoes nd their reltives the polyominoes, polycues, nd polyhypercues will e used to explore nd pply vrious importnt mthemticl concepts. In this

More information

On the expressive power of temporal logic

On the expressive power of temporal logic On the expressive power of temporl logic Joëlle Cohen, Dominique Perrin nd Jen-Eric Pin LITP, Pris, FRANCE Astrct We study the expressive power of liner propositionl temporl logic interpreted on finite

More information

Solenoid Operated Proportional Directional Control Valve (with Pressure Compensation, Multiple Valve Series)

Solenoid Operated Proportional Directional Control Valve (with Pressure Compensation, Multiple Valve Series) Solenoid Operted Proportionl Directionl Control Vlve (with Pressure Compenstion, Multiple Vlve Series) Hydrulic circuit (Exmple) v Fetures hese stcking type control vlves show pressure compensted type

More information

Lecture 3 Gaussian Probability Distribution

Lecture 3 Gaussian Probability Distribution Lecture 3 Gussin Probbility Distribution Introduction l Gussin probbility distribution is perhps the most used distribution in ll of science. u lso clled bell shped curve or norml distribution l Unlike

More information

Ratio and Proportion

Ratio and Proportion Rtio nd Proportion Rtio: The onept of rtio ours frequently nd in wide vriety of wys For exmple: A newspper reports tht the rtio of Repulins to Demorts on ertin Congressionl ommittee is 3 to The student/fulty

More information

NQF Level: 2 US No: 7480

NQF Level: 2 US No: 7480 NQF Level: 2 US No: 7480 Assessment Guide Primry Agriculture Rtionl nd irrtionl numers nd numer systems Assessor:.......................................... Workplce / Compny:.................................

More information

Lectures 8 and 9 1 Rectangular waveguides

Lectures 8 and 9 1 Rectangular waveguides 1 Lectures 8 nd 9 1 Rectngulr wveguides y b x z Consider rectngulr wveguide with 0 < x b. There re two types of wves in hollow wveguide with only one conductor; Trnsverse electric wves

More information

APPLICATION NOTE Revision 3.0 MTD/PS-0534 August 13, 2008 KODAK IMAGE SENDORS COLOR CORRECTION FOR IMAGE SENSORS

APPLICATION NOTE Revision 3.0 MTD/PS-0534 August 13, 2008 KODAK IMAGE SENDORS COLOR CORRECTION FOR IMAGE SENSORS APPLICATION NOTE Revision 3.0 MTD/PS-0534 August 13, 2008 KODAK IMAGE SENDORS COLOR CORRECTION FOR IMAGE SENSORS TABLE OF FIGURES Figure 1: Spectrl Response of CMOS Imge Sensor...3 Figure 2: Byer CFA Ptterns...4

More information

When Simulation Meets Antichains (on Checking Language Inclusion of NFAs)

When Simulation Meets Antichains (on Checking Language Inclusion of NFAs) When Simultion Meets Antichins (on Checking Lnguge Inclusion of NFAs) Prosh Aziz Abdull 1, Yu-Fng Chen 1, Lukáš Holík 2, Richrd Myr 3, nd Tomáš Vojnr 2 1 Uppsl University 2 Brno University of Technology

More information

Brillouin Zones. Physics 3P41 Chris Wiebe

Brillouin Zones. Physics 3P41 Chris Wiebe Brillouin Zones Physics 3P41 Chris Wiebe Direct spce to reciprocl spce * = 2 i j πδ ij Rel (direct) spce Reciprocl spce Note: The rel spce nd reciprocl spce vectors re not necessrily in the sme direction

More information

AntiSpyware Enterprise Module 8.5

AntiSpyware Enterprise Module 8.5 AntiSpywre Enterprise Module 8.5 Product Guide Aout the AntiSpywre Enterprise Module The McAfee AntiSpywre Enterprise Module 8.5 is n dd-on to the VirusScn Enterprise 8.5i product tht extends its ility

More information

Repeated multiplication is represented using exponential notation, for example:

Repeated multiplication is represented using exponential notation, for example: Appedix A: The Lws of Expoets Expoets re short-hd ottio used to represet my fctors multiplied together All of the rules for mipultig expoets my be deduced from the lws of multiplictio d divisio tht you

More information