Introduction to Theory of Computation (1)
Automata and Formal Languages
- Written
- Published
- Updated
Parts: 1 · 2
Zero: Introduction
This book focuses on three traditionally central areas of the theory of computation: automata, computability, and complexity. They are linked by the question:
What are the fundamental capabilities and limitations of computers?
COMPLEXITY THEORY
What makes some problems computationally hard and others easy?
This is the central question of complexity theory.
COMPUTABILITY THEORY
During the first half of the twentieth century, mathematicians such as Kurt Godel, Alan Turing, and Alonzo Church discovered that certain basic problems cannot be solved by computers.
AUTOMATA THEORY
Automata theory deals with the definitions and properties of mathematical models of computation.
Part One: Automata and Languages
Chapter One: Regular Languages
1.5 Finite automaton
A finite automaton is a 5-tuple , where
-
is a finite set called the states
-
is a finit set called the alphabat
-
is the transition function
-
is the start state
-
is the set of accept states
accepts
Let be a finite automaton and let be a string where each is a member of the alphabet . Then accepts if a sequence of states in exists with three conditions:
- , for
1.16 regular language
We say that recognizes language if .
A language is called a regular language if some finite automatonrecognizes it.
1.23 regular operations
Let and be languages. We defifine the regular operations union,
concatenation, and star as follows:
1.25 Theorem
The class of regular languages is closed under the union operation.
1.26 Theorem
The class of regular languages is closed under the concatenation operation.
1.37 Nondeterministic Finite Automaton
A nondeterministic finite automaton is a 5-tuple , where
-
is a finite set called the states
-
is a finit set called the alphabat
-
is the transition function
-
is the start state
-
is the set of accept states
How does an NFA compute? Suppose that we are running an NFA on an input string and come to a state with multiple ways to proceed. For example, say that we are in state in NFA and that the next input symbol is . After readingthat symbol, the machine splits into multiple copies of itself and follows all the possibilities in parallel. Each copy of the machine takes one of the possible ways to proceed and continues as before. If there are subsequent choices, the machine splits again. If the next input symbol doesn’t appear on any of the arrows exiting the state occupied by a copy of the machine, that copy of the machine dies, along with the branch of the computation associated with it. Finally, if any one of these copies of the machine is in an accept state at the end of the input, the NFA accepts the input string.
If a state with an symbol on an exiting arrow is encountered, something similar happens. Without reading any input, the machine splits into multiple copies, one following each of the exiting -labeled arrows and one staying at the current state.
Nondeterminism may be viewed as a kind of parallel computation wherein multiple independent “processes” or “threads” can be running concurrently.
Another way to think of a nondeterministic computation is as a tree of possibilities.
Let be a finite automaton and let be a string where each is a member of the alphabet . Then accepts if a sequence of states in exists with three conditions:
- , for
1.39 Theorem
Say that two machines are equivalent if they recognize the same language.
Every nondeterministic fifinite automaton has an equivalent deterministic fifinite
automaton.
1.49 Theorem
The class of regular languages is closed under the star operation.
1.3 Regular Expressions
Say that is a regular expression if is
-
for some in the alphabet
-
-
-
, where and are regular expressions
-
, where and are regular expressions
-
, where is a regular expressions
When we want to distinguish between a regular expression and the language that it describes, we write to be the language of .
NOTE:
n items 1 and 2, the regular expressions and represent the languages and , respectively.
in item 3, the regular expression represents the empty language.
Thus regular expression is some operating expression on set.
Don’t confuse the regular expressions and . The expression represents the language containing a single string—namely, the empty string—whereas represents the language that doesn’t contain any strings.
1.54 Thorem
A language is regular if and only if some regular expression describes it.
1.64 Generalized Nondeterministic Finite Automaton
A generalized nondeterministic finite automaton is a 5-tuple , where
-
is a finite set called the states
-
is the input alphabat
-
is the transition function
-
is the start state
-
is the accept state
1.4 Nonregular Language
1.70 Pumping Lemma
If is a regular language, then there is a number (thepumping length) where if is any string in of length at least , then may bedivided into three pieces, , satisfying the following conditions:
- for each
Chapter Two: Context-free Languages
2.2 Context-free Grammar (CFG)
A context-free grammar is a 4-tuple , where
-
is a finite set, called the variables
-
is a finite set, disjoint from , called the terminals
-
is a finite set of rules, with each rule being a variable and a string of variables and terminals
-
is the start variable
2.7 Ambiguous
string is derived ambiguously in context-free grammar if it has two or more different leftmost derivations. Grammar is ambiguous if it generates some string ambiguously.
2.8 Chomsky Normal Form
A context-free grammar is in Chomsky normal form if every rule is of the form
where a is any terminal and , , and are any variables—except that and may not be the start variable. In addition, we permit the rule , where is the start variable.
2.9 Theorem
Any context-free language is generated by a context-free grammar in Chomsky normal form.
2.13 Pushdown Automaton
A pushdown automaton is a 6-tuple , where , and are all finite sets, and
-
is the set of states
-
is the input alphabet
-
is the stack alphabet
-
is the transiton function
-
is the start states
-
is the set of accept states
A pushdown automaton computes as follows. It accepts input w if w can be written as , where each andsequences of states and strings exist that satisfy the following three conditions. The strings represent the sequence of stack contents that has on the accepting branch of the computation.
- .. This condition signifies that M starts out properly, in the start state and with an empty stack.
- For, we have , where and for some and . This condition states that moves properly according to the state, stack, and next input symbol.
- . This condition states that an accept state occurs at the input end.
2.20 Theorem
A language is context free if and only if some pushdown automaton recognizes it.
Every regular language is context free.
2.34 Pumping Lemma for Context-free Languages
If is a context-free language, then there is a number (the pumping length) where, if s is any string in of length at least , then may be divided into five pieces satisfying the conditions
- for each
2.39 Deterministic Pushdown Automaton
A deterministic pushdown automaton is a 6-tuple , where , and are all finite sets, and
-
is the set of states
-
is the input alphabet
-
is the stack alphabet
-
is the transiton function
-
is the start states
-
is the set of accept states
The transition function must satisfy the following condition. For every , exactly one of the values
is not
2.41 Lemma
Every DPDA has an equivalent DPDA that always reads the entire input string. A DPDA may fail to read the entire input if it tries to pop an empty stack or because it makes an endless sequence of ε-input moves.
2.42 Theorem
The class of DCFLs is closed under complementation.
2.43 Theorem
A is a DCFL if and only if is a DCFL.
we will occasionally consider endmarked inputs whereby the special endmarker symbol is appended to the input string.
2.47 Deterministic Context-free Grammar
A deterministic context-free grammar is a context-free grammar such that every valid string has a forced handle.
2.57 Theorem
An endmarked language is generated by a deterministic context-free grammar if and only if it is deterministic context free.
2.62 Grammar
An grammar is a context-free grammar such that the handle of every valid string is forced by lookahead .
Comments
No approved comments yet.
Your display name and plain-text comment become public only after owner approval. No account or email is required.