計算機科學(xué)分類自動機理論automata_第1頁
計算機科學(xué)分類自動機理論automata_第2頁
計算機科學(xué)分類自動機理論automata_第3頁
計算機科學(xué)分類自動機理論automata_第4頁
計算機科學(xué)分類自動機理論automata_第5頁
已閱讀5頁,還剩12頁未讀 繼續(xù)免費閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)

文檔簡介

1、1Discussion of Common Problems 1TypesLanguage an Automaton AcceptsSound of No Hands Clapping2TypesTypes or classes are not just important in programming; they are vital in mathematics and automata theory.Weve seen distinctions among types:Characters vs. strings.Sets vs. elements.3Strings Vs. Charact

2、ersA common and important distinction in programming languages.”a” is of type String; a is of type char.Especially important: is of type String.Oddity: in the -NFA, we see arcs labeled by strings ( in particular) and by characters (ordinary inputs like 0).4Strings Vs. Characters (2)Its not a problem

3、; characters can be coerced to strings.Example: in Java ” + 0 = ”0”.Similarly, in an -NFA, you can mentally coerce the character labels to strings of length 1.And for any kind of finite automaton, labels of paths are strings.5Example: Label of a Path010Concatenation of the labels, each treatedas a s

4、tring is 010.6Sets Vs. ElementsThese are always different types.Especially, strings are elements, while sets of strings (e.g., languages) are sets. is a string.The empty set is a set.Sets can have “members”; elements never do.7Sets Vs. Elements (2)The empty set is the only set in the world that does

5、 not have any members.Notice that strings like or 001 do not have members, but for a different reason:Elements cannot have members.8States of an NFAStates are always elements.The subset construction seems to construct DFA states that are sets of NFA states.Really, the DFA states correspond to sets o

6、f NFA states, but are elements with names like “Sally” or “q”.Convenient to use something like p, q for the name of a DFA state.9Language of an AutomatonAutomata accept strings.Labels of paths from the state state to an accepting state.They also accept languages.EXACTLY the set of strings that the a

7、utomaton accepts.Thus, many strings, but ONE language.10FallacyWe had a number of forum discussions where people took “automaton A accepts language L” to mean that all the strings of L are accepted by A.If that were the case, all languages would be “accepted” by:AStart0, 111Sound of No Hands Clappin

8、gPeople sometimes have trouble with the edge cases of general statements.Example: We know what the sum of integers is; but what if there are 0 integers?Example: we know what it means for a string to have an even number of 0s; but what if that string is empty?12Sum of Zero IntegersWe know what the su

9、m of several integers is, e.g., 4 + 7 + 3.What is the sum of no integers?The only sensible choice is the identity for the operation +; i.e., 0.13Programming ViewIf we wanted to sum integers ai for i = 0, 1, n-1, we would write, e.g.:sum = 0;for (i=0; in; i+) sum += ai;What is the result if n=0? (Ans

10、.: sum = 0).14Other Operatorsp OR q OR r? OR of zero propositions = false (the identity for OR).p AND q AND r? AND of zero propositions = true (the identity for AND).p*q*r? product of zero numbers = 1 (the identity for multiplication).”w” ”x” ”y”? concatenation of zero strings = (the identity for co

11、ncatenation).15Example: Concatenation of Zero StringsSuppose the start state is also accepting.The path from state A to A has, as label, the concatenation of zero strings.Implies that is accepted by this DFA. AStart16Is 0 Odd or Even?Even, because the remainder of 0 divided by 2 is 0.I.e., 0 = 2*0 + 0.The empty string has zero of every symbol.So has an even number of 0s an even number of 1s, and so on.17Automata Not a Lady AutomatonAnd let me add one more point not of mathematics but of diction.“Automa

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
  • 6. 下載文件中如有侵權(quán)或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論