2013 Lecture03 Lexical Analysis (II)
Lecture3-1 Morphology形态学

Chapter 13 MorphologyThe description of a language deals with all the four facets_ sounds, constructions, meanings and forms of words.The sub-field that studies the functioning of sound-units within the systems of individual languages is called phonology. The branch that is concerned with the meanings of linguistic units is semantics. Morphology overlaps with each of the other three subbranches as a word is a sound unit that has meaning and syntactic function.1.Definitions of MorphologyMorphology: the study of word-formation, or the internal structure of words, or the rules by which words are formed from smaller components -- morphemes.The smallest unit of language in terms of relationship between expression and content, a unit that cannot be further divided into smaller units without destroying or drastically altering the meaning, whether it is lexical or grammatical.Morphology(The study of the internalstructure of words)Inflection (Inflectional morphology)(Deals with the grammatical forms of the same word)Word-formation (Lexical morphology)(Deals with the creation of new words)2. Morpheme, morph, allomorphThe basic unit of morphological description is the morpheme, the smallest unit for grammatical and lexical analysis.Morphemes are abstract units, established for the analysis of word structure.Words can be separated into smaller meaningful units. These minimal meaningful units are known as morpheme.When a word segment represents one morpheme in sound or writing, the segment is a morph. Morpheme are abstract units, which are realized in speech by discrete units known as Morphs. They are actual spoken forms, minimal carriers of meaning.The morph is to a morpheme what a phone is to a phoneme .AllomorphVariant members of a set of morphs areALLOMORPHS of the same morpheme: in-,im-, il-, and ir- are allomorphs of a particularprefix morpheme.Morphemes are distinguished by beingplaced in braces: {and}, {fame}, {in1}.The difference between morph and allomorphs: P119Morpheme(语素)-the minimal units of meaningUndesirabilityIt is formed by combining four distinct units of meaning.Un+desire+able+ityEach of these distinct unit of meaning is a morpheme.Morpheme: the most basic element of meaning.3.Types of morphemes3.1 Free vs. Bound morphemes:Free morphemes: those that may constitute words by themselves, e.g. boy, girl, table, nation. Bound morphemes: those that cannot occur alone, eg -s, -ed, dis-, un-.3.2 Derivational (派生)and inflectional(曲折变化)morphemesInflection: grammatical endings, e.g. plural, tense, comparative, etc.Walk+ingWalk+edWhen inflectional morphemes are attached to other morphemes, they are purely grammatical markers, signifying such concepts as tense, number, case and so on.Derivation: combination of a base and an affix to form a new word, e.g. friend+-ly > friendly. When derivational morphemes are conjoined to other morphemes, a new word is derived, or formed.Tele+commuteMacro+economicsPhysic+ianFad+ismRoot: the base form of a word that cannot be further analyzed without total loss of identity, e.g. friend as in unfriendliness.Roots may befree: those that can stand by themselves, e.g. black+board; nation+-al; orbound: those that cannot stand by themselves, e.g. -ceive in receive, perceive, conceive.Affix: the type of formative that can be used only when added to another morpheme. Normally divided intoprefix (dis-, un-) andsuffix (-en, -ify).Stem: a morpheme or combination of morphemes to which an inflectional affix may be added, e.g. friend+-s; write+-ing, possibility+-es.Representing Word StructureRoots and Affixes (I)1. NV Afteach er2. Roots and Affixes (II)a. Ab. NAf A N Afun kind book sRoots and Affixes (III)c. Vd. VA Af V Afmodern ize destroy ed4.Word-formation4.1 open class and closed classVariable and invariable wordsfollow(s,ing,ed) ; when hello seldom inGrammatical and lexical words(function and Content words)conjunctions, preposition, articles, pronounsbut, and, when, in, off, the, a, his, your.Closed and open class words.pronouns, prepositions, conjunctions, articlesshe, they, to, on, above, when, where, a, the.nouns, verbs, adjectives, adverbs, some prepositions.(out of, by means of, with regard to)Word class(parts of speech): noun, pronoun, adjective, verb, adverb, preposition, conjunction, interjection, article. Particles, auxiliaries(助词), pro-form, determiners. Inflectional Morphology Derivational/Lexical MorphologyMorphology4.2 Internal structure of words and rules for word formationLike---dislikeOrder---disorderInternal structure: Dis+like dis+orderRules: a negative is formed by adding dis to the end of a verb.Morphology: it refers to the study of the internal structure of words.4.3 Morphological rules of word formationSlowlyClearlyThe ways words are formed are called morphological rules.If a rule can be used freely to form new words, they are called productive morphological rules.Un+adjective=not-adjectiveSad-unsad* (*:unaccepted)Brave-unbrave*Undecided unchecked undeclaredUn-Rule is not as productive for adjectives composed of just one morpheme as for adjective that derived from verbs.BasesVBase for -ed VRoot and base A Af Affor -enblack en ed3.5 CompoundsNounN NN N N Nfire engine green houseVerbV VN V A Vspoon feed white washAdjectiveA AN A A Anation wide red hotMoreComplicatedNN N N N N N Sunday night concert seriesOther Types of Word Formation(I)Clippingprofessor profphysical education phys-edBlendsbreakfast + lunch brunchinformation + commercial informercialOther Types of Word Formation (II)3. Backformationattrition attritoration orat4. Conversiona. V to Nink a (contract)b. N from V(a building) permitc. V from Adirty (a shirt)4.4 Word-formation through lexical change4.4.1 Invention/CoinageKodak, Coke, nylon, Xerox, Bandit, Lycra4.4.2 Blendingtransfer+resistor>transistorsmoke+fog>smogmotorist+hotel>motelbreakfast+lunch>brunchmodulator+demodulator>modemdance+exercise>dancerciseadvertisement+editorial>advertorialeducation+entertainment>edutainmentinformation+commercial>infomercial4.4.3 AbbreviationsClippingBack-clippings: ad(vertisement), chimp(anzee), deli(catessen), exam(ination), hippo(potamus), lab(oratory), piano(forte), reg(ulation)sFore-clippings: (ham)burger, (omni)bus, (violin)cello, (heli)copter, (alli)gator, (tele)phone, (earth)quake.Fore-and-aft clippings: (in)flu(enza), (de)tec(tive).AcronymAIDS, Aids: Acquired Immune Deficiency SyndromeASAP: as soon as possibleCD-ROM: compact disc read-only memoryWASP: white Anglo-Saxon protestantInitialismAI: artificial intelligencea.s.a.p.: as soon as possibleECU: European Currency UnitHIV: human immunodeficiency virusPC: personal computerPS: postscriptRSVP: répondez s’il vous plait (‘please reply’ in French)4.4.4 Back-formationburgle, commentate, edit, peddle, scavenge, sculpt, swindleair-condition, babysit, brainstorm, brainwash, browbeat, dry-clean, house-hunt, housekeep, sightsee, tape-recordarticulate, assassinate, coeducate, demarcate, emote, intuit, legislate, marinate, orate, vaccinate, valuatediagnose < diagnosisenthuse < enthusiasmlaze < lazyliaise < liaisonreminisce < reminiscencestatistic < statisticstelevise < television4.4.5 Analogical creationFrom irregular to regular:work: wrought > workedbeseech: besought > beseechedslay: slew > slayed?go: went > goed???4.4.6 BorrowingFrench: administration, parliament, public, revenue, tax; court, crime, defendant, judge, jury, justice, pardon, sue;army, enemy, guard, officer, peace, soldier, war; clergy, faith, prayer, religion, sermon, service; coat, costume, dress, fashion, frock, jewel, lace;boil, dinner, feast, fry, roast, supper, toast;bargain, butcher, customer, grocer, money, price, value;art, college, music, poet, prose, story, studyLatin: admit, client, conviction, custody, discuss, equal, index, infinite, intellect, library, medicine, minor, opaque, prosecute, pulpit, scribe, scripture, simile, testimonyGreek: acme, bathos, catastrophe, cosmos, criterion, idiosyncrasy, kudos, misanthrope, pathos, pylon, thermSpanish and Portuguese: anchovy, armada, banana, barbecue, cafeteria, cannibal, canoe, canyon, cargo, cask, chilli (or chili), chocolate, cigar, cocaine, cockroach, cocoa, desperado, embargo, guitar, mosquito, negro, port (wine), potato, ranch, renegade, sherry, siesta, tango, tank, tobacco, tomato, vanillaItalian: aria, artichoke, bandit, broccoli, cameo, carnival, casino, concerto, duet, finale, ghetto, graffiti (singular graffito), incognito, inferno, influenza, larva, libretto, macaroni, maestro, mafia, malaria, paparazzi (singular paparazzo), piano, pizza, ravioli, regatta, replica, scampi, solo, soprano, spaghetti, studio, umbrella, vendetta, vermicelli, volcanoDutch: apartheid, booze, boss, brandy, buoy, coleslaw, commando, cookie, cranberry, cruise, deck, decoy, dock, dollar, dope, easel, excise, freight, furlough, gin, kit, knapsack, landscape, luck, onslaught, pickle, reef, sketch, skipper, slim, smuggle, snap, snip, trek, waffle, wagon, yachtHebrew: amen, babel, cabbala (or cabala, kabbala, kabala), camel, cherub, jubilee, manna, messiah, sabbath, satan, seraph, shibbolethArabic: admiral, albatross, alchemy, alcohol, alcove, algebra, alkali, almanac, amber, assassin, candy, cipher (or cypher), harem, hazard, lemon, magazine, nadir, safari, sherbet, sofa, syrup, zenith, zeroIndian: bungalow, cashmere, chutney, cot, curry, dinghy, ginger, guru, juggernaut, jungle, jute, loot,mango, pariah, polo, punch, pundit, pyjamas (or pajamas), shampoo, swastika, thug, toddy, veranda (or verandah), yogaChinese: chop suey, chow, chow mein, ginseng, gung-ho, ketchup (or catchup or catsup), kung fu, tea, tofu (via Japanese), typhoon4.4.7 Types of loan wordsLoanwords:au pair, encore, coup d’etat, kungfu, sputnikLoanblendcoconut: coco (Spanish) + nut (English)Chinatown: China (Chinese) + town (English)Loanshiftbridge: meaning as a card game borrowed from Italian ponteLoan translation, or calquefree verse < L verse libreblack humor < Fr humour noirfound object < Fr objet trouvéThe counterpoint of phonology(音位学)and morphology(形态学)A single phoneme may represent a single morpheme, but they are not identical.boys /bɔɪz/ b. boy’s /bɔɪz/ c. raise /reiz/The counterpoint of phonology(音位学)and morphology(形态学)2. Allomorph: a morpheme may have alternate shapes or phonetic forms.Map---maps--s---/s/Dog---dogs---s---/z/Watch-Watches-es-/iz/Mouse-mice-ic-----/ai/Ox-oxen----en----/n/Tooth-teeth--ee---/i:/Sheep-sheep-ee---/0/。
学术英语写作讲义

