词条 | Powerset construction |
释义 |
In the theory of computation and automata theory, the powerset construction or subset construction is a standard method for converting a nondeterministic finite automaton (NFA) into a deterministic finite automaton (DFA) which recognizes the same formal language. It is important in theory because it establishes that NFAs, despite their additional flexibility, are unable to recognize any language that cannot be recognized by some DFA. It is also important in practice for converting easier-to-construct NFAs into more efficiently executable DFAs. However, if the NFA has n states, the resulting DFA may have up to 2n states, an exponentially larger number, which sometimes makes the construction impractical for large NFAs. The construction, sometimes called the Rabin–Scott powerset construction (or subset construction) to distinguish it from similar constructions for other types of automata, was first published by Michael O. Rabin and Dana Scott in 1959.[1] IntuitionTo simulate the operation of a DFA on a given input string, one needs to keep track of a single state at any time: the state that the automaton will reach after seeing a prefix of the input. In contrast, to simulate an NFA, one needs to keep track of a set of states: all of the states that the automaton could reach after seeing the same prefix of the input, according to the nondeterministic choices made by the automaton. If, after a certain prefix of the input, a set {{mvar|S}} of states can be reached, then after the next input symbol {{mvar|x}} the set of reachable states is a deterministic function of {{mvar|S}} and {{mvar|x}}. Therefore, the sets of reachable NFA states play the same role in the NFA simulation as single DFA states play in the DFA simulation, and in fact the sets of NFA states appearing in this simulation may be re-interpreted as being states of a DFA.[2] ConstructionThe powerset construction applies most directly to an NFA that does not allow state transformations without consuming input symbols (aka: "ε-moves"). Such an automaton may be defined as a 5-tuple {{math|(Q, Σ, T, q0, F)}}, in which {{mvar|Q}} is the set of states, {{math|Σ}} is the set of input symbols, {{mvar|T}} is the transition function (mapping a state and an input symbol to a set of states), {{math|q0}} is the initial state, and {{mvar|F}} is the set of accepting states. The corresponding DFA has states corresponding to subsets of {{mvar|Q}}. The initial state of the DFA is {{math|{q0}}}, the (one-element) set of initial states. The transition function of the DFA maps a state {{mvar|S}} (representing a subset of {{mvar|Q}}) and an input symbol {{mvar|x}} to the set {{math|1=T(S,x) = ∪{T(q,x) {{pipe}} q ∈ S}}}, the set of all states that can be reached by an {{mvar|x}}-transition from a state in {{mvar|S}}. A state {{mvar|S}} of the DFA is an accepting state if and only if at least one member of {{mvar|S}} is an accepting state of the NFA.[2][3] In the simplest version of the powerset construction, the set of all states of the DFA is the powerset of {{mvar|Q}}, the set of all possible subsets of {{mvar|Q}}. However, many states of the resulting DFA may be useless as they may be unreachable from the initial state. An alternative version of the construction creates only the states that are actually reachable.[4] NFA with ε-movesFor an NFA with ε-moves (also called an ε-NFA), the construction must be modified to deal with these by computing the ε-closure of states: the set of all states reachable from some given state using only ε-moves. Van Noord recognizes three possible ways of incorporating this closure computation in the powerset construction:[5]
Multiple initial statesIf NFAs are defined to allow for multiple initial states,[7] the initial state of the corresponding DFA is the set of all initial states of the NFA, or (if the NFA also has ε-moves) the set of all states reachable from initial states by ε-moves. ExampleThe NFA below has four states; state 1 is initial, and states 3 and 4 are accepting. Its alphabet consists of the two symbols 0 and 1, and it has ε-moves. The initial state of the DFA constructed from this NFA is the set of all NFA states that are reachable from state 1 by ε-moves; that is, it is the set {1,2,3}. A transition from {1,2,3} by input symbol 0 must follow either the arrow from state 1 to state 2, or the arrow from state 3 to state 4. Additionally, neither state 2 nor state 4 have outgoing ε-moves. Therefore, {{mvar|T}}({1,2,3},0) = {2,4}, and by the same reasoning the full DFA constructed from the NFA is as shown below. As can be seen in this example, there are five states reachable from the start state of the DFA; the remaining 11 sets in the powerset of the set of NFA states are not reachable. Complexity{{main article|State complexity}}Because the DFA states consist of sets of NFA states, an {{mvar|n}}-state NFA may be converted to a DFA with at most {{math|2n}} states.[2] For every {{mvar|n}}, there exist {{mvar|n}}-state NFAs such that every subset of states is reachable from the initial subset, so that the converted DFA has exactly {{math|2n}} states, giving Θ({{math|2n}}) worst-case time complexity.[8][9] A simple example requiring nearly this many states is the language of strings over the alphabet {0,1} in which there are at least {{mvar|n}} characters, the {{mvar|n}}th from last of which is 1. It can be represented by an {{math|(n + 1)}}-state NFA, but it requires {{math|2n}} DFA states, one for each {{mvar|n}}-character suffix of the input; cf. picture for {{math|n=4}}.[4] ApplicationsBrzozowski's algorithm for DFA minimization uses the powerset construction, twice. It converts the input DFA into an NFA for the reverse language, by reversing all its arrows and exchanging the roles of initial and accepting states, converts the NFA back into a DFA using the powerset construction, and then repeats its process. Its worst-case complexity is exponential, unlike some other known DFA minimization algorithms, but in many examples it performs more quickly than its worst-case complexity would suggest.[10]Safra's construction, which converts a non-deterministic Büchi automaton with {{mvar|n}} states into a deterministic Muller automaton or into a deterministic Rabin automaton with 2O({{mvar|n}} log {{mvar|n}}) states, uses the powerset construction as part of its machinery.[11]References1. ^{{cite journal |last1=Rabin |first1=M. O. |authorlink1=Michael O. Rabin |last2=Scott |first2=D. |authorlink2=Dana Scott |date=1959 |title=Finite automata and their decision problems |journal=IBM Journal of Research and Development |issn=0018-8646 |doi=10.1147/rd.32.0114 |volume=3 |issue=2 |pages=114–125}} 2. ^1 2 {{cite book |last=Sipser |first=Michael |authorlink=Michael Sipser |title=Introduction to the Theory of Computation |isbn=0-534-94728-X |contribution=Theorem 1.19|pages=55–56}} 3. ^{{cite book |last1=Hopcroft |first1=John E. |authorlink1=John Hopcroft |last2=Ullman |first2=Jeffrey D. |authorlink2=Jeffrey Ullman |date=1979 |title=Introduction to Automata Theory, Languages, and Computation |publisher=Addison-Wesley |location=Reading Massachusetts |isbn=0-201-02988-X|contribution=The equivalence of DFA's and NFA's|pages=22–23|ref=harv}} 4. ^1 2 {{cite book |last=Schneider |first=Klaus |date=2004 |title=Verification of reactive systems: formal methods and algorithms |publisher=Springer |isbn=978-3-540-00296-3 |pages=210–212 |url=https://books.google.com/books?id=Z92bL1VrD_sC&pg=PA210}} 5. ^{{cite journal |last=Van Noord |first=Gertjan |title=Treatment of epsilon moves in subset construction |journal=Computational Linguistics |volume=26 |issue=1 |year=2000 |pages=61–76 |url=http://www.mitpressjournals.org/doi/pdfplus/10.1162/089120100561638 |doi=10.1162/089120100561638|arxiv=cmp-lg/9804003 }} 6. ^{{harvtxt|Hopcroft|Ullman|1979}}, pp. 26–27. 7. ^{{cite book |title=Complexity Theory and Cryptology: An Introduction to Cryptocomplexity|series=Texts in Theoretical Computer Science|first=Jörg|last=Rothe|publisher=Springer|year=2006|isbn=9783540285205|pages=21–22|url=https://books.google.com/books?id=YnLmsHAtvYEC&pg=PA21}}. 8. ^{{cite journal| last = Lupanov| first = Oleg B.| date = 1963| title = A comparison of two types of finite sources| journal = Problemy Kibernetiki| volume = 9| pages = 321–326}} 9. ^{{cite journal | last = Moore | first = Frank R. | doi = 10.1109/T-C.1971.223108 | issue = 10 | journal = IEEE Transactions on Computers | pages = 1211–1214 | title = On the bounds for state-set size in the proofs of equivalence between deterministic, nondeterministic, and two-way finite automata | volume = C-20 | year = 1971}}. 10. ^{{cite conference | last = Brzozowski | first = J. A. | authorlink=Janusz Brzozowski (computer scientist) | contribution = Canonical regular expressions and minimal state graphs for definite events | mr = 0175719 | pages = 529–561 | publisher = Polytechnic Press of Polytechnic Inst. of Brooklyn, Brooklyn, N.Y. | title = Proc. Sympos. Math. Theory of Automata (New York, 1962) | year = 1963}} 11. ^{{cite conference | last = Safra | first = S. | authorlink = Shmuel Safra | contribution = On the complexity of ω-automata | doi = 10.1109/SFCS.1988.21948 | location = Washington, DC, USA | pages = 319–327 | publisher = IEEE Computer Society | title = Proceedings of the 29th Annual Symposium on Foundations of Computer Science (FOCS '88) | year = 1988}}. Further reading
1 : Finite automata |
随便看 |
|
开放百科全书收录14589846条英语、德语、日语等多语种百科知识,基本涵盖了大多数领域的百科知识,是一部内容自由、开放的电子版国际百科全书。