The Chomsky Hierarchy
Total Page:16
File Type:pdf, Size:1020Kb
Appendix E-I The Chomsky Hierarchy Figure E.I-l shows the inclusion relations that hold among the formal lan guages considered in this section (this is essentially the Chomsky Hierarchy). Tables E.I-l and E.I-2 are a summary of closure and decision properties for these classes of languages. 559 560 ApPENDIX E-I non-Turing-acceptable languages recursively enumerable sets = Turing-acceptable languages non-deterministic linear bounded ..._------1 automaton languagest context free languages = non-deterministic pda languages deterministic pda languages regular languages = right-linear languages = deterministic or non-deterministic finite automaton languages t The context sensItIve languages are the non-deterministic linear bound automaton languages-{e}. It is not known whether the deterministic linear bounded automaton languages are equal to the non-deterministic lba languages or are a proper subset. Figure E.I-l: Inclusion relations of the classes of formal languages THE CHOMSKY HIERARCHY 561 Operation comple- n with a regu- Class of languages U n mentation • * lar language Regular yes yes yes yes yes yes Det. pda no no yes no no yes Context free yes no no yes yes yes Context sensitive yes yes ? yes not yes Recursive yes yes yes yes yes yes Recursively yes yes no yes yes yes enumerable t The context sensitive languages do not contain e and therefore are never equal to EO Table E.I-1: Summary of closure properties of classes of formal languages Question xE L(G) L(G) = L(G!) ~ L(GJ) = L(GJ) n Class of languages L(G)? = 0? EO? L(G2 ) = 0? L(G2)? L(G2 )? Regular yes yes yes yes yes yes Det. pda yes yes yes no ? no Context free yes yes no no no no Context sensitive yes no yes t no no no Recursive yes no no no no no Recursively no no no no no no enumerable t This case is trivially decidable (the answer is always no) because the context sensitive languages do not contain e. Table E.I-2: Summary of decidability properties of classes of formal languages Appendix E-II Semantic Automata Since the earliest days of modern generative linguistics the theory of au tomata and their relation to formal grammars has been a cornerstone of syntactic linguistic theories; recently semantic applications have been devel oped by Johan van Benthem for 'quantifier automata'. In this section the main idea is outlined and illustrated, but for proofs of the advanced theorems the interested reader is referred to van Benthem (1986), chapter 8. A generalized quantifier is interpreted as a functor D EAB which assigns to each domain E a binary relation between its subsets A and B (see Chapter 14). In the procedural view of quantifiers the determiner D of the N P takes as input a list of members of A marked for their membership in B and either accepts or rejects the list. In its mathematical formulation a determiner D is presented with finite sequences of O's and 1 's, where 0 stands for members of A - Band 1 for members of An B, respectively. The output of D is either 'yes' or 'no', depending on whether or not DEAB is true for the sequence read. Examples: Every AB is recognized by the finite state machine in Fig. E.II-I. Every AB is true iff IA - BI = 0, so the Every automaton should accept all and only those sequences consisting of only 1 'so In all figures So is the initial state, and the square state always marks an accepting state, so in Fig. E.II-1 So is also the accepting state. For instance, for every man walks the l's represent men who walk and the O's men who do not walk. The automaton accepts only 1 's, i.e., whenever A ~ An B. The negated quantifier not every AB is obtained by reversing the accepting and rejecting states of the every automaton. The not every automaton accepts sequences that consist of at least one 563 564 ApPENDIX E-II 1 1 o Figure E.Il-I: Every automaton 1 Figure E.II-2: Not every automaton A that is not in B. Reversal of accepting and rejecting states in a finite state automaton for a determiner gives in general the automaton for the (externally) negated determiner. The automaton for at least one (some), the dual of every, should accept any sequence containing at least one 1, i.e., one A that is also in B. It exchanges 1 and 0 in the initial state of the every automaton and reverses its accepting and rejecting states. To complete the traditional Square of Opposition the no automaton, the negation of the at least (some) automaton, reverses its accepting and reject ing states, and accepts only sequences consisting of only O's. SEMANTIC AUTOMATA 565 o Figure E.II-3: At least one (some) automaton o 1 Figure E.II-4: No automaton Comparison to the tree of numbers There is a clear relation between the finite state automata for these de terminers and their tree of numbers representation (see Chapter 14). In a tree of numbers a node (x, y) corresponds to x O's and y l's in the input for the automaton, since x = IA - BI and y = IA n BI. The tree for every shows that only the right most pair of numbers on each line is not in the quantifier. The trees for at least one (some) and no are related in exactly the same way. Thus we see that negation of a quantifier reverses the tree pattern a.nd switches accepting and rejecting states. From a given tree the corresponding automaton can be derived by a reduction algorithm. Let us look at the example for at least one first. Nodes in the tree are first identified with states, connected by adding O's or 1 's, and accepting states are indicated by squares. This can be shown to be equivalent to the simpler automaton in Fig. E.II-3 by the reductions in Fig. E.II-6. 566 ApPENDIX E-II o 1 1 Is:l_ lL-Ql Figure E.II-5: The at least one tree of numbers turned into an automaton The procedure which turns a tree into an automaton is specified as: (i) look at the downward triangle generated by a node (x, y) (ii) turn it into a +/- pattern (iii) if it is identical to the triangle pattern of the node above and to the right, it should correspond to the same state as that one (iv) if it is identical to the node up and left, it is the same state as that one (v) the minimum number of states should be the number of distinct trian gle patterns in the tree. This procedure may not be completely general for arbitrarily complex de terminers, but it works well for the limited cases we consider here. Fig. E.II-7 is a more complicated example for exactly two AB. The square states are the accepting states again, and the bold face states represent the four states needed for the automaton, corresponding to the four different SEMANTIC AU'l'OMATA 567 triangle patterns in Fig. E.II-8. The exactly two automaton is shown in Fig. E.II-9. (1) mark all accepting states with [±] -all rejecting states with El (2) the configuration:~ o 1 + + corresponds to the acceptance for ever after-state (3) the configuration:~ o 1 -- corresponds to the rejection for ever after-state ( 4) the ,"nfigu<ation, y ~o corresponds to the acceptance with O-state (5) the configuratio", y (0:Jo corresponds to the rejection with O-state (6) the configuration, ~ ~1 corresponds to the acceptance with J-state (7) the config",atio", ~ corresponds to the rejection with J-state Figure E.II-6 568 ApPENDIX E-II 50 ,0 o 1 o o Figure E.II-7: The tree/automaton for exactly two SEMANTIC AUTOMATA 569 0,0: 0,1: 0,2: O'3:~ Figure E.II-8 ° 1 Figure E.II-9 Higher order quantifiers The determiner most is not recognized by any finite state machine; this follows from the Pumping Lemma. The language for most is context free, so it can be recognized by pushdown automaton. The idea is that the stack stores the values read, and that complementary pairs 0,1 or 1,0 of the top stack symbol and the symbol being read are erased as they occur. When the entire sequence has been read the stack should only contain 1 'so This is a slightly liberal version of a pushdown automaton accepting with a non empty stack, but it can be turned into a normal pushdown automaton with some additional encoding. 570 ApPENDIX E-II It turns out that higher order quantifiers may need context free languages, but, for instance, the higher order quantifier an even number of is recognized by a finite state machine. The following theorem characterizes the first-order definable determiners. THEOREM E.II.1 (van Benthem (1986)) All and only all first-order definable quantifiers are computable by permutation-invariant and acyclic finite state machines. _ Permutation-invariance means that any permutation in the order of 1 's and O's of an accepted or rejected list is accepted or rejected, respectively, and an automaton is acyclic when it contains no non-trivalloops between states. A proportional determiner like at least two-thirds is essentially context free. A pushdown automaton for it keeps track of two top stack positions, comparing them with the next symbol read.