«* LIBRARY OF THE UNIVERSITY OF ILLINOIS AT URBANA-CHAMPAIGN 510.84 lifer no. £19- &26 cop. 2 ysiufi ON THE STRONG COVERING PROBLEM FOR LR(k) GRAMMARS by M. Dennis Mickunas February, 197^ UIUCDCS-R-7^-625 ON THE STRONG COVERING PROBLEM FOR LR(k) GRAMMARS by M. Dennis Mickunas Department of Computer Science University of Illinois Urbana, Illinois This work supported by the Department of Computer Science. Digitized by the Internet Archive in 2013 http://archive.org/details/onstrongcovering625mick Abstract: A formal definition of one grammar, G' "strongly covering" another grammar, G is presented. Conditions under which the ability to parse G in an LR fashion implies the ability to parse G 1 in an LR fashion are developed. Constructive proofs are presented for the following formerly open problems. Every LR(k) grammar, G is strongly covered by an LR(1) grammar. Moreover, if L(G) is strict deterministic, then G is strongly covered by an LR(0) grammar. 1. INTRODUCTION. Among all of the available methods for parsing deterministic con- text-free languages, Knuth's LR(k) method [ 7 ] is, conceptually, the most straightforward. In addition, the construction of LR(1) (or LR(0)) parsers (after, most notably, Knuth [ 7 ], DeRemer [ 2 ], and Lalonde [ 8 ]) is particularly simple when one is given an LR(1) (or LR(0)) grammar. However, the construction becomes rather complex for LR(k>l) grammars. Although it is known that any LR(k) grammar is (weakly) equivalent to an LR(1) (and sometimes an LR(0)) grammar, no direct transformation pro- cedure was known until recently. Moreover, it was not known whether such an LR(1) (or LR(0)) grammar could be made to bear any useful resemblence to the original grammar. In particular, it was not known 1 whether an arbitaary LR(k) grammar is "covered" by an LR(1) (or LR(0)) grammar (in the sense that parses in the LR(1) grammar are homomorphic to parses in the LR(k) grammar) . The transformations in question were first presented in [ 10] along with sketchy (and in one case incorrect) proofs of the covering property. 1 In texts as recent as [ 1 ] (page 709) this is listed as an open problem. 1. 2. The corrected transformations and sketchy proofs were subsequently presented in [ 12]. Those transformations are practical in nature, modifying only selected portions of a grammar to remove a local anomaly; thus their operation is exceptionally complex and difficult to prove correct. In this paper, we present some much simpler transformations for ob- taining an LR(1) (or LR(0)) grammar which covers an arbitrary LR(k) grammar. Although these transformations are of little practical use (since they effect inefficient wholesale alterations of grammars), we are able to present the first complete proofs of their correctness. Definition. A context-free grammar (CFG) is a four-tuple, G^V, Z, P, S) where a) V is a finite non-empty set of symbols ( vocabulary) ; b ) Z C V ( terminal vocabulary ) ; c) N=V-Z ( non-terminal vocabulary ) ; d) SEN ( goal symbol ) , and; e) P is a finite subset 2 of N*V ( productions ) . We will denote an element (u,v) of P as u-*v, and we will often ascribe indices to productions i tt.-u+v. We also employ the usual binary relation »>£V xy , writing u»>v instead of (u,v)e»>. * * Definition. Let u,veV . Define u«>v if there exist x,y,weV ; AeN for JL which u=xAy, v»xwy, and A+weP. If ye£ , we write us>v. Furthermore, we write the reflexive-transitive closure of ■> as »>. If we wish to make clear that the grammar G is being used, we will write fi>. 2 Let X and Y be sets of words. We write XY«{xy|xeX, yeY} where xy is the concatenation of x and y. Define X «{A} where A is the null word. For each i>0 define X^-O^X and X*»U jL>0 X i . Let X + -X*X and let $ denote the empty set, 3. Definition. Let x.eV (0*i£r) . If x j" >x j+i by applying the production it., then we say that x directly derives x^ + , via tt . . If x n »>x.»>. . ,->x where x. directly derives x. . via tt (0x i i™(J i i — U r — — — o ik i+i r-1 (0x}. The language generated by G is denoted and defined as L(G)»I*ncSF(G)* Definition. A CFG, G is said to be unambiguous if and only if every xeL(G) has only one canonical derivation. A CFG which is not unambiguous is said to be ambiguous . * * Definition. Let u£V , AeN, weE such that uAweCSF(G). Let TT-A+veP. Then uvweCSF(G) is said to have 3 handle (tt, |uv|). By convention, SeCSF(G) has handle** (A, |s|). Definition. Define the non-LR(k) relation 5 , \£P**P* as follows. ^Vr' if and only if TT,Tr'eP_ and there exist 6 ueV*, z,z'«:Z*; jel for which a) uz, uz'eCSF(G); b) uz has handle (tt, |u|); c) uz' has handle (tt 1 , j); d) (k) z -(k) z ' f and; e) (tt, |u|)*(tt', j). If TreP. and for every Tr'eP., TrU^ir', then tt is said to be LR(k) . If every TreP. is LR(k), then G is said to be LR(k) . Otherwise G is said to be non-LR(k) A 3 Let x*a 1 a2 . . . a n £V n for some n>0 (where if n-0, x»A) . The length of x is denoted and defined as |x|»n. For i>n, '^x-x^'-x. For iuAw, and ii) there exists veE for which A»>v; c) in 1-operator form if PCNx({A>Un.IN a ) , and; d) in canonical two form if P£Nx(v.JjN 2 ). 2. BASIC RESULTS. Our goal in this section is to develop grammatical transformations which can transform an arbitrary LR(k) grammar G into an LR(1) (or LR(0)) grammar G'. In addition, we wish to "essentially" preserve the semantics, or code-generating ability of G. We embrace the idea of Gray and Harrison that essential preservation of semantics means that a parse under G' induce (by means of table lookup) a parse under G. In that respect, we require the cover notion of Gray and Harrison, which relates parses of G' to parses of G. However, in order to exert additional control over the "LR-parsability" of G' and G, we need a stronger notion which relates canonical sentential forms as well as parses of G 1 and G. To this end, we present the following definition of a strong cover. Definition. Let G-(V, £, P, S) and G'-(V', £, P\ S') be CFG's. Let 4> be a surjection from Pi onto P» for which (A)»A and let a be a (monoid) homomorphism from (V) into V such that for x,x , e(V) N' ; yeE , xx 1 ,xyeCSF(G') the following are true: i) o(xx') m o(x)a(x') ; ii) a(xy)«a(x>y, and; iii) |x|»|x'| if and only if |a(x) |-|a(x') | . G' is said to strongly cover G under (fr,q if and only if a) for every xeCSF(G) with handle (tt,1)eP .xl, there exist x , eCSF(G'), A tt'eP', j'eI for which a(x')-x, ,a. Partition P'-P' U P^L)p^ as follows. Let ireP'. i) it is in P' if and only if for every uveCSF(G') which has handle (ir,|u|), a(u)veCSF(G) has handle (00 , |a(u) | ) , and; iii) p'-p'-Cp^Up^). If iv) P'-$; and for Jr,ir'eP'; tt^tt' v) ^OO^C* 1 ) only if Trtf tt' and either 1) Trrf tt', or; 2) iteP' and G is non-LR(O) , then vi) raP' is non-LR(k) only if (Tr)eP is non-LR(k+l) , and; vii) ireP^ is non-LR(k) only if G is non-LR(k) . Clearly P ' , P^, and P* are mutually disjoint. Claim 1. Let tteP'. Then for every uv£CSF(G*) which has handle (ir,|u|), there exist u'eV , aeE for which a(u)«u'a. Proof. Since G* strongly covers G, a(u)veCSF(G) has handle ((ff)»j). Thus CT(u)v (|o(u)v|-j) e! .*_ Since TreP', j-|a(u)|-l. Thus a(u)vl + l v Ha(u)|+l) eZ * or a(u)(" e z*. The claim follows immediately. Proof of Theorem 2.1. Suppose TT,T , eP! 1 U p .L» ^V^' • Case 1. tt^tt', tttktt' and $00 ■$(*') . Then by hypothesis, urf n', tteP^, and G is non-LR(O) , satisfying vii) and vacuously satisfying vi) . Cage 2. (Tr^TT* and v", and; e) Or,|u|>rf<¥\|u , |>- Since G 1 strongly covers G we have f) a(u)v, aCu^v'eCSFCG); g) a(u)v has handle (00»j)> and; h) a(u)v"-o(u , )v , has handle ((J)(tt') , j ') . By Claim 1 and the hypothesis that 7r,TT , eP.j. 1 lJPi, it follows that there exist w.w'eV ; a^,b«e£. for which: i) a(u)»wa»; ii) afu^-w'b.; iii) j-|w|, and; iv) J , -|» , l- *V d > i) (k+ l a Al>a A v.( k+ l a ADav". A A Now f)-i) along with 7. j) (♦,|v|)rf( t |v»|> establish that (JjCnOrVi.i » i^Or'). We prove j) by considering two cases. k+ l a A l Case a. iffa' . By hypothesis and the assumption that ttti it', it follows k (with the exception of Case 1) that (ir)?*(ir') » establishing j). Case b. tt-tt '. Bye), |u|i*|u'|. Thus, |a(u) |^|a(u f ) | , or, IwayJ^w'b^l . Biflce P^Op^-*, it follows that | a A | - 1 b A | whence |w|j*|w' |, establishing j) Tn. either case the desired result follows by noting that: k) for tteP^,, j a^ j -1 and (7T)n lc (S , -»-aA , )-(A'->-a)«A-*a. The hypotheses of Theorem 2.1 are satisfied (with P>$) except that A'+aeP' Dp^. As is easily seen, G is LR(0) , whereas G' is ambiguous. The following lemma will prove to be useful in particular cases for establishing hypothesis v) of Theorem 2.1. Lemma 2.2. Let v,v'eV ; tt-A+v, tt'-A'+v'eP. Then TrruTr' only if there it * exist ueV , weE for which either a) uv'«vw; b) uv'w»v; c) v'«uvw, or; d) v'w»uv. 8. Proof. By the definition of r\ there exist x.x'eV ; z,z f ,z"eE for which xvz, x'v'z'eCSFCG) and x'v'z'-xvz". Either |x|<|x'| or |x|>|x'|. Thus there exists ueV for which either i) xu=x', or; ii) x-x'u. Independently of i) and ii) , either |z'|Jz"|. Thus there exists weE for which either iii) wz'-z", or; iv) z'«wz". Combining i) and iii) we have xuv ' z ' »xvwz ' , or uv'-vw, yielding a) of the claim. Similarly, i) and iv) yield b) ; ii) and iii) yield c) , and; ii) and iv) yield d) . QED The main transformation yet to be presented requires a 1-operator form grammar. The following theorem establishes that such a grammar is obtainable. Theorem 2.3. Every A-free LR(k) CFG is strongly covered by an LR(k) CFG in 1-operator form. Proof. Let G«(V, I, P, S) be a A-free LR(k) CFG. We may assume [ 4 ] without loss of generality, that G is in canonical two form. Let G'*(V\ E, P\ S) where V'-{S}tJ E U(E*N) and define P'-P-AJ^U^UPa as follows P 1 -{S^a(a,S)|aeZ} P 2 -{(a,A)-*A|aeE, AeN, A-*a £ P} P 3 «{(a,AMa,B)|a G Z, A,B £ N; A+B e P} P 4 -{(a,A)-*.(a,B)b(b,C)|a,beZ; A,B,C £ N; A^BC e P} . Next we define a as 9. 0(S)«S a(xeZ )-x a(a(a,A)eI]N , )-A * * * and extend a to a mapping from (IN ) Z into V by requiring that for x.x'eCZN 1 )*, yd*, o(xx')-a(x)a(x') and a(xy)-a(x)y. We define as (tt)«A and |a(a(a,S)) |-| S| . Inductive Step. Suppose that the claim holds for non- terminal G' derivations of length n>l, and consider derivations of length n+1. By the inductive assumption there exist ireP', c) u v^CSFCG'AE* with handle (tt,|u |) if and only if d) 0(u )v ECSF(G) with handle (4>(7r),|a(u )|). By inspection of P 1 and by the definition of a, c) and d) hold if and only if there exist aeE, (a,A)eN', u e(V') for which u -u a(a,A) and e) a(u l )-a(u 2 )A. 10. Suppose there exist v e(V') and i^-Ca^+VjeP' for which f) u a(a,A)v ">u av v e CSF(G') has handle (ir'Ju av I). 21 22 1 ' 2 2 1 Such a tt' exists and f) holds if and only if 4»(Tr')-A-K7(av 2 )eP. Then by e) and d) , c) and f ) hold if and only if a(u 2 )Av «>a(u 2 )a(av 2 )v 1 eCSF(G) has handle (A-Kj(av 2 ) , |a(u 2 )a(av 2 ) | ) - (4>(Tr'),|a(u 2 av 2 )|). Thus, the claim holds for terminal and non-terminal G' derivations of length n+1. Proof of Theorem 2.3. Bu Lemma 2.2 and by Claim 1, the hypotheses of Theorem 2.1 are satisfied and P'-P' -♦, P^-P'. Thus, G' is an LR(k) strong cover of G. QED We are now ready to present our main transformation, which, together with that of Theorem 2.3, embodies the overall transformation from LR(k) to LR(1) (or LR(0)). Theorem 2.4. Every A-free LR(k) CFG, G" is strongly covered by an LR(k') CFG, G', where k-1 if k>l 1 if k-1 and L(G") is not strict deterministic 7 otherwise. Proof. L«t G«(V, E, P, S) be the LR(k) 1-operator form grammar obtained by Theorem 2.3 which strongly covers G". Let G'-(V* t E, P', S) where V'-VVJ^, N^NxE, and P , -P 1 Up 2 Up 3 Up 4 Up 5 Up 6 U p 7 where, P 1 -{&*-aA|aeE, AeN, S+aAeP} P 2 -{(A,aKa|a e z, AeN, Ah-AeP} P 3 -{A>A|AeN, AWVeP} P 4 -{(A,a)-*(B,a)|aeZ, A,B e N; A>B e P} P 5 -{A^B|A,BeN; A*B e P} The strict deterministic languages are precisely the prefix-free deterministic languages [ 5 ] . 11. P 6 «{(A,a)+(B,b)(C,a)|a,beE; A,B,CeN; A+BbCeP} P -{A-*(B,b)C|beZ, A,B,CeN; A+BbCeP}. Next we define a as o(AEN)-A a((A,a)eN 1 )»Aa a(x£Z )»x j( JL JL and extend a to a mapping from (V) into V by requiring that for x,x'e(V') , a(xx')-a(x)a(x'). We define <$> as <{> ( A-'xePjU P 3 U P 5 U P ? ) -A-KJ (x) 4>((A,a)-^aeP 2 )-A^A (j)((A,a)^Y A (B,a)eP 4 UP 6 )-A-HJ(Y A )B. (A)«A. By the constructions of Theorem 2.3 and Theorem 2.4, we may assume that P'SN , x((V')*-{S}). *„*. Claim 1. CSF(G')&{S}UZ(N 1 ) I \JE(N ) N. Proof. This is a simple proof by induction on the length of G' derivations and is omitted. Claim 2. There exists ireP', uv£CSF(G') with handle (ir,|u|) if and only if (j(u)veCSF(G) has handle (00*j) where '|c(u)| if TreP 1 UP 3 UP 5 UP 7 |a(u)|-l otherwise. Proof. By induction on the length of the G' derivation. J 1 Basis. There exist ael, AeN, TT-S+aAeP for which aAeCSF(G') has handle (ir,|aA|) if and only if 4>(iT)-S-*aAeP if and only if aAeCSF(G) has handle (00,|aA|) where a(aA)-aA. 12. Inductive Step. Suppose that the claim holds for non- terminal G' derivations of length n>l, and consider derivations of length n+1. By the inductive assumption, there exist ireP', a) u v eCSF(G')\Z* with handle (tt,|u |) if and only if b) a(u 1 )v 1 £CSF(G) has handle (00,j) Suppose that there exist u 2 ,v 2 £(V) , XeN', it-X-^eP' for which G f c) u 1 v 1 «U2Xv 1 ->U2V2V 1; eCSF(G') with handle (tt , | u 2 V2 1 ) . Case 1. X«A£N, 7r«A+v £P \J? Up„. Such a tt exists if and only if 2 3 5 8 (Tr)-A-KJ(v2)eP and Dv a ) and b ) » c ) holds if and only if ^(u 1 )v 1 »a(u 2 A)v -a(u 2 )Av l 2>a(u 2 )a(v 2 )v i eCSF(G) has handle (A+o(v 2 ) , |a(u 2 )a(v 2 > | ) «(OD,|a(u 2 v 2 )|) and the claim holds for derivations of length n+1. Case 2. There exist ae£, A,BeN; X«(A,a),(B,a)£N , Y.eN-., v 2 «Y^(B,a), Tr-(A,a)+Y.(B,a)£P,l}P^. Such a tt exists if and only if <}>(Tr)-A+a(Y A )BeP A 4 6 A and by a) and b) , c) holds if and only if a (u 1 ) v^a (u 2 (A, a) ) v G , , -Q(u )Aav ->0(u )a(Y )Bav eCSF(G) has handle (A-*0(Y.)B, |a(u )o(Y A )B|) -((TO,|a(u 2 v 2 )|) and the claim holds for derivations of length n+1. Case 3. There exist v -aeZ, AeN, (A,a)£N,, TT-(A,a)-*a£P . Such a tt exists if and only if <{> 00 •"A+AeP and by a) and b) , c) holds if and only if o(u 1 )v 1 »a(u 2 (A,a))v 1 -a(u 2 )Aav 1 ->a(u 2 )av eCSF(G) has handle (A*A, |a(u 2 ) | )-(<}» (tt) , |a(u 2 a) |-1) -(<*>(7r),|a(u 2 v2)|-l) 13. and the claim holds for derivations of length n+1. Claim 3. Let TreP Up Up Up , tt'eP 1 . Then irirf it'. Moreover, if L(G) is strict deterministic, then TTpi tt ' . * * Proof. Let ttti, tt * . Then there exist u,u' ,v,v'e(V) ; w,w' ,w"e£ ; AeN, XeN', tt-A-^.tt'-X+v' for which a) uAw,uvweCSF(G') ; b) u'Xw'.u'v'w'eCSFCG 1 ); c) u'v'w'-uvw"; d) (k) w» (k) w", and; e) (7r,|uv|)^(TT',|u'v'|). By Claim 1, uAweZ(N 1 )*NlJ{s} whence f) |w|-0. Case 1. TT,7r , £P 1 lJp 3 \JP5Up 7 . Then XeN and by Claim 1, u'Xw'eZ(N )*nU(s} whence |w'|«0. By inspection of P' and by Claim 1, uvw"eE(N ) N whence |w"|=0. Thus by c) , u'v'-uv. Then by e) , tt^tt * and by the definition of > 'KtO^Ctt 1 ) . But then a(u'v')«0(uv) has two distinct handles in G, whence G is ambiguous, which contradicts the hypothesis that G is LR(k) . Thus 7T|Ltt'. Case 2. ffeP.UP c UP,, ir'eP.VJP,-. By Lemma 2.2, "rrfi tt'. 1 5 7 H O Case 3. ttePUp UP , tt'eP . By inspection of P' and by Claim 1, uveZ(N, ) N, 15 7 2 1 v'eE, and u'eI(N )*. By c) u , v , w , -uvw"eZ(N 1 )*E + 02:(N 1 )*NE -$. Thus, Tr^TT'. Case 4. tt=A-*AeP 3 , 7r'-(A,a)->v'£P2VjP4UP6. Case a. |w"|-0. By Claim 1 and c) , u'v'w'eECN ) whence |w' |*0 and u'v'-u. By inspection of <}>, ^(Tr)^^') and a(u'v f )"a(u) has two distinct handles in G, whence G is ambiguous, which contradicts the hypothesis that G is LR(k) . Thus , TTfl it ' . 14. Case b. |w"|>0. By d) and F) , Trrf tt'. Let uv— >xel . By a) and f), X R xeL(G'), and by b) and c) , xw"eL(G'). Thus, irn it* only if L(G')=L(G) is not prefix-free and hence not strict deterministic. Proof of Theorem 2.4. By Claim 2: a) G' strongly covers G; b) hypothesis iv) of Theorem 2.2 is satisfied, and; c) p>p 1 Up 3 Up 5 0p 7 . By Lemma 2.2, Claim 3, and c) above, hypothesis v) of Theorem 2.1 is satisfied. By Claim 2 and Theorem 2.1 then, G is LR(k) only if a) TreP 1 UP 3 OP 5 UP 7 is LR(k") where 1 if L(G) is not strict deterministic otherwise, and; k"- b) TreP Up,Op, is LR(k') where k'«maximum(0, k-1) . 2 4 6 The desired result follows immediately. QED Lemma 2.5. Every LR(k) CFG, G for which A^L(G) is strongly covered by a A-free LR(k) CFG which is in canonical two form. Proof. See [ 4 ] and [ 11] for a proof of a slightly weaker version of this lemma (involving "complete covers"). The version stated here can be proved as easily. Theorem 2.6. Every LR(k) CFG, G for which A^L(G) is strongly covered by a A-free LR(k') CFG where k-1 if k>l k'« 1 if k-1 and L(G) is not strict deterministic otherwise. Proof. The Theorem follows immediately from Theorem 2.4 and Lemma 2.5. QED k 1 ' 15. Our final result can now be stated. Corollary 2.7. Every LR(k) CFG, G for which A^L(G) is strongly covered by a A-free LR(k') CFG where if L(G) is strict deterministic 1 otherwise. Proof. The Corollary follows by repetitive application of Theorem 2.6. QED We remark that by using the "A-isolating" techniques of [11 ] , it is quite easy to remove the requirement of Theorem 2.6 that A^L(G). The strongest result that we can state is that every LR(k) CFG, G is strongly covered by an LR(1) CFG, G' . Moreover, if A^L(G) , then G' may be made A-free, and if L(G) is strict deterministic, then G' may be made LR(0) . 3. SUMMARY. The definition of a "strong cover" provides the control needed to relate the "LR-parsability" of one grammar to that of another. Within that definition, we have presented a sequence of grammatical transformations which, when applied iteratively to an LR(k) grammar, produce an LR(1) (or, in the case of a strict deterministic language, an LR(0)) grammar which strongly covers the original. The transformations presented here are meant merely to provide a basis in theory for more practical "local- effect" transformations which accomplish the same purpose. Such "local- effect" transformations (as well as transformations from LR(1) to (1,1) bounded-right-context) have proved useful in the implementation of a parser-generating system [9,10]. It is somewhat surprising to find that even though the notion of a strong cover is substantially more restrictive than that of a (Reynolds or Gray and Harrison type) cover, transformations which produce strong 16. covers are apparently no more contrived than those whichproduce simply covers. Thus, many transformations which are known to produce cover grammars actually result in strong covers. Theorem 2.1 (in conjunction with Lemma 2.2) then, should prove to be generally useful in showing that many such transformations are capable of preserving "LR-parsability." 4. REFERENCES. [ 1] Aho, A. V., and Ullman, J. D. , The Theory of Parsing, Translation, and Compiling, Vol. 2 , Prentice-Hall, Englewood Cliffs, N.J. (1973). [ 2] DeRemer, F. L., Practical translators for LR(k) languages, Doctoral Dissertation, MIT, Cambridge, Mass. (September 1969). [ 3] Floyd, R. W. , Syntactic analysis and operator precedence, J. ACM 10 (1963), 316-333. [ 4] Gray, J. N., and Harrison, M. A., On the covering and reduction problems for context-free grammars, J. ACM 19 , 4 (October 1972), 675-698. [ 5] Harrison, M. A., and Havel, I. M., Strict deterministic grammars, J. Computer and System Science 7 , 3 (June 1973), 237-277. [ 6] Hopcroft, J. E., and Ullman, J. D., Formal Languages and Their Relation to Automata , Addison Wesley, Reading, Mass., (1969). [ 7] Knuth, D. E. , On the translation of languages from left to right, Information and Control 8 (1965), 607-639. [ 8] Lalonde, W. R., An efficient LALR parser generator, Technical Report CSRG-2, U. of Toronto (1971). [ 9] Mickunas, M. D. , User's manual for the PUCSD parser generating system, Technical Report, Purdue U. (August 1973). [10] , Techniques for compressing bounded-context acceptors, Doctoral Dissertation, Purdue U., West Lafayette, Ind. (May 1973). [11] , On the covering problem for unambibuous context-free grammars, Technical Report, UIUCDCS-R-74-624, U. of Illinois at Urbana-Champaign (February 1974), (submitted for publication). [12] , and Schneider, V. B., On the ability to cover LR(k) grammars with LR(1), SLR(l) , and (1,1) bounded-context grammars, Proceedings of the 14th annual symposium on switching and automata theory (October 1973) [13] Reynolds, J. C, and Haskell, R. , Grammatical coverings, (unpublished manuscript) . (bibliographic data SHEET 1. Report No. UIUCDCS-R-7^-625 2. 3. Recipient's Accession No. 1. Title and Subtitle ON THE STRONG COVERING PROBLEM FOR LR(k) GRAMMARS 5- Report Date February, 197^ 6. '. Author(s) M. D. Mickunas 8. Performing Organization Rept. No. I. Performing Organization Name and Address Department of Computer Science University of Illinois at Urbana- Champaign Urbana, Illinois 6l801 10. Project/Task/Work Unit No. 11. Contract/Grant No. I 2. Sponsoring Organization Name and Address Department of Computer Science University of Illinois at Urb ana- Champaign Urbana, Illinois 6l801 13. Type of Report & Period Covered i Research 14. ; 15. Supplementary Notes 16. Abstracts A formal definition of one grammar, G' "strongly covering" another grammar, G is presented. Conditions under which the ability to parse G in an LR fashion implies the ability to parse G' in an LR fashion are developed. Constructive proofs are presented for the following formerly open problems. Every LR(k) grammar, G is strongly covered by an LR(l) grammar. Moreover, if L(G) is strict deterministic, then G is strongly covered by an LR(O) grammar. 1 l 17. key Words and Document Analysis. 17a. Descriptors 1 1 covers, parsing, context-free grammars, LR(k) grammars i ! 1 j ■ 1 17b. Identit iers, Open-Ended Terms t 17c. C.OSATI Field/Group j 18. ,'u ail ability Statement RELEASE UNLIMITED 19. Security Class (This Report) UNCLASSIFIED 21- .No. of Pact's 17 | 20. Security Class (This Page UNCLASSIFIED 22. Price •• i ORM NTIS-35 ( 10-70) USCOMM-DC 40329-P7 i *ty ®?4 wtf 5 1977 wM n ■ H Hi MB 19 HI IMP— WW mnfMi S8S hbhhH SBSSHB ^S apB H 6 iin mm VHfflffl&H. VBbw ■Hi IBHW B 1B" mm