<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>lji";'I"f:fifru*::?HX:"fl,f?ili"fi.Jff,i,-,T?,ll,J"'"'n'"</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Nlasopust</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Dept. of Information Systems, Faculty of Information Technology, Brno University of Technology</institution>
          ,
          <addr-line>BoZet6chova2, 612 66 Brno</addr-line>
          ,
          <country country="CZ">Czech Republic</country>
        </aff>
      </contrib-group>
      <fpage>213</fpage>
      <lpage>218</lpage>
      <abstract>
        <p>The descriptional complexity of semi-conditional grammars is studied. A proof that every recursively enumerable language is generformal languages, descriptional complexity, semi-conditio-</p>
      </abstract>
      <kwd-group>
        <kwd>nal grammars</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>This paper studies the descriptional complexity of semi-conditional grammars
(see [4,7-9] for more details) with respect to the number of conditional
productions and nonterminals.</p>
      <p>Semi-conditionalgrammars are modified context-freegrammars, where a
permitting and a forbidding context is associatedwith eachproduction. This means
that a production is applicable if its permitting context is contained in the
current sentential form and its forbidding context is not. As a special caseof
semiconditional grammars, we obtain simple semi-conditional grammars introduced
in [3], where one of the contextsis required to be a specialsymbol 0, i.e., either
a permitting or a forbidding context is associatedwith each production.</p>
      <p>
        Whereas the descriptional complexity of simple semi-conditionai grammars
has been studied carefully (see[5,7, B,10]), the descriptional complexity of
semiconditional grammars has not been studied at all, and all results concerning
the descriptional complexity of semi-conditional grammars are consequencesof
results concerningthe descriptional complexity of simple semi-conditional
grammars. Specifically,in [8], u proof that every recursively enumerable language is
generatedby a (simple) semi-conditional grammar of degree (
        <xref ref-type="bibr" rid="ref1 ref10 ref2 ref4">2,1</xref>
        ) with no more
than twelve conditionai productions and thirteen nonterminals was given. Later,
in Ii0], this result was improved and a proof that every recursively enumerable
Ianguage is generated by a (simple) semi-conditional grammar of d.egree(2,I)
with no more than ten conditional productions and twelve nonterminals was
given. Finally, the result from [10] was improved in [5], where a proof that
every recursively enumerablelanguageis generatedby a (simple) semi-conditional
grammar of d.egree(
        <xref ref-type="bibr" rid="ref1 ref10 ref2 ref4">2, 1</xref>
        ) with no more than nine conditional productions and
ten nonterminals was given. However, a better result can be achievedfor
semicond.itional grammars than for simple semi-conditional grammars. In this
paper, a proof that every recursively enumerablelanguageis generatedby a
semiconditional grammar of degree (
        <xref ref-type="bibr" rid="ref1 ref10 ref2 ref4">2, 1</xref>
        ) with no more than sevenconditional
productions and eight nonterminais is given.
2 Preliminaries and Definitions
This paper assumesthat the reader is familiar with the theory of formal
languages(see11,6]).For an aiphabetV, V* representsthe free monoid generated
by v. The unit offv* is d.enotedby e. set v+ :v* - {r}. set sub(u) : {u : u is
a substring of tr.r).
      </p>
      <p>In [2], it was shown that every recursively enumerablelanguageis generated
by a grammar</p>
      <p>G : ( { S ,A , B , C ) , 7 , P U { A B C - + s } , S )
in the Geffert nor.malform, where P contains context-free productions of the
form</p>
      <p>S -, uSa,
S -. uSu,
S '-+uu,
w h e r eu e { A , A B } . , a e T ,
w h e r eu € { A , A B } - , u € { B C , C } * ,
w h e r eu € { A , A B } . , , u e { B C , C } - .</p>
      <p>In addition, any terminal derivation is of the form
by productionsfrom P, where wt e {A, B}-, u2 € {B,C}.,, w e ?*, and
,S=+* w1u2w</p>
      <p>W1U2W 1" 111</p>
      <p>G : (l/, T, P, S),
