A Companion to Chomsky. Группа авторов

A Companion to Chomsky - Группа авторов


Скачать книгу
of s in order. For example, the automaton in Figure 5.2 generates someone really ran, but not someone ran really or someone ran quickly.

      To see the connection between Type 3 rewriting grammars and finite‐state automata, we associate states with nonterminal symbols, and in particular associate the start state of an automaton with the starting nonterminal of a grammar. The grammar's rewrite rules correspond to the automaton's transitions. Consider for example the transition from state A to state B emitting someone. If we think of each nonterminal upper X as characterizing all strings that can be used to move the automaton from state upper X to an accepting state, then the rewrite rule “A right-arrow someone B” says that a string can move the automaton from state A to an accepting state if it's made up of the symbol someone followed by a string that moves from state B to an accepting state. For transitions into an accepting state we include an additional rule with no nonterminal on the right hand side, such as “B right-arrow ran”.

c05f002 c05f003

      The central idea in understanding the capabilities and limitations of FSGs is what I will call a string's forward set. Adopting the automaton perspective, the forward set of a string s is the set of states that the automaton could reach from its initial state by taking some sequence of transitions that produce s. For example, if the automaton in Figure 5.2 has, from its initial state, taken some sequence of transitions that produces someone ran, then the only state that it might be in is C; so the forward set of someone ran (for this automaton) is StartSet normal upper C EndSet. Similarly, the forward set of someone really is StartSet normal upper B EndSet, the forward set of someone ran and is StartSet normal upper A comma normal upper B EndSet, and the forward set of someone and is the empty set. The automaton generates a string if and only if the forward set of the string contains an accepting state.

      Importantly, knowing the forward set of some initial part of a string (i.e. a prefix of the string, in formal terms) provides a head‐start toward calculating the forward set of the entire string. For example, suppose we are told that the forward set (using the grammar in Figure 5.2) of some particular string s is StartSet normal upper C EndSet. Then, writing plus plus for string concatenation, it is straightforward to see that the forward set of the string s plus plus sans-serif-italic r e a l l y is StartSet normal upper D EndSet, and that the forward set of s plus plus sans-serif-italic a n d is StartSet normal upper A comma normal upper B EndSet. We can be sure of this without knowing anything about s except its forward set. The forward set captures everything there is to know about how the automaton treats the prefix s; it identifies what we can think of as the category of that subexpression.

Forward set Example strings from the corresponding equivalence class
StartSet normal upper A EndSet open e
StartSet normal upper B EndSet
Скачать книгу
Librs.Net