自動機理論與正規語言
Chapter 1 - Introduction to the Theory of Computation
1.1 - Mathematical Preliminaries & Notation
-
Order of magnitude
Ex:
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
-
Equivalence
1.2 - Three Basic Concepts
Chapter 2 - Finite Automata
2.1 - Deterministic Finite Accepters(DFA)
- Definition of DFA
- :a finite set of internal states.
- :a finite set of symbols called the input alphabet.
- :the initial state.()
- :a set of final states.()
- :a total function called the transition function.()
- 冰塊的筆記
每個 state 皆須有接受所有 input alphabets 並轉換到下個 state 的路徑,且不得有 。
2.2 - Nondeterministic Finite Accepters(NFA)
- Definition of NFA
- :a finite set of internal states.
- :a finite set of symbols called the input alphabet.
- :the initial state.()
- :a set of final states.()
- :the transition function.()
- 冰塊的筆記
每個 state 不一定要有接受所有 input alphabets 並轉換到下個 state 的路徑,且可以接受 λ 作為 input alphabet。
2.3 - Equivalence of Deterministic and Nondeterministic Finite Accepters
- Convert NFA to DFA
路徑的格式變成:。
用空集合 state 表示不存在的 states:。
Chapter 3 - Regular Languages and Regular Grammars
正規語言 - 維基百科
正規語言又稱正則語言是滿足下述相互等價的一組條件的一類形式語言:
- 可以被確定有限狀態自動機辨識(DFA)
- 可以被非確定有限狀態自動機辨識(NFA)
- 可以被唯讀圖靈機辨識
- 可以用正規表示式描述(Regular Expression, RE)
- 可以用正則文法生成(Regular grammar)
- 可以用字首文法生成
3.1 - Regular Expressions
3.2 - Connections Between Regular Expressions & Regular Languages
- For every regular language there is a regular expression.
For every regular expression there is a regular language.
- If is a regular expression, then there exists some nfa that accepts . Consequently, is a regular language.
- Generalized Transition Graph(GTG)
3.3 - Regular Grammars
- Right- & Left-linear grammar
皆為 Regular grammar 的一種。
- Right-linear grammar
with all productions in form or , where and .
- Left-linear grammar
with all productions in form or , where and .
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Chapter 4 - Properties of Regular Languages
4.1 - Closure Properties of Regular Languages
Closed under union , intersection , concatenation , complementation , star-closure , reversal , homomorphism and right quotient .
4.2 - Elementary Questions about Regular Languages
- Membership question:membership algorithm.
- Standard representation
4.3 - Identifying Nonregular Languages
- Pigeonhole principle
- Pumping lemma for regular languages
Let be an infinite regular language. Then there exists some positive integer m s.t. any with can be decomposed as , with and , s.t. which is also in for all i= 0, 1, 2, … .
冰塊的筆記 - 重點:
Chapter 5 - Pushdown Automata
5.1 - Context-Free Grammar(CFG)
- Definition of CFG
with all productions in have the form , where and
- A language L is said to be context-free if and only if there is a CFG s.t. .
- Every regular grammar is context-free, so a regular language is also a context-free one.
5.2 - Parsing and Ambiguity
- Definition of simple grammar or s-grammar
if all its productions are of the form , where , , , and any pair occurs at most once in .
- 冰塊的筆記
只要存在一個 unambiguous grammar,則一 language 即為 unambiguous;但若每個可生成一 language 的 grammar 皆為 ambiguous,則此 language 為 ambiguous。
5.3 - Context-Free Grammars and Programming Languages
Chapter 6 - Simplification of Context-Free Grammars and Normal Forms
- λ-free languages
- Definition of useful / useless
A variable is useful if and only if it occurs in at least one derivation, otherwise it's useless.
- λ-production:
- unit-production:
- Chomsky Normal Form
A CFG if all productions are of the form or , where are in , and is in .
- Greibach Normal Form
A CFG if all productions are of the form , where and .
Chapter 7 - Pushdown Automata
7.1 - Nondeterministic Pushdown Automata(NPDA)
-
Definition of NPDA
- :a finite set of internal states of the control unit.
- :the input alphabet.
- :a finite set of symbols called stack alphabet.
- : → finite subsets of is the transition function.
- :the initial state of the control unit.()
- :the stack start symbol.()
- :a set of final states.()
-
Example of NPDA

7.2 - Pushdown Automata & Context-free Languages
- To show a language is context-free
→ Find an npda such that .
7.3 - Deterministic Pushdown Automata(DPDA)& Deterministic Context-free Languages
-
Definition of DPDA
Same with npda, but s.t. to the restrictions that, for every , and ,
- contains at most one element.
- If is not empty, then must be empty for every .
冰塊白話文:
1. 每個階段的 stack 字符對應任一個輸入字符皆只能有一種結果。
2. 如果階段 A 的某個 stack 字符可不經輸入字符直接跳轉到階段 B,
則跳轉到階段 B 必定不再需要、也不能有任何輸入字符作為管道。
其實就像當初 nfa 跟 dfa 的差異一樣。
-
To show a language is deterministic context-free
→ Find a dpdp such that .
Chapter 8 - Properties of Context-Free Languages
8.1 - Two Pumping Lemmas
- Pumping lemma for context-free languages
- Let be an infinite context-free language. Then there exists some positive integer m, s.t. any with can be decomposed as , with and , s.t. , for all i= 0, 1, 2, … .
冰塊的筆記:
- Pumping lemma for linear context-free languages
- Let be an infinite linear language. Then there exists some positive integer m, s.t. any with can be decomposed as , with and , s.t. , for all i= 0, 1, 2, … .
冰塊的筆記:
8.2 - Closure Properties and Decision Algorithms for Context-Free Languages
- Closed under union , concatenation , star-closure .
- Not closed under complementation and intersection but regular intersection, which is CFL and is RL.
Chapter 9 - Turing Machines
9.1 - The Standard Turing Machine
- Definition of Turing Machine
- :a finite set of internal states.
- :a finite set of input alphabet, not including .()
- :a finite set of symbols called tape alphabet.
- :the transition function.()
- :the initial state.()
- :the special symbol called the blank.()
- :a set of final states.()
9.2 - Combining Turing Machines for Complicated Tasks
未讀
9.3 - Turing's Thesis
任何在算法上可計算的問題同樣可由圖靈機計算。
Any computation that can be carried out by mechanical means can be performed by some TM.
Chapter 10 - Other Models of Turing Machines
10.1 - Minor Variations on the Turing Machine Theme
未讀
10.2 - Turing Machines with more Complex Storage
未讀
10.3 - Nondeterministic Turing Machines
10.4 - A Universal Turing Machine
- Definition
An automaton that, given as input the description of any TM and a string , can simulate the computation of on .
- Illustration

10.5 - Linear Bounded Automata
-
Definition of LBA
A nondeterministic TM , s.t. to the restriction that must contain two special symbols and , such that can contain only elements of the form , and can contain only elements of the form .
基本上跟 10.3 的 Definition of Nondeterministic Turing Machine 一樣,
但要再在 增加兩個特殊符號: 和 ,且 的 state set 只能是 格式、 的 state set 只能是 格式。
冰塊白話文:其實效果就是讓這個 TM 維持在 和 之間移動。
最後統整