学术英语写作讲义Lecture 11.1Features on the lexical level(词汇层⾯)(1) The analysis didn’t yield any new results. (Informal)The analysis yielded no results. (Formal)(2) These semiconductors can be used in robots, CD players, etc. (Informal)These semiconductors can be used in robots, and CD players. (Formal)1.1.2Nominalization(名词化)(1)[Everyday English]If a potential is applied to gas at low pressure, ionization of the molecules will result. [Academic English]The application of a potential to gas at low pressure will result in ionization of the molecules.(2)[Everyday English]The progress of the work will depend on how modern the equipment is.[Academic English]The progress of the work will depend on the modernization ofthe equipment.1.1.3Hedging(模糊语)(1)On the evidence of the findings presented in Figure 1, it would appear that students in Hong Kong generally have little need to speak in English outside the classroom.(2) Weismann suggested that animals become old because, if they did not, there could be no successive replacement of individuals and hence no evolution.1.1.4 Use of single verbs (使⽤单⼀动词)(1)The material amenities of life have gone up in Western society.( increased )(2)A primary education system was set up throughout Ireland as early as 1831.(establish)其他如look into(investigate);get rid of(eliminate)1.2.1⼤量使⽤被动语态(1) Any container can be filled by these as they diffuse and spread out to fill them. The atoms or molecules of gases move very rapidly and are widely spaced..(2) Using a simplified input-output (I-O) framework, the aggregate economic output of the non-energy sector (Yt) can be formulated as the sum of value-added in the non-energy sector (Vane,t) and inter-industry payments for energy and transport services.1.2.2客观语⾔(1)I chose this method because it is less complex. (personal)This method is chosen because it is less complex.(2)The conclusions are appalling and account, to a large extent, for the terrible morbidity and mortality statistics of this community.Text 2This paper presents the findings of an analysis of teamwork development. The group selected for this assignment (the survey team) is a small team of four people working in a small department of Advance Tours. The performance of the team and the team members’attitudes to their team were measured using two questionnaires developed by Cacioppe (1998). An analysis of the findings is then presented and recommendations are made as to what measures can be employed to improve the overall teamwork and performance of the team.客观语⾔,句⼦改写Lecture 2Being brief and concisee.g. (1a) Preliminary observations on the effect of Zn element on anticorrosion(防腐蚀)of zinc plating layer (镀锌层) (wordy)(1b) Effect of Zn on anticorrosion of zinc plating layer (concise)e.g.《中国近代纸币史》中⼏个学术问题的探讨(2a)Discussion on Several Academic problems in the Book The Modern History of Chinese Pa per Money(wordy)(2b)Several Questions in Modern History of Chinese Banknotes(concise)2.3 Keywords(1)Functions of keywordsKeywords of a research paper are the most frequently used words and the most important words and phrases of the paper. They are representative of the theme of the paper. As it mainly functions for easiness of retrieval, “keywords”is also variously called “indexing terms”(索引词), “keywords index”, “keywords and phrases”.(2)Form and number of keywords◇Keywords of research paper appear in the form of nouns, not verbs, For example, “investigation”is used instead of “investigate”.◇In general, the number of keywords ranges from 2 to 8. The normal limited number of keywords is four to six in one paper ◇As usual, keywords are chosen from the “title”and/or “abstract”, where the key terms of words and phrases are usually contained(3)Location of keywordsThough keywords can be either above or below the abstract of a paper, they are yet, in most cases, placed below the abstract. They are in lowercase except abbreviations.(4)Methods of spacing keywordsThere are three methods of spacing keywords:using comma ,semicolon ;larger partitionFull stop could not be used to space keywords.如:(1)“software component,(;) UML, (;) rational database”.2.4Common scientific foundation elements in Acknowledgements.1.⾼技术研究发展计划资助项⽬(863计划)(No.)National High Technology Research and Development Program of China (863 Program) (No.)2.⾃然科学基⾦(⾯上项⽬:重点项⽬:重⼤项⽬:)No.National Natural Science Foundation of China (General Program; Key Program; Major Program)3.教育部博⼠点基⾦资助项⽬(No.)Ph.D Programs Foundation of Ministry of Education of China.4重点基础研究发展规划项⽬(973计划)(No.)The Major State Basic Research Development Program of China (973 program)5. “⼗⼀五”攻关项⽬National Key Technologies R & D Program of China during the 11th Five Year Plan Period (No.)Lecture 3Descriptive Abstract(1) This paper presents an analysis of the principles of magnetic refrigeration with application to air-conditioning. A comparison with conventional evaporation-condensation gas cycle device is presented. Conclusions concerning the applicability of magnetic refrigeration to air conditioning are made.(2) The purpose of this project is to measure environmental equity in Salem, Oregon, with an aim to contribute to a growing body of literature concerned with the unequal distribution of environmental hazards .The project analyzes important previous studies and then conducts an investigation that centers around a series of GIS (Geographic Information System) maps that reveal correlations between environmental hazards and demographics(统计学), such as race and income level. The results will be revealed and discussed.(3) The Postmodern Appeal of complementary and Alternative medicines (CAM) to Australian Consumers: A Review of the LiteratureThe increasing popularity of complementary and alternative medicines (CAM) amongst health consumers and orthodox service providers in Australia is well documented. However, understandings about the reasons for increasing consumer use of CAM in Australia and elsewhere are poorly developed and invite further research.This paper presents the results of a systematic literature review on reasons for CAM use by the Australian population. There are four main themes: 1) criticism of conventional medicine, 2)attraction to the holistic model(整体模型)of health, 3) treatment options for chronic and terminal illness, and 4) lifestyle factors which are identified and explored through social change theory, namely, globalization and post-modernization(4) Mechanism of Angiogenesis(⾎管⽣成) and Arteriogenesis (动脉⽣成)Endothelial(⽪细胞)and smooth music cells interact with each other to form new blood vessels. In this review, the cellular and molecular mechanisms(细胞分⼦机制)underlying the formation of endothelium-lined channels (angiogenesis) and their maturation via recruitment of smooth muscle cells (arteriogenesis) during physiological and pathological(病理学的)conditions are summarized, alongside with possible therapeutic applications. Informative AbstractThe major components of an informative abstract:(1)PurposeThe purpose of the study introduces the reason, the origin, the importance and significance of the study in question, including the premise, purpose and tasks and scope of the research. The purpose section of an informative abstract might also contain the hypothesis of the experiment.(2)MethodologyResearch methods present the methods or techniques of the research, including the model, theory, conditions, objects,sampling method, sample size,materials, technology, means, equipment, procedures (study design (e.g., survey), data collection and analysis.(3)ResultResults report the results of the study, including data, identified relationship, observation results, effectiveness and performance achieved.(4)ConclusionsConclusions comment on the main contribution or value of the research paper. It includes an analysis, comparison, evaluation of the research results (e.g. interpret the results as supporting or not supporting the theory or hypotheses), new issues raised, further studies of the future, assumptions, inspirations, recommendations and forecasts.当今绝⼤部分的科技期刊和会议论⽂都要求作者提供信息性摘要):信息性摘要主要报道论⽂的研究⽬的、研究法、研究结果与结论。
2013年考研英语Text2阅读逐句分析

