Grammars: Notation to succinctly represent the structure of a language. Example:
|
|
- Caroline Morris
- 7 years ago
- Views:
Transcription
1 Introduction Syntx Anlysis Structure of Lnguge Grmmrs: Nottion to succinctly represent the structure of lnguge. Exmple: Stmt if Expr then Stmt else Stmt Stmt while Expr do Stmt Stmt do Stmt until Expr. Expr Expr + Expr. Compilers Lexicl Anlysis CSE 304/504 1 / 54 Introduction Syntx Anlysis Grmmrs Stmt if Expr then Stmt else Stmt Terminl symols: if, then, else Terminl symols represent group of chrcters in input lnguge: Tokens. Anlogous to words. Nonterminl symols: Stmt, Expr Nonterminl symols represent sequence of terminl symols. Anlogous to sentences. Compilers Lexicl Anlysis CSE 304/504 2 / 54
2 Introduction Syntx Anlysis Phses of Syntx Anlysis 1 Identify the words: Lexicl Anlysis. Converts strem of chrcters (input progrm) into strem of tokens. Also clled Scnning or Tokenizing. 2 Identify the sentences: Prsing. Derive the structure of sentences: construct prse trees from strem of tokens. Compilers Lexicl Anlysis CSE 304/504 3 / 54 Introduction Lexicl Anlysis Lexicl Anlysis Convert strem of chrcters into strem of tokens. Simplicity: Conventions out words re often different from conventions out sentences. Efficiency: Word identifiction prolem hs much more efficient solution thn sentence identifiction prolem. Portility: Chrcter set, specil chrcters, device fetures. Compilers Lexicl Anlysis CSE 304/504 4 / 54
3 Introduction Lexicl Anlysis Terminology Token: Nme given to fmily of words. e.g., integer constnt Lexeme: Actul sequence of chrcters representing word. e.g., Pttern: Nottion used to identify the set of lexemes represented y token. e.g., [0 9]+ Compilers Lexicl Anlysis CSE 304/504 5 / 54 Introduction Lexicl Anlysis Terminology A few more exmples: Token Smple Lexemes Pttern while while while integer constnt 32894, -1093, 0 [0-9]+ identifier uffer size [-za-z]+ Compilers Lexicl Anlysis CSE 304/504 6 / 54
4 Introduction Lexicl Anlysis Ptterns How do we compctly represent the set of ll lexemes corresponding to token? For instnce: The token integer constnt represents the set of ll integers: tht is, ll sequences of digits (0 9), preceded y n optionl sign (+ or ). Oviously, we cnnot simply enumerte ll lexemes. Use Regulr Expressions. Compilers Lexicl Anlysis CSE 304/504 7 / 54 Regulr Expressions Expressions & Mening Regulr Expressions Nottion to represent (potentilly) infinite sets of strings over lphet Σ. : stnds for the set {} tht contins single string. : stnds for the set {, } tht contins two strings nd. Anlogous to Union. : stnds for the set {} tht contins single string. Anlogous to Product. ( )( ): stnds for the set {,,, }. : stnds for the set {ɛ,,,,...} tht contins ll strings of zero or more s. Anlogous to closure of the product opertion. ɛ stnds for the empty string. Compilers Lexicl Anlysis CSE 304/504 8 / 54
5 Regulr Expressions Expressions & Mening Regulr Expressions Exmples of Regulr Expressions over {, }: ( ) : Set of strings with zero or more s nd zero or more s: {ɛ,,,,,,,,,...} ( ): Set of strings with zero or more s nd zero or more s such tht ll s occur efore ny : {ɛ,,,,,,,,,...} ( ) : Set of strings with zero or more s nd zero or more s: {ɛ,,,,,,,,,...} Compilers Lexicl Anlysis CSE 304/504 9 / 54 Regulr Expressions Expressions & Mening Lnguge of Regulr Expressions Let R e the set of ll regulr expressions over Σ. Then, Empty String: ɛ R Unit Strings: α Σ α R Conctention: r 1, r 2 R r 1 r 2 R Alterntive: r 1, r 2 R (r 1 r 2 ) R Kleene Closure: r R r R Compilers Lexicl Anlysis CSE 304/ / 54
6 Regulr Expressions Expressions & Mening Regulr Expressions Exmple: ( ) L 0 = {ɛ} L 1 = L 0 {, } = {ɛ} {, } = {, } L 2 = L 1 {, } = {, } {, } = {,,, } L 3 = L 2 {, }. L = L i = {ɛ,,,,,,,...} i=0 Compilers Lexicl Anlysis CSE 304/ / 54 Regulr Expressions Expressions & Mening Semntics of Regulr Expressions Semntic Function L : Mps regulr expressions to sets of strings. L(ɛ) = {ɛ} L(α) = {α} (α Σ) L(r 1 r 2 ) = L(r 1 ) L(r 2 ) L(r 1 r 2 ) = L(r 1 ) L(r 2 ) L(r ) = {ɛ} (L(r) L(r )) Compilers Lexicl Anlysis CSE 304/ / 54
7 Regulr Expressions Expressions & Mening Computing the Semntics L() = {} L( ) = L() L() = {} {} = {, } L() = L() L() = {} {} = {} L(( )( )) = L( ) L( ) = {, } {, } = {,,, } Compilers Lexicl Anlysis CSE 304/ / 54 Regulr Expressions Expressions & Mening Computing the Semntics of Closure Exmple: L(( ) ) = {ɛ} (L( ) L(( ) )) L 0 = {ɛ} Bse cse L 1 = {ɛ} ({, } L 0 ) = {ɛ} ({, } {ɛ}) = {ɛ,, } L 2 = {ɛ} ({, } L 1 ).. = {ɛ} ({, } {ɛ,, }) = {ɛ,,,,,, } L(( ) ) = L = {ɛ,,,,,,,...} Compilers Lexicl Anlysis CSE 304/ / 54
8 Regulr Expressions Expressions & Mening Another Exmple L(( ) ) : L( ) = {ɛ,,,...} L( ) = {ɛ,,,...} L( ) = {ɛ,,,,,, L(( ) ) = {ɛ},,,,...} {ɛ,,,,,,,,,,...} {ɛ,,,,,,,.,,,,,,,,...} = {ɛ,,,,,,,...} Compilers Lexicl Anlysis CSE 304/ / 54 Regulr Expressions Regulr Definitions Regulr Definitions Assign nmes to regulr expressions. For exmple, Shorthnds: Exmple: digit nturl digit digit + : Set of strings with one or more occurrences of.? : Set of strings with zero or one occurrences of. integer (+ )? digit + Compilers Lexicl Anlysis CSE 304/ / 54
9 Regulr Expressions Regulr Definitions Regulr Definitions: Exmples flot integer. frction integer (+ )? no leding zero no leding zero (nonzero digit digit ) 0 frction no triling zero exponent? no triling zero (digit nonzero digit) 0 exponent (E e) integer digit nonzero digit Compilers Lexicl Anlysis CSE 304/ / 54 Regulr Expressions Regulr Definitions Regulr Definitions nd Lexicl Anlysis Regulr Expressions nd Definitions specify sets of strings over n input lphet. They cn hence e used to specify the set of lexemes ssocited with token. Tht is, regulr expressions nd definitions cn e used s the pttern lnguge How do we decide whether n input string elongs to the set of strings specified y regulr expression? Compilers Lexicl Anlysis CSE 304/ / 54
10 Regulr Expressions Regulr Definitions Using Regulr Definitions for Lexicl Anlysis Q: Is in L((( ) )? A: Hm. Well. Let s see. L(( ) ) = {ɛ} {ɛ,,,,,,,,,,...} {ɛ,,,,,,,.. =???,,,,,,,,...} Compilers Lexicl Anlysis CSE 304/ / 54 Regulr Expressions Regulr Definitions Recognizers Construct utomt tht recognize strings elonging to lnguge. Finite Stte Automt Regulr Lnguges Finite Stte cnnot mintin ritrry counts. Push Down Automt Context-free Lnguges Stck is used to mintin counter, ut only one counter cn go ritrrily high. Compilers Lexicl Anlysis CSE 304/ / 54
11 Finite Stte Automt Recognizers Recognizing Finite Sets of Strings Identifying words from smll, finite, fixed voculry is strightforwrd. For instnce, consider stck mchine with push, pop, nd dd opertions with two constnts: 0 nd 1. We cn use the utomton: p 0 1 u o d integer_constnt s p d h pop dd push Compilers Lexicl Anlysis CSE 304/ / 54 Finite Stte Automt Recognizers Finite Stte Automt Represented y leled directed grph. A finite set of sttes (vertices). Trnsitions etween sttes (edges). Lels on trnsitions re drwn from Σ {ɛ}. One distinguished strt stte. One or more distinguished finl sttes. Compilers Lexicl Anlysis CSE 304/ / 54
12 Finite Stte Automt Recognizers Finite Stte Automt: An Exmple Consider the Regulr Expression ( ) ( ). L(( ) ( )) = {,,,,,,,,,,,...}. The following utomton determines whether n input string elongs to L(( ) ( ): Compilers Lexicl Anlysis CSE 304/ / 54 Finite Stte Automt Recognizers Acceptnce Criterion A finite stte utomton (NFA or DFA) ccepts n input string x... if eginning from the strt stte... we cn trce some pth through the utomton... such tht the sequence of edge lels spells x... nd end in finl stte. Compilers Lexicl Anlysis CSE 304/ / 54
13 Finite Stte Automt Recognizers Recognition with n NFA Is L(( ) ( ))? Input: Accept? Pth 1: no Pth 2: yes Pth 3: no YES Compilers Lexicl Anlysis CSE 304/ / 54 Finite Stte Automt Recognizers Regulr Expressions to NFA Thompson s Construction: For every regulr expression r, derive n NFA N(r) with unique strt nd finl sttes. ɛ α Σ α (r 1 r 2 ) N(r ) 1 N(r ) 2 Compilers Lexicl Anlysis CSE 304/ / 54
14 Finite Stte Automt Recognizers Regulr Expressions to NFA (contd.) r 1 r 2 N(r ) N(r ) 1 2 r N(r) Compilers Lexicl Anlysis CSE 304/ / 54 Finite Stte Automt Recognizers Exmple ( ) ( ): Compilers Lexicl Anlysis CSE 304/ / 54
15 Finite Stte Automt Recognizers Recognition with n NFA Is L(( ) ( ))? Input: Accept? Pth 1: Pth 2: Accept Pth 3: All Pths {1} {1, 2} {1, 3} {1, 2} {1, 3} Accept Compilers Lexicl Anlysis CSE 304/ / 54 Finite Stte Automt Recognizers Recognition with n NFA (contd.) Is L(( ) ( ))? Input: Accept? Pth 1: Pth 2: Pth 3: Accept Pth 4: Pth 5: All Pths {1} {1, 2} {1, 2, 3} {1, 2, 3} {1, 2, 3} Accept Compilers Lexicl Anlysis CSE 304/ / 54
16 Finite Stte Automt Recognizers Recognition with n NFA (contd.) Is L(( ) ( ))? Input: Accept? Pth 1: Pth 2: Pth 3: All Pths {1} {1, 2} {1, 2, 3} {1, 3} {1} REJECT Compilers Lexicl Anlysis CSE 304/ / 54 Finite Stte Automt DFA & NFA Determinism ( ) ( ): Nondeterministic: (NFA) Deterministic: (DFA) Compilers Lexicl Anlysis CSE 304/ / 54
17 Finite Stte Automt DFA & NFA Recognition with DFA Is L(( ) ( ))? Input: Accept? Pth: YES Compilers Lexicl Anlysis CSE 304/ / 54 Finite Stte Automt DFA & NFA NFA vs. DFA For every NFA, there is DFA tht ccepts the sme set of strings. NFA my hve trnsitions leled y ɛ. (Spontneous trnsitions) All trnsition lels in DFA elong to Σ. For some string x, there my e mny ccepting pths in n NFA. For ll strings x, there is one unique ccepting pth in DFA. Usully, n input string cn e recognized fster with DFA. NFAs re typiclly smller thn the corresponding DFAs. Compilers Lexicl Anlysis CSE 304/ / 54
18 Finite Stte Automt DFA & NFA NFA vs. DFA (contd.) R = Size of Regulr Expression N = Length of Input String Size of Automton Recognition time per input string NFA DFA O(R) O(2 R ) O(N R) O(N) Compilers Lexicl Anlysis CSE 304/ / 54 Finite Stte Automt DFA & NFA Converting NFA to DFA Suset construction Given set S of NFA sttes, compute S ɛ = ɛ-closure(s): S ɛ is the set of ll NFA sttes rechle y zero or more ɛ-trnsitions from S. compute S α = goto(s, α): S is the set of ll NFA sttes rechle from S y tking trnsition leled α. S α = ɛ-closure(s ). Compilers Lexicl Anlysis CSE 304/ / 54
19 Finite Stte Automt DFA & NFA Converting NFA to DFA (contd). Ech stte in DFA corresponds to set of sttes in NFA. Strt stte of DFA = ɛ-closure(strt stte of NFA). From stte s in DFA tht corresponds to set of sttes S in NFA: let S = goto(s, α) such tht S is non-empty. dd n α-trnsition to stte s tht corresponds S in NFA, S contins finl NFA stte, nd s is the corresponding DFA stte s is finl stte of DFA Compilers Lexicl Anlysis CSE 304/ / 54 Finite Stte Automt DFA & NFA NFA DFA: An Exmple ɛ-closure({1}) = {1} goto({1}, ) = {1, 2} goto({1}, ) = {1} goto({1, 2}, ) = {1, 2, 3} goto({1, 2}, ) = {1, 3} goto({1, 2, 3}, ) = {1, 2, 3} goto({1, 2, 3}, ) = {1, 3} goto({1, 3}, ) = {1, 2} goto({1, 3}, ) = {1} Compilers Lexicl Anlysis CSE 304/ / 54
20 Finite Stte Automt DFA & NFA NFA DFA: An Exmple (contd.) ɛ-closure({1}) = {1} goto({1}, ) = {1, 2} goto({1}, ) = {1} goto({1, 2}, ) = {1, 2, 3} goto({1, 2}, ) = {1, 3} goto({1, 2, 3}, ) = {1, 2, 3} goto({1, 2, 3}, ) = {1, 3} goto({1, 3}, ) = {1, 2} goto({1, 3}, ) = {1} {1} {1,2} {1,2,3} {1,3} Compilers Lexicl Anlysis CSE 304/ / 54 Generting Lexicl Anlyzers Construction of Lexicl Anlyzer Regulr Expressions nd Definitions re used to specify the set of strings (lexemes) corresponding to token. An utomton (DFA/NFA) is uilt from the ove specifictions. Ech finl stte is ssocited with n ction: emit the corresponding token. Compilers Lexicl Anlysis CSE 304/ / 54
21 Generting Lexicl Anlyzers Specifying Lexicl Anlysis Consider recognizer for integers (sequence of digits) nd flots (sequence of digits seprted y deciml point). [0-9]+ { emit(integer_constant); } [0-9]+"."[0-9]+ { emit(float_constant); } INTEGER_CONSTANT "." 0 9 FLOAT_CONSTANT Compilers Lexicl Anlysis CSE 304/ / 54 Generting Lexicl Anlyzers Lex Tool for uilding lexicl nlyzers. Input: lexicl specifictions (.l file) Output: C function (yylex) tht returns token on ech invoction. Exmple: %% [0-9]+ { return(integer_constant); } [0-9]+"."[0-9]+ { return(float_constant); } Tokens re simply integers (#define s). Compilers Lexicl Anlysis CSE 304/ / 54
22 Lex Specifictions Generting Lexicl Anlyzers %{ C heder sttements for inclusion %} Regulr Definitions e.g.: digit [0-9] %% Token Specifictions e.g.: {digit}+ { return(integer_constant); } %% Support functions in C Compilers Lexicl Anlysis CSE 304/ / 54 Generting Lexicl Anlyzers Regulr Expressions in Lex Adds syntctic sugr to regulr expressions: Rnge: [0-7]: Integers from 0 through 7 (inclusive) [-nx-za-q]: Letters thru n, x thru z nd A thru Q. Exception: [^/]: Any chrcter other thn /. Definition: {digit}: Use the previously specified regulr definition digit. Specil chrcters: fetures. e.g.: * ^ Connectives of regulr expression, convenience Compilers Lexicl Anlysis CSE 304/ / 54
23 Generting Lexicl Anlyzers Specil Chrcters in Lex * +? ( ) Sme s in regulr expressions [ ] Enclose rnges nd exceptions { } Enclose nmes of regulr definitions ^ Used to negte specified rnge (in Exception). Mtch ny single chrcter except newline \ Escpe the next chrcter \n, \t Newline nd T For literl mtching, enclose specil chrcters in doule quotes (") e.g.: "*" Or use \ to escpe. e.g.: \* Compilers Lexicl Anlysis CSE 304/ / 54 Exmples Generting Lexicl Anlyzers for Sequence of f, o, r " " C-style OR opertor (two vert. rs).* Sequence of non-newline chrcters [^*/]+ Sequence of chrcters except * nd / \"[^"]*\" Sequence of non-quote chrcters eginning nd ending with quote ({letter} " ")({letter} {digit} " ")* C-style identifiers Compilers Lexicl Anlysis CSE 304/ / 54
24 A Complete Exmple Generting Lexicl Anlyzers %{ #include <stdio.h> #include "tokens.h" %} digit [0-9] hexdigit [0-9-f] %% "+" { return(plus); } "-" { return(minus); } {digit}+ { return(integer_constant); } {digit}+"."{digit}+ { return(float_constant); }. { return(syntax_error); } %% Compilers Lexicl Anlysis CSE 304/ / 54 Actions Generting Lexicl Anlyzers Actions re ttched to finl sttes. Distinguish the different finl sttes. Used to return tokens. Cn e used to set ttriute vlues. Frgment of C code (locks enclosed y { nd } ). Compilers Lexicl Anlysis CSE 304/ / 54
25 Generting Lexicl Anlyzers Attriutes Additionl informtion out token s lexeme. Stored in vrile yylvl Type of ttriutes (usully union) specified y YYSTYPE Additionl vriles: yytext: Lexeme (Actul text string) yyleng: length of string in yytext yylineno: Current line numer (numer of \n seen thus fr) enled y %option yylineno Compilers Lexicl Anlysis CSE 304/ / 54 Priority of mtching Generting Lexicl Anlyzers Wht if n input string mtches more thn one pttern? "if" { return(token_if); } {letter}+ { return(token_id); } "while" { return(token_while); } A pttern tht mtches the longest string is chosen. Exmple: if1 is mtched with n identifier, not the keyword if. Of ptterns tht mtch strings of sme length, the first (from the top of file) is chosen. Exmple: while is mtched s n identifier, not the keyword while. Compilers Lexicl Anlysis CSE 304/ / 54
26 Generting Lexicl Anlyzers Constructing Scnners using (f)lex Scnner specifictions: specifictions.l (f)lex specifictions.l lex.yy.c Generted scnner in lex.yy.c (g)cc lex.yy.c executle yywrp(): hook for signlling end of file. Use -lfl (flex) or -ll (lex) flgs t link time to include defult function yywrp() tht lwys returns 1. Compilers Lexicl Anlysis CSE 304/ / 54 Generting Lexicl Anlyzers Implementing Scnner trnsition : stte Σ stte lgorithm scnner() { current stte = strt stte; while (1) { c = getc(); /* on end of file,... */ if defined(trnsition(current stte, c)) current stte = trnsition(current stte, c); else return s; } } Compilers Lexicl Anlysis CSE 304/ / 54
27 Generting Lexicl Anlyzers Implementing Scnner (contd.) Implementing the trnsition function: Simplest: 2-D rry. Spce inefficient. Trditionlly compressed using row/colum equivlence. (defult on (f)lex) Good spce-time trdeoff. Further tle compression using vrious techniques: Exmple: RDM (Row Displcement Method): Store rows in overlpping mnner using 2 1-D rrys. Smller tles, ut longer ccess times. Compilers Lexicl Anlysis CSE 304/ / 54 Generting Lexicl Anlyzers Lexicl Anlysis: Summry Convert strem of chrcters into strem of tokens. Mke rest of compiler independent of chrcter set Strip off comments Recognize line numers Ignore white spce chrcters Process mcros (definitions nd uses) Interfce with symol tle (lso clled nme tle ). Compilers Lexicl Anlysis CSE 304/ / 54
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 informationHomework 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 informationRegular 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 informationOne 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 informationJava 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 informationFORMAL 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 informationRegular 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 informationBypassing 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 informationA 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 informationReasoning 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 information0.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 informationSection 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 informationSolution 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 informationExample 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 informationPolynomial 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 information1.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 informationBinary 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 informationCS99S 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 information5 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 informationFAULT 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 informationand 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 informationModular 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 information9 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 informationWords Symbols Diagram. abcde. a + b + c + d + e
Logi Gtes nd Properties We will e using logil opertions to uild mhines tht n do rithmeti lultions. It s useful to think of these opertions s si omponents tht n e hooked together into omplex networks. To
More informationConcept 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 informationData Compression. Lossless And Lossy Compression
Dt Compression Reduce the size of dt. ƒ Reduces storge spce nd hence storge cost. Compression rtio = originl dt size/compressed dt size ƒ Reduces time to retrieve nd trnsmit dt. Lossless And Lossy Compression
More informationPROF. 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 informationAutomated 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 informationBayesian 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 informationNQF 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 informationUnit 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 informationRegular 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 informationUnambiguous 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 informationEQUATIONS 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 informationPointed 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 informationMath 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 informationSolutions 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 informationProtocol 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 informationOperations with Polynomials
38 Chpter P Prerequisites P.4 Opertions with Polynomils Wht you should lern: Write polynomils in stndrd form nd identify the leding coefficients nd degrees of polynomils Add nd subtrct polynomils Multiply
More informationGenerating 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 information1. 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 informationAntiSpyware 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 informationUse 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 informationLec 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! What can a computer do? ! What can a computer do with limited resources? ! Don't talk about specific machines or problems.
Introduction to Theoreticl CS ecture 18: Theory of Computtion Two fundmentl questions.! Wht cn computer do?! Wht cn computer do with limited resources? Generl pproch. Pentium IV running inux kernel.4.!
More informationFactoring 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 informationMorgan Stanley Ad Hoc Reporting Guide
spphire user guide Ferury 2015 Morgn Stnley Ad Hoc Reporting Guide An Overview For Spphire Users 1 Introduction The Ad Hoc Reporting tool is ville for your reporting needs outside of the Spphire stndrd
More informationLINEAR 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 informationSolenoid 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 informationGeometry 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 informationSmall 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 informationSmall 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 informationAppendix 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 informationRotating 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 informationSmall 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 informationGraphs 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 informationFor updated version of this document see http://imechanica.org/node/19709 CARTESIAN PRODUCT
CARTESIAN PRODUCT Tuple is collective nme for doule, triple, qudruple, etc. An n-tuple is n ordered list of n items. The Crtesin product of n sets S 1,...,S n is the collection of ll tuples, ech of which
More informationExperiment 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 informationHP Application Lifecycle Management
HP Appliction Lifecycle Mngement Softwre Version: 11.00 Tutoril Document Relese Dte: Novemer 2010 Softwre Relese Dte: Novemer 2010 Legl Notices Wrrnty The only wrrnties for HP products nd services re set
More informationOn 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 information1. 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 informationBrillouin 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 informationDATABASDESIGN 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 information2 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 informationChapter. Contents: A Constructing decimal numbers
Chpter 9 Deimls Contents: A Construting deiml numers B Representing deiml numers C Deiml urreny D Using numer line E Ordering deimls F Rounding deiml numers G Converting deimls to frtions H Converting
More informationP.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 informationSolving 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 informationFUNCTIONS AND EQUATIONS. xεs. The simplest way to represent a set is by listing its members. We use the notation
FUNCTIONS AND EQUATIONS. SETS AND SUBSETS.. Definition of set. A set is ny collection of objects which re clled its elements. If x is n element of the set S, we sy tht x belongs to S nd write If y does
More informationString Searching. String Search. Spam Filtering. String Search
String Serch String Serching String serch: given pttern string p, find first mtch in text t. Model : cn't fford to preprocess the text. Krp-Rin Knuth-Morris-Prtt Boyer-Moore N = # chrcters in text M =
More informationHow 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 information4.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 informationA.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 informationHow 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 informationAutomata 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 information1.2 The Integers and Rational Numbers
.2. THE INTEGERS AND RATIONAL NUMBERS.2 The Integers n Rtionl Numers The elements of the set of integers: consist of three types of numers: Z {..., 5, 4, 3, 2,, 0,, 2, 3, 4, 5,...} I. The (positive) nturl
More informationVectors 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 informationLecture 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 informationAPPLICATION 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 informationUnderstanding Basic Analog Ideal Op Amps
Appliction Report SLAA068A - April 2000 Understnding Bsic Anlog Idel Op Amps Ron Mncini Mixed Signl Products ABSTRACT This ppliction report develops the equtions for the idel opertionl mplifier (op mp).
More informationMultiplication and Division - Left to Right. Addition and Subtraction - Left to Right.
Order of Opertions r of Opertions Alger P lese Prenthesis - Do ll grouped opertions first. E cuse Eponents - Second M D er Multipliction nd Division - Left to Right. A unt S hniqu Addition nd Sutrction
More informationHillsborough Township Public Schools Mathematics Department Computer Programming 1
Essentil Unit 1 Introduction to Progrmming Pcing: 15 dys Common Unit Test Wht re the ethicl implictions for ming in tody s world? There re ethicl responsibilities to consider when writing computer s. Citizenship,
More informationIaaS Configuration for Virtual Platforms
IS Configurtion for Virtul Pltforms vcloud Automtion Center 6.0 This document supports the version of ech product listed nd supports ll susequent versions until the document is replced y new edition. To
More informationEngineer-to-Engineer Note
Engineer-to-Engineer Note EE-265 Technicl notes on using Anlog Devices DSPs, processors nd development tools Contct our technicl support t dsp.support@nlog.com nd t dsptools.support@nlog.com Or visit our
More informationSmall 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 informationOr more simply put, when adding or subtracting quantities, their uncertainties add.
Propgtion of Uncertint through Mthemticl Opertions Since the untit of interest in n eperiment is rrel otined mesuring tht untit directl, we must understnd how error propgtes when mthemticl opertions re
More informationIntegration 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 informationQuick Reference Guide: One-time Account Update
Quick Reference Guide: One-time Account Updte How to complete The Quick Reference Guide shows wht existing SingPss users need to do when logging in to the enhnced SingPss service for the first time. 1)
More informationCompiler 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 informationAnswer, 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 informationSTRM Log Manager Installation Guide
Security Thret Response Mnger Relese 2012.0 Juniper Networks, Inc. 1194 North Mthild Avenue Sunnyvle, CA 94089 USA 408-745-2000 www.juniper.net Pulished: 2012-09-12 Copyright Notice Copyright 2012 Juniper
More informationExample 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 informationVirtual 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 informationNetwork Configuration Independence Mechanism
3GPP TSG SA WG3 Security S3#19 S3-010323 3-6 July, 2001 Newbury, UK Source: Title: Document for: AT&T Wireless Network Configurtion Independence Mechnism Approvl 1 Introduction During the lst S3 meeting
More informationHow To Set Up A Network For Your Business
Why Network is n Essentil Productivity Tool for Any Smll Business TechAdvisory.org SME Reports sponsored by Effective technology is essentil for smll businesses looking to increse their productivity. Computer
More informationScalable Mining of Large Disk-based Graph Databases
Sclle Mining of Lrge Disk-sed Grph Dtses Chen Wng Wei Wng Jin Pei Yongti Zhu Bile Shi Fudn University, Chin, {chenwng, weiwng1, 2465, shi}@fudn.edu.cn Stte University of New York t Bufflo, USA & Simon
More informationPhysics 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 informationExample- Based Learning in Computer- Aided STEM Education
contriuted rticles Exmple- Bsed Lerning in Computer- Aided STEM Eduction DOI:10.1145/2634273 Exmple-sed resoning techniques developed for progrmming lnguges lso help utomte repetitive tsks in eduction.
More informationModule Summary Sheets. C3, Methods for Advanced Mathematics (Version B reference to new book) Topic 2: Natural Logarithms and Exponentials
MEI Mthemtics in Ection nd Instry Topic : Proof MEI Structured Mthemtics Mole Summry Sheets C, Methods for Anced Mthemtics (Version B reference to new book) Topic : Nturl Logrithms nd Eponentils Topic
More informationWelch Allyn CardioPerfect Workstation Installation Guide
Welch Allyn CrdioPerfect Worksttion Instlltion Guide INSTALLING CARDIOPERFECT WORKSTATION SOFTWARE & ACCESSORIES ON A SINGLE PC For softwre version 1.6.5 or lter For network instlltion, plese refer to
More information