A Companion to Chomsky. Группа авторов
answer is that while a FSG is limited to classifying strings according to their role as prefixes (i.e. according to what can come after them), a CFG is able to classify strings according to their role as infixes (i.e. according to what can come around them). The CFG in (2) does not work by specifying what can come after aa, and what can come after aaa, etc.; as we have seen, any finite device that adopts this strategy is doomed. Instead, this grammar works by specifying what can appear around certain strings, and the crucial point is that what can appear around, say, aabb, is the same as what can appear around aaabbb – so while the pattern
To see these concepts in a more familiar form, consider the CFG in (4). A few example derivations are illustrated with tree diagrams in (5). The stringset that this grammar generates also cannot be generated by any FSG: among strings of the form
1 (4) start symbol: SSNP VPNdogsNPNAchasedNPA NAbigNPN RCVchasedRCNP VVchaseVPV NPVPsleep
1 (5)
Subsets of the set
Table 5.5 Equivalence classes induced by the grammar in (4)
Inside set | Example strings from the corresponding equivalence class |
---|---|
|
dogs sleep |
dogs dogs chase sleep | |
chased dogs chase dogs | |
dogs chased dogs | |
|
dogs |
big dogs | |
dogs dogs chase | |
dogs dogs dogs chase chase | |
|
sleep |
chase dogs | |
chased dogs dogs chase | |
chased big dogs | |
|
dogs chase |
dogs chased | |
big dogs chased | |
|
dogs |
|
big |
|
|