版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、cs490 presentation:automata & language theorythong lamran shicomponents of a formal languagensymbolnalphabetnstringngrammarcomponents of a formal languagea character, glyph, mark. an abstract entity that has no meaning by itself, often called uninterpreted. letters from various alphabets, digits
2、 and special characters are the most commonly used symbols. components of a formal languagea finite set of symbols. an alphabet is often denoted by sigma(components of a formal languagea finite sequence of symbols from an alphabet. 01110 and 111 are strings from the alphabet b above. aaabccc and b a
3、re strings from the alphabet c above. a null string is a string with no symbols, usually denoted by epsilon(components of a formal languagea way to define a language by giving a finite set of rules that describe how valid strings may be constructed.grammer(g) consists of an alphabet of terminals(for
4、mal language na set of strings from an alphabet.nthe set may be empty, finite or infinite. nl(m) is the notation for a language defined by a machine m. the machine m accepts a certain set of strings, thus a language. nl(g) is the notation for a language defined by a grammar g. the grammar g recogniz
5、es a certain set of strings, thus a language.n m(l) is the notation for a machine that accepts a language. the language l is a certain set of strings.ng(l) is the notation for a grammar that recognizes a language. the language l is a certain set of strings. formal languages (cont.)nthe union of two
6、languages is a language. l = l1 union l2 nthe intersection of two languages is a language. l = l1 intersect l2 nthe complement of a language is a language. l = sigma* - l1 nthe difference of two languages is a language. l = l1 - l2 regular languagena set of strings from an alphabet. nthe set may be
7、empty, finite or infinite. nmust be able to be represented as finite automataregular languagenuses:regular expressionsnmust be part of a regular languagenexample: 1+0*011 is a regular expression.finite automatan finite automata is also known as the finite state machinen it is a 5-tuple q, , , q0, fw
8、heren q is a finite set of states in the machinen is the input alphabetn is the transition from one state to the next staten q0 is the initial staten f is the set of all accepting states finite automata (cont.) for example: language consist of all strings have even number of 1s l=, 0, 0000, 11, 011,
9、 101, 110, 0011, 00011 evenodd1100finite automata (cont.)nfinite automaton, m:nm =q, , , q0, fnq=even, oddn=0,1n is described as 0 1 even even odd odd odd evennq0 =even nf=evenfinite automata (cont.)nthe type of finite automaton described in the preceding example is a deterministic finite automaton
10、(dfa).nan easer model to work with is the non-deterministic finite automaton (nfa)finite automata (cont.)nwhile in a dfa, every state must have exactly one transition path for each symbol in the automatons alphabet, an nfa can have as one, none, or as many transition path as it needs for each symbol
11、 in the alphabet. nan nfa can also have a transition path(s) for the empty input, .ndfa s and nfas are equivalentfinite automatanexample of nfa:abcdd0,101 0,1regular languages: finite automatanfinite automaton, n:nn=q, , , q0, fnq=a,b,c,dn=0,1n is described as: 0 1 a c b b c c d d d d d nq0 = anf=dc
12、ontext-free languagesna set of strings from an alphabet. nthe set may be empty, finite or infinite.nincludes a pumping lemma.npush down automata(pda).ncontext-free grammer(cfg).context-free languages:pushdown automatonnpushdown automaton is a 6-tuple q,s,u,p,i,f, where:nq is a finite set of statesns
13、 is input alphabetnu is stack alphabetnp is transition stateni is initial statenf is final statecontext-free languages:pushdown automatafor example, we have a string aabba input string (read in opposite to the string that we have)a b b a acuread input stringtransition occursstackcu can read or write
14、 to stackcontext-free language:pushdown automatanfor example : l = anbn | n0165423push bscan bscan apush ascan bpop apop bshow the configuration sequence on input aabbq: 1, 2, 3, 4, 5, 6 (1, , ) s: a, b (2, , b)u: b, a (3, a, b)i : 1 (2, a, ba)f: 6 (3, aa, ba)p: 1) push (b, 2) (2, aa, baa) 2) scan (
15、a, 3) (b, 4) (4, aab, baa) 3) write (a, 2) (5, aab, ba) 4) read (a ,5) (b, 6) (4, aabb, ba) 5) scan (b, 4) (5, aabb, b) 6) (6, aabb, )context-free language:context-free grammarsncontext-free grammar is a 4-tuple v, , r,s, where:nv is a finite set of variablesn is a finite set of terminals nr is a fi
16、nite set of rules, andns is the start variablecontext-free languages: context-free grammars example of cfg s turing machinesnturing machines (tm) are similar to pdas, but with memory that is unlimited and unrestricted.nthe turing machine uses an infinite tape.nthe tape head can read and write symbol
17、s on the tape. it can also move to the left or right over the tape.nturing machines have accept states and reject states, which take immediate effect.turing machinesbb x1x2xixnbbfinite controlturing machines the tm we construct will accept the language 0n1n | n1 1. it is given a finite sequence of 0
18、s and 1s on its tape, preceded and followed by an infinity of blanks. 2.the tm will change a 0 to an x and then a 1 to a y, until all 0s and 1s have been matched. 3. starting at the left end of the input, it repeatedly changes a 0 to an x and moves to the right over whatever 0s and ys it sees, until
19、 it comes to a 1. 4. it changes the 1 to a y, and moves left, over ys and 0s , until it finds an x. at that point, it looks for a 0 immediately to the right, and if it finds one, changes it to x and repeats the process, changing a matching 1 to a y. 5. if the nonblank input is not in 0*1*, then the
20、tm fail to have next move and will die without accepting. 6. if it finishes changing all the 0s to xs on the same round it changes the last 1 to a y, then it has found its input to be of the form 0n1n and accepts. the formal specification to the tm m is m= (q0 , q1 , q2 , q3 , q4 , 0,1, 0,1,x,y,b , , q0, bq4) where is state 0 1 x y b q0 (q1, x, r) - - (q3, y,r) - q1 (q1, 0
溫馨提示
- 1. 本站所有資源如無(wú)特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 安全生產(chǎn)技術(shù)服務(wù)合同范本
- 鐵路交通設(shè)施建設(shè)施工合同
- 物業(yè)保潔外包合同
- 2025園林綠化合作合同范本
- 2025年浙科版選修3地理上冊(cè)月考試卷
- 聘用合同補(bǔ)充協(xié)議
- 代加工的合同模板范本
- 簡(jiǎn)單的鋁材購(gòu)銷合同范本
- 培訓(xùn)租場(chǎng)地合同協(xié)議書范本
- 產(chǎn)品加工的簡(jiǎn)單合同范本
- 合理使用手機(jī) 做自律好少年-合理使用手機(jī)主題班會(huì)(課件)
- 湖南財(cái)政經(jīng)濟(jì)學(xué)院《運(yùn)籌學(xué)》2022-2023學(xué)年第一學(xué)期期末試卷
- 河南省信陽(yáng)市2024-2025學(xué)年高三上學(xué)期第一次質(zhì)量檢測(cè)試題 化學(xué) 含答案
- 公司企業(yè)標(biāo)準(zhǔn)模板版
- 2024中智集團(tuán)招聘重要崗位(高頻重點(diǎn)提升專題訓(xùn)練)共500題附帶答案詳解
- Unit 1 Cultural Heritage單元整體教學(xué)設(shè)計(jì) 人教版必修第二冊(cè)單元整體教學(xué)設(shè)計(jì)
- 養(yǎng)老護(hù)理員試題及答案
- 2024年山東省高中學(xué)業(yè)水平合格考生物試卷試題(含答案詳解)
- 2025年中考英語(yǔ)復(fù)習(xí)熱點(diǎn)話題作文范文
- 小學(xué)數(shù)學(xué)教學(xué)工作交流數(shù)學(xué)教學(xué)中的體會(huì)總結(jié)經(jīng)驗(yàn)交流會(huì)課件
- 2024年美國(guó)智能馬桶和馬桶蓋市場(chǎng)現(xiàn)狀及上下游分析報(bào)告
評(píng)論
0/150
提交評(píng)論