An Introduction to Formal Languages and Automata

Page 77

90

Chopter 3 Reculln

GRAMMARS LeNcuacrs ann R,rc;trl,q,R

or tt,

AA regular

gramfirar

is tine tha,t is either righl-liilear

or lcft-lirreirr.

Note that in a regular Hrirrnma,r, a,t nlost one varia[le appt)ilfs tl1 the tllsistent'lv right sicle of any productiorr. f'\rrtheilnore, thet Erlablgjlxsl

bir eitherthe rightrnostor leftmostsy"tbg]gi$Effi tion.

..| .$N$iN$Ns[liEihi.-"egramma,rGr:({s},{o,l,},S,Pr),withP1givenas S-

rtbSla

is right-linear. The granunar G2 : ({S,5r, Sz} , {o, b} , S, fz), with producticlrrs S - Stab, Sr -r Srnbl5zo '52 +

ft''

is lcfb-linear. Both Gr and G2 are regula.rgramma,rs. The stltpttntle: S+a,h9+ahab9+rtbaba is a clerivatiorr with Gr. Flom this single instance it is ea"syto conjecture that .L (G1) is thc lirrrguageclenotedby the regular exprtrssionr =. (ab)- a. In a sinilar way, we tlirn $eethat L (G2) is the regular language I' (aab (ob).)'

I

,i.lti$[$

, BI , {o,,t} , S',P) with producti''s '5-,4. A - u.Bl.)., B-Ah. is not rcgrrlrr,r.Although everyproduction is either in right-linearor leftIinear fbrrn, the gra,mmaritself is neitlrt:r right-linear nor left-linear, and


Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.