by ABC -- e.</p>
      <p>A semi,-condi,tiognraal mmar,G,is a quadruple
where
- ,Afis a nonterminal alphabet,
- ? is a terntinal alphabet such that I/ )T :0,
- S e l/ is the start sYmbol, and
- P is a fi.niteset of productions of tlr.eform</p>
      <p>( X * a , u , u )
w i t h X € l / , a € ( l / U ? ) - , a n d u , t ) e ( l / u T ) *
a specialsymbol.
u { 0 } , r v h e r e0 / I / u T i s
A Note on the Descriptional Complexityof Semi-ConditionalGrammars
It u l0 or u f 0, then the production (X - a,u,u) € P is saidto be condi,t'ional.
G has degree(i, j) if for ali productions(X , etu,u) € P,u* 0 impliesl"l &lt;i
and u l 0 implies lul &lt; j. For n € (.4/UZ)+ and y € (liU?)., r directly deriues
y accordingto the production (X * a,u,u) € P, denotedby</p>
      <p>n + a
i f .r : r 1 X r 2 , U : r y a r , 2 , f o r s o m ef r r t r z € ( l f U T ) * , a n d u ,l 0 i m p l i e st h a t
u e sub(r) and u + 0 implies that u / sub(r). As usual, =+ is extendedto =)',
for i ) 0, 9*, and +*. The languagegeneratedby a semi-conditionalgrammar,
G, is defined as
g ( G ) :</p>
      <p>{ w e T " : S = + *u } .</p>
      <p>Let G: (l/,7,P,.9) be a semi-conditionaglrammar. If (X &gt; e..tt",u)€ P
implies that 0 e {u,u}, then G is said to be a si,mpLseemi,-condi,ti,ongarlo,n'Lmar.</p>
    </sec>
    <sec id="sec-2">
      <title>Main Result</title>
      <p>This section presentsthe main result concerningthe descriptionai complexity of
semi-conditic.rnaglrammars.</p>
      <p>
        Theorem 1. Euery recursiuelAenumerable language i,s generated by a
semiconditional grammar of degree(
        <xref ref-type="bibr" rid="ref1 ref10 ref2 ref4">2, 1</xref>
        ) w'ithno more than 7 condit'ionalproduct,ions
and B nonterminals.
      </p>
      <p>Proof i,dea.</p>
      <p>The main idea of the proof is to simulate a terminal derivation of a grammar,
G, in the Geffert normal form.</p>
      <p>To do this, we first appiy all context-free productions as applied in the G's
derivation, and then we simulate the production ABC --+ E so that we mark
with ' only one occurrenceof A, one of B, and one of C and check that these
marked symbols form a substring A'B'C' of the current sentential form. If so,
the marked symbols can be removed, which completes the simulation of the
production ABC --+e in G; otherwise, the derivation must be blocked.</p>
      <p>The formal proof follows.</p>
      <p>Proof. Let L be a recursively enumerablelanguage.There is a grammar</p>
      <p>G : ( { S , A , B , C } , T , P U { A B C - + s i , ^ 9 )
in thc Geffcrt normal form such that L: 9(G). Construct the grammar
where
and P" contains foiiowing sevenconditional productions:</p>
      <p>G' : ({^9A,, B, C,A' , B' , C', $},7, P' U P" ,,S),</p>
      <p>P ' : { ( X * a , 0 , 0 ) : X - - - a e P } ,
1 . ( A * $ , 4 ' , 0$, ) ,
2 . ( B - B ' , A ' , B ' ) ,
3 . ( C - C ' $ ,A ' B ' , C ' ) ,
4 . ( B ' - e ,B ' C ' , 0 ) , ,
5 . ( C ' - e ,A ' C ', 0 ) ,
6 . ( A ' - e , A ' $ , 0 ) ,
7. ( $ - e , 0 ,A ' ) .</p>
      <p>To prove thar I (G) e g(G'), considera derivation</p>
      <p>,S=+* wABCw'y ) 111111ty
in G by productions from P with only one application of the production ABC
-e, w h e r ew , w ' e { A , B , C } * a n d u € .T * . T h e n ,</p>
      <p>S + * w A B C w ' u
in G' by productions from P'. iVloreovert,ry productions r, 2, z, 4, b, 6, 7, 7, we
bC-'p"r.</p>
      <p>uABCw'u + w$A'BCw'u
+ w$A'B'Cw'u
+ w$A'B'C'$w'u
+ w$A'C'$w'u
+ w$A'$w'u
=+tl$$tr'u
+ w $ w ' u
+ lt;lt)'U.</p>
    </sec>
    <sec id="sec-3">
      <title>The inclusion follows by induction.</title>
      <p>To prove that 9(G) )_ -?(G'), consider a terminal derivation. Let X €
{A,B,C} be in a sententialform of this d.erivation.To eliminate X, there are
followirig three possibilities:
1. If X - A, then there must be C and A (bV productions 6 and 3) in the
derivation;
2. If X - B, then there must be C and A (by productions 4 and 3) in the
derivation;
3. If X - C, then there must be A and B (bV productions 5 and 3) in the
derivation.</p>
      <p>
        In all aboveca^sest h,ere areA, B, and C in the derivation. By productions 1,2,
3, and 7, there cannot be more than oneA', B', and C, in any sentential form of
this terminal derivation. Nloreover,by productions 3 and ,1,A' B'C' is a substring
of a sentential form of tltis terminal derivation, and.there is no terminal syrnbol
between any fwo nonterminals; otherrvise,there will be a situation in which (zrt
A Noteon theDescriptionaClomplexitoyf Semi-ConditionaGlrammars
Ieast) one of productions 3 and 4 will not be applicable. Thus, any first part of
a terminal derivation in G' is of the fornr
,S+* ulABCw2w +3 wt$A'B'C'$w2w
(
        <xref ref-type="bibr" rid="ref1 ref10 ref4">1</xref>
        )
by productions from P' and productions 1, 2, and 3, where u.,1€ {A, B}*,
wz e {B,C}*, and w e T*. Next, only production 4 is applicable.Thus,
      </p>
      <p>I wt,g.AC' '$wzw .</p>
      <p>Besidesa possible application of production 2, oniy production 5 is applicable.
Thus,
where tr', € {A,B,B'}*,.L € {8, B',,C}*. Besidesa possibleapplicationof
production 2, only production 6 is applicable.Thus,
w h e r ew ' i e { A , B , B ' } " , w U
cable.i.e..</p>
      <p>€ { B , B ' , C } * . F i n a l l y ,o n l y p r o d u c t i o n7 i s a p p l i
Thus, by productions I, 2, 3, or 1, 3, if production 2 has already been applied,
we get
++ r\9A'$w'rw
++ u'1$$w'Jw
+2 w'lw'/w .</p>
      <p>*" "tt'utD.</p>
      <p>Here'</p>
      <p>uutu €. {ur'A' B' c'$u2w : u1 e. {A, B}* , uz € {B , c}- }
o r u u : € .</p>
      <p>
        Thus, the substring ABC and only this substring was eliminated during the
previous derivation. By induction (see(
        <xref ref-type="bibr" rid="ref1 ref10 ref4">1</xref>
        )), the inclusion hoids. This derivation
can be performed in G with an application of the production ABC ---+€, too. D
Thzswork has beensupportedby the Grant Agency of the CzechRepubli,cwithin
the project I'{o. 102/05/H050, FRVS grant I{o. FR762/2007/G1, and the Czech
Mtni,stry of Education under the ResearchPIan No. MSM 0021630528.
      </p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <given-names>J.</given-names>
            <surname>Dassow</surname>
          </string-name>
          and Gh.
          <source>PXun. Regulated Rewriti,ng i,n Formal Language Theory</source>
          . Springer-Verlag,Berlin,
          <year>1989</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <given-names>V.</given-names>
            <surname>Geffert</surname>
          </string-name>
          .
          <article-title>Context-free-like fornrs for the phrase-stnrcture grammars. Tn X,I</article-title>
          .Chytil,
          <string-name>
            <given-names>L.</given-names>
            <surname>Janiga</surname>
          </string-name>
          , and V. Koubek, editors,
          <source>MFCS</source>
          , volume
          <volume>324</volume>
          <source>of Lecture Notes i,n Computer Sc'ience</source>
          ,pages
          <fpage>309</fpage>
          -
          <lpage>317</lpage>
          . Springer,
          <year>1988</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          ,
          <string-name>
            <given-names>f. A.</given-names>
            <surname>Gopalaratnam</surname>
          </string-name>
          and
          <string-name>
            <given-names>A.</given-names>
            <surname>Meduna</surname>
          </string-name>
          .
          <article-title>On semi-conditional grammars with productions having either forbidding or permitting conditions</article-title>
          . .
          <source>4cfa Cybernetica</source>
          ,
          <article-title>LL(4</article-title>
          ):
          <fpage>307</fpage>
          -
          <lpage>324</lpage>
          ,
          <year>1994</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          ,1
          <string-name>
            <given-names>J.</given-names>
            <surname>Kelemen</surname>
          </string-name>
          .
          <article-title>Conditional grammars: Motivations, definitions, and some properties</article-title>
          .
          <source>In Proc. Conf. Automata, Languages and Mathemati,cal Sciences</source>
          ,pages
          <fpage>110</fpage>
          -
          <lpage>123</lpage>
          ,
          <issue>Salg6tarjein</issue>
          ,
          <year>1984</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          <string-name>
            <surname>o . T. IVlasopust.</surname>
          </string-name>
          <article-title>An improvement of the descriptional complexity of grammars regulated by context conditions</article-title>
          . In Second Doctoral Workshop on Mathematical and Engineering Method,sin
          <source>Computer Sc'ience(MEMICS</source>
          <year>2006</year>
          ), pages
          <fpage>105</fpage>
          -
          <lpage>1i2</lpage>
          , NIikulov,
          <year>2006</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6 .
          <string-name>
            <surname>A. N</surname>
          </string-name>
          <article-title>{eduna</article-title>
          .
          <source>Automata and Languages: Theory and Applicat'ions</source>
          . Springer-Verlag, London,
          <year>2000</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <given-names>A.</given-names>
            <surname>Nleduna</surname>
          </string-name>
          and
          <string-name>
            <given-names>M.</given-names>
            <surname>Svec</surname>
          </string-name>
          .
          <article-title>Reduction of simple semi-conditional grammars with respect to the number of conditional productions</article-title>
          .
          <source>Act,a Cybent</source>
          ,
          <source>et'ica1</source>
          ,
          <volume>5</volume>
          :
          <fpage>353</fpage>
          -
          <lpage>360</lpage>
          ,
          <year>2002</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8 . A. l\,leduna and
          <string-name>
            <given-names>M.</given-names>
            <surname>Svec</surname>
          </string-name>
          . Gramrnars wi,
          <source>th Contert Conditions and Thei</source>
          ,r Appli,cations. John Wiley &amp; Sons, New York,
          <year>2005</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9 .
          <string-name>
            <surname>Gh</surname>
          </string-name>
          . Piun.
          <article-title>A variant of random context grammars: Semi-conditional grammars</article-title>
          .
          <source>Theoret'icalComputer Sc'ience</source>
          ,
          <volume>47</volume>
          :
          <fpage>7</fpage>
          -
          <lpage>17</lpage>
          ,
          <year>1985</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          1 0
          <string-name>
            <given-names>.</given-names>
            <surname>Gy</surname>
          </string-name>
          . Vaszil.
          <article-title>On the descriptional complexity of some rewriting mechanisms regulated by context conditions</article-title>
          .
          <source>Theoret'icalComputer Sci,ence</source>
          ,
          <volume>330</volume>
          :
          <fpage>361</fpage>
          -
          <lpage>373</lpage>
          ,
          <year>2005</year>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>