2013年考研英语Text2阅读逐句分析An old saying has it that half of all advertising budgets are wasted—the trouble is, no one knows which half. In the internet age, at least in theory,this fraction can be much reduced. By watching what people search for, click on and say online, companies can aim “behavioral” ads at those most likely to buy.26. It is suggested in paragraph 1 that “behavioral”ads help advertisers to _______.[A] lower their operational costs(降低运营成本)[B] ease competition among themselves(缓和内部竞争)[C] avoid complaints from consumers(避免消费者投诉)[D] provide better online services(提供更好的在线服务)单词&词组搭配•budget[ˈbʌdʒɪt](出现7次)n.预算;v.把...编入预算;[僻义]adj.价格低廉的•fraction [ˈfrækʃn](出现2次)n.少量,部分,分数•In the....age(在....时代)•at least (至少)•click on(点击)•aim at(针对)本段翻译常言道,一半的广告预算都被浪费了——问题是,没人知道是哪一半。
在互联网时代,至少在理论上,被浪费掉的这部分能被大幅度减少。
Lecture 11 lexical cohesion 英语词汇学 教学课件

endophora(指内)
What is exophora?
❖ It is also called exophoric reference or situation reference, referring to an item whose referent is retrievable in the context of situation.
Task 1 Brainstorming
❖ _______ but he couldn’t keep her
❖ Please help make a complete sentence with the part mentioned above
❖ Peter had a wife but he couldn’t keep her
❖ There are two main types of cohesion: grammatical, referring to the structural content, and lexical, referring to the language content of the piece. A cohesive text is created in many different ways. In Cohesion in English, Halliday and Hasan identify five general categories of cohesive devices that create coherence in texts: reference, ellipsis, substitution, lexical cohesion, and conjunction.
Cp3编译原理

CHAPTER 3 LEXICAL ANALYSIS Section 2 Specification of Tokens 3、The rule of regular expression over alphabet 1) is a regular expression that denote {} • is regular expression • {} is the related regular language 2) If a is a symbol in , then a is a regular expression that denotes {a} • a is regular expression • {a} is the related regular language
4、Terms of the lexical analyzer – Token • Types of words in source program • Keywords, operators, identifiers, constants, literal strings, punctuation symbols(such as commas,semicolons) – Lexeme • tual words in source program – Pattern • A rule describing the set of lexemes that can represent a particular token in source program • Relation {<.<=,>,>=,==,<>}
CHAPTER 3 LEXICAL ANALYSIS Section 1 The role of the lexical analyzer 6、Lexical Errors – Deleting an extraneous character – Inserting a missing character – Replacing an incorrect character by a correct character – Transposing two adjacent characters(such as , fi=>if) – Pre-scanning
(NEW)胡壮麟《语言学教程》(第5版)配套题库【考研真题精选+章节题库】

第一部分 考研真题精选
一、填空题
1. Chomsky proposes that the course of language acquisition is determined by a(n) _____language faculty.(中山大学2018研) 【答案】innate 【解析】乔姆斯基认为语言习得的过程是由人的内在语言机制决定的。
6. A principal distinction between morphology and syntax is that the former is concerned with the internal composition of a word, whereas the latter is concerned with _____ of words.(中山大学2017研)
12. When language is used for establishing an atmosphere or maintaining social contact rather than exchanging information or ideas, its function is _____ function.(北二外2015研) 【答案】phatic 【解析】本题考查语言的寒暄功能。寒暄功能是语言最基本的一项功 能。人们用寒暄语来营造一种气氛或保持社会联系而非交流信息。人们 使用寒暄语就是为了缓和谈话双方的关系,同时使谈话双方从心理上得 到满足。
5. Phonetics is the study of _____ sounds that the human voice is capable of creating whereas phonology is the study of a subset of those sounds that constitute language and meaning.(北京邮电大学2015研) 【答案】speech 【解析】本题考查语音学和音系学的含义。语音学研究语音的发生、传 递和感知。音系学研究的是语言的语音系统。换句话说,音系学研究的 是说话人为表达意义而系统地选择语音的方法。
corpus-introduction--section-1--语料库

• This module
– …introduces the theoretical and practical issues of using corpora in linguistic studies
CL timeteds
Thurs
Fri
25
26
27
28
29
1
2
3
4
5
8
9
10
11
12
7th April (Sun): Friday timetable
CL timetable
• 27/03 (Wed) 18:30-21:30 • 28/03 (Thu) 13:15-16:40 • 29/03 (Fri) 14:05-17:30 • 03/04 (Wed) 18:30-21:30 • 07/04 (Fri) 14:05-17:30 • 10/04 (Wed) 18:30-21:30 • 11/04 (Thu) 13:15-16:40 • 12/04 (Fri) 14:05-17:30
– think critically about the strengths and weaknesses of the corpus methodology and decide when and how to interface it with other methodologies;
– get familiar with major corpus resources and tools and to develop DIY corpora when necessary;
Lecture03 Lexical Analysis2

Example
(a|b)*abb
Transition Function: Move
Transition function (table): move(s, c) a s0 s1 s2 s3 s1 s1 s1 s1 b s0 s2 s3 s0
DFA
O(|x|),x is input string,|x| is the length of x
作业
Assignment2.doc
See you next time!
From NFA to DFA
e.g.
From NFA to DFA
e.g.
move({0, 1, 2, 4, 7}, a) = {3, 8}
Subset Construction
Algorithm:Subset Construction Input: An NFA N Output: A DFA D accepting the same language as N Method: Each state of D is a set of NFA states. The algorithm constructs a transition table Dtran for D.
From Regular Expression to NFA
Example
Construct an NFA for (a|b)*abb
a
b
a|b
Exampleቤተ መጻሕፍቲ ባይዱ
(a|b)*
(a|b)*a
Example
(a|b)*abb
From NFA to DFA
一些记号:
e.g.
Є-closure(0)={0, 1, 2, 4, 7}
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
练习
用正则表达式描述下列语言:
• 不以ab开头的所有只含有字母a和b的字符串.
A Big QUESTION
How to identify and process regular expression?
regular expression NFA DFA
Eaxmple:NFA
L: (a|b)*abb
一些记号:
e.g.
Є-closure(0)={0, 1, 2, 4, 7}
From NFA to DFA
e.g.
From NFA to DFA
e.g.
move({0, 1, 2, 4, 7}, a)Байду номын сангаас= {3, 8}
Subset Construction
Algorithm:Subset Construction Input: An NFA N Output: A DFA D accepting the same language as N Method: Each state of D is a set of NFA states. The algorithm constructs a transition table Dtran for D.
Principles of Compiler Construction
Lecture 3 Lexical Analysis (II)
Lecturer: Hai WAN
Note that most of these slides were created by:
Prof. Wen-jun LI (School of Software) Dr. Zhong-mei SHU (Department of Computer Science) Dr. Han LIN (Department of Computer Science) Course Website: /courses/compiler/ Course Community: /bbs/index.asp?boardid=28
NFA
The language defined (or accepted) by an NFA is the set of strings labeling some path from the start to an accepting state.
Transition Table
A transition function can be represented by a transition table. Eg:
Example:NFA with є
L: aa*|bb*
DFA
A deterministic finite automaton (DFA) is a special case of an NFA where:
Example
(a|b)*abb
Transition Function: Move
Transition function (table): move(s, c) a s0 s1 s2 s3 s1 s1 s1 s1 b s0 s2 s3 s0
例如,左图中字符 串bb区分状态B和C
最小化DFA的算法
最小化DFA的算法(续)
例子
最小化得
作业
week4_作业安排.pdf
See you next time!
Computing Є-closure(T)
conclusion
RegularExpression
NFA
DFA
From NFA to DFA
Disadvantage
2^n ?
NFA
Discussion
DFA? NFA?
重要结论
定理:对任何DFA D都存在一个正则表达式r ,使得L(D)=L(r). 推论:对任何NFA N都存在一个正则表达式r ,使得L(N)=L(r). 结论:DFA,NFA和正则表达式三者的描述能 力是一样的.
DFA
O(|x|),x is input string,|x| is the length of x
More…
• DFA?
• Regular Expression to NFA?
• NFA to DFA?
OK, let’s try!
From Regular Expression to NFA
From Regular Expression to NFA
Example
Example
NFA states {0, 1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7} {1, 2, 4, 5, 6, 7, 9} {1, 2, 4, 5, 6, 7, 10}
DFA state A B C D E
a B B B B B
From Regular Expression to NFA
From Regular Expression to NFA
Example
Construct an NFA for (a|b)*abb
a b
a|b
Example
(a|b)*
(a|b)*a
Example
(a|b)*abb
From NFA to DFA
比较
上图比下图少了一 个状态 问题:如何使得 DFA的状态数最 少?
DFA的最小化
Basic Idea
• String x distinguishes state s from state t if exactly one of the states reached from s and t by following the path with label x is an accepting state. • State s is distinguishable from state t if there is some string that distinguishes them.
b C D C E C
Example
NFA states {0, 1, 2, 4, 7} {1, 2, 3, 4, 6, 7, 8} {1, 2, 4, 5, 6, 7} {1, 2, 4, 5, 6, 7, 9} {1, 2, 4, 5, 6, 7, 10} DFA state A B C D E a B B B B B b C D C E C