计算机科学分类自动机理论automata_第1页
计算机科学分类自动机理论automata_第2页
计算机科学分类自动机理论automata_第3页
计算机科学分类自动机理论automata_第4页
计算机科学分类自动机理论automata_第5页
已阅读5页,还剩12页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

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. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论