The Regular Languages
摘要
This chapter studies the finite automaton model and its computational power. The finite automaton is a system for determining the membership of strings in a language. Throughout its computation, a finite automaton maintains a state. The number of states the automaton has is finite (thus the name “finite automaton”). The finite automaton reads its input character by character from its initial state. After reading each character, the finite automaton updates its state. The state it transitions to depends on the current state and the character it has read. The states are in two groups: the final states and the non-final states. When the finite automaton finishes reading its input characters, if it is in a final state, we say it accepts its input; otherwise, it stops without accepting. The regular languages are those whose membership is decidable using a finite automaton. There are two types of finite automata: deterministic and nondeterministic. The nondeterministic type may lack available actions, while the deterministic type has all its actions available. Interestingly, these two types are equivalent in computation power. The languages that finite automata accept have alternate descriptions using regular expressions, which you may have used when writing text-processing computer programs in the past. This chapter introduces the two types of finite automata and regular expressions and shows that all three have the same expressional power. Using this equivalence, we show that the class of regular languages is closed under various operations.