• Keine Ergebnisse gefunden

Descriptional complexity of semi-conditional grammars

N/A
N/A
Protected

Academic year: 2022

Aktie "Descriptional complexity of semi-conditional grammars"

Copied!
6
0
0

Wird geladen.... (Jetzt Volltext ansehen)

Volltext

(1)

Descriptional Complexity of Semi-Conditional Grammars

Tom´ aˇs Masopust

Faculty of Information Technology, Brno University of Technology, Boˇzetˇechova 2, Brno 61266, Czech Republic

Alexander Meduna

Faculty of Information Technology, Brno University of Technology, Boˇzetˇechova 2, Brno 61266, Czech Republic

Abstract

The descriptional complexity of semi-conditional grammars is studied. It is proved that every recursively enumerable language is generated by a semi-conditional gram- mar of degree (2,1) with no more than seven conditional productions and eight nonterminals.

Key words: formal languages, semi-conditional grammars, descriptional complexity

1991 MSC: 68Q19

1 Introduction

Semi-conditional grammars (see [3,7,8]) are context-free grammars, in which two strings, called a permitting and a forbidding context, are attached to each production. Such a production is applicable if its permitting context occurs in the current sentential form while its forbidding context does not.

Simple semi-conditional grammars represents a straightforward simplification of semi-conditional grammars, in which each production has just one attached string—either a permitting or a forbidding context.

Email addresses: masopust@fit.vutbr.cz (Tom´aˇs Masopust), meduna@fit.vutbr.cz (Alexander Meduna).

(2)

The formal language theory has discussed the descriptional complexity of sim- ple semi-conditional grammars in detail (see [4,6,7,9]). In [7], it is proved that every recursively enumerable language is generated by a (simple) semi- conditional grammar of degree (2,1) with no more than twelve conditional productions and thirteen nonterminals. Later, in [9], this result was improved by demonstrating that every recursively enumerable language is generated by a (simple) semi-conditional grammar of degree (2,1) with no more than ten conditional productions and twelve nonterminals. Finally, this result was im- proved in [4] by demonstrating that every recursively enumerable language is generated by a (simple) semi-conditional grammar of degree (2,1) with no more than nine conditional productions and ten nonterminals.

This paper discusses the descriptional complexity of semi-conditional gram- mars because this topic has not been studied at all so far. It demonstrates stronger results about this complexity for them than the above results for simple semi-conditional grammars. Specifically, it proves that every recur- sively enumerable language is generated by a semi-conditional grammar of degree (2,1) with no more than seven conditional productions and eight non- terminals.

2 Preliminaries and Definitions

This paper assumes that the reader is familiar with the theory of formal lan- guages (see [1,5]). For an alphabetV,V represents the free monoid generated byV. The unit ofV is denoted byε. SetV+ =V− {ε}. Set sub(w) = {u:u is a substring ofw}.

In [2], it was shown that every recursively enumerable language is generated by a grammar

G= ({S, A, B, C}, T, P ∪ {ABC →ε}, S)

in theGeffert normal form, where P contains context-free productions of the form

S →uSa, where u∈ {A, AB}, a∈T,

S →uSv, where u∈ {A, AB}, v ∈ {BC, C}, S →uv, where u∈ {A, AB}, v ∈ {BC, C}.

In addition, any terminal derivation is of the form S ⇒ w1w2w

(3)

by productions from P, wherew1 ∈ {A, B}, w2 ∈ {B, C}, w∈T, and w1w2w⇒ w

byABC →ε.

A semi-conditional grammar, G, is a quadruple G= (N, T, P, S), where

• N is a nonterminal alphabet;

• T is a terminal alphabet such that N ∩T =∅;

• S ∈N is the start symbol; and

• P is a finite set of productions of the form (X →α, u, v)

with X ∈N, α∈(N∪T), and u, v ∈(N∪T)+∪ {0}, where 06∈N ∪T is a special symbol.

If u 6= 0 or v 6= 0, then the production (X → α, u, v) ∈ P is said to be conditional. G hasdegree (i, j) if for all productions (X →α, u, v)∈P,u6= 0 implies|u| ≤iand v 6= 0 implies|v| ≤j. Forx∈(N∪T)+ andy∈(N∪T), x directly derives y according to the production (X → α, u, v) ∈ P, denoted by

x⇒y

if x=x1Xx2, y =x1αx2, for some x1, x2 ∈(N ∪T), and u6= 0 implies that u ∈ sub(x) and v 6= 0 implies that v 6∈ sub(x). As usual, ⇒ is extended to

i, for i ≥ 0, ⇒+, and ⇒. The language generated by a semi-conditional grammar, G, is defined as

L(G) ={w∈T :S ⇒ w}.

A derivation of the formS ⇒ w withw ∈T is called aterminal derivation.

3 Main Result

This section presents the main result concerning the descriptional complexity of semi-conditional grammars.

Theorem 1 Every recursively enumerable language is generated by a semi- conditional grammar of degree (2,1) with no more than 7 conditional produc- tions and 8 nonterminals.

(4)

PROOF. Let L be a recursively enumerable language. There is a grammar G0 = ({S, A, B, C}, T, P ∪ {ABC → ε}, S) in the Geffert normal form such that L=L(G0). Construct the grammar

G= ({S, A, B, C,#, B0, C0,$}, T, P0∪P00, S), where

P0 ={(X →α,0,0) :X →α∈P}, and P00 contains the following seven conditional productions:

(1) (A→$#,0,$), (2) (B →B0,#, B0), (3) (C →C0$,#B0, C0), (4) (B0 →ε, B0C0,0), (5) (C0 →ε,#C0,0), (6) (#→ε,#$,0), (7) ($→ε,0,#).

To prove thatL(G0)⊆ L(G), consider a derivation S ⇒ wABCw0v ⇒ww0v in G0 by productions from P with only one application of the production ABC → ε, where w, w0 ∈ {A, B, C} and v ∈ T. Then, S ⇒ wABCw0v in G by productions fromP0. Moreover, by productions 1, 2, 3, 4, 5, 6, 7, 7, we get

wABCw0v⇒w$#BCw0v

⇒w$#B0Cw0v

⇒w$#B0C0$w0v

⇒w$#C0$w0v

⇒w$#$w0v

⇒w$$w0v

⇒w$w0v

⇒ww0v.

The inclusion follows by induction.

To prove that L(G0) ⊇ L(G), consider a terminal derivation. Let X from {A, B, C}be in a sentential form of this derivation. To eliminate X, there are the following three possibilities:

(1) IfX =A, then there must beC andB (by productions 6 and 3) in some (previous) sentential form;

(2) IfX =B, then there must beC and A(by productions 4 and 3) in some (previous) sentential form;

(3) IfX =C, then there must beA andB (by productions 5 and 3) in some (previous) sentential form.

(5)

In all above cases, there are A, B, and C in some sentential form of the derivation. By productions 1, 2, 3, and 7, there cannot be more than one

#, B0, and C0 in any sentential form. By productions 3 and 4, #B0C0 is a substring of a sentential form and there is no terminal symbol between any two nonterminals. Thus, the first part of any terminal derivation in G is of the form

S ⇒ w1ABCw2w⇒3w1$#B0C0$w2w (1) by productions from P0 and productions 1, 2, and 3, where w1 ∈ {A, B}, w2 ∈ {B, C}, and w∈T. Next, only production 4 is applicable. Thus,

w1$#B0C0$w2w⇒w1$#C0$w2w.

Besides a possible application of production 2, only production 5 is applicable.

Thus,

w1$#C0$w2w⇒+w01$#$w02w

where w10 ∈ {A, B, B0}, w02 ∈ {B, B0, C}. Besides a possible application of production 2, only production 6 is applicable. Thus,

w01$#$w20w⇒+w001$$w002w

where w100 ∈ {A, B, B0}, w002 ∈ {B, B0, C}. Finally, only production 7 is ap- plicable, i.e.,

w001$$w002w⇒2w001w200w.

Then,

w001w200w⇒uvw

by productions 1, 2, 3, or 1, 3, if production 2 has already been applied, where uvw∈ {u1$#B0C0$u2w:u1 ∈ {A, B}, u2 ∈ {B, C}}

or uv =ε. Thus, the substring ABC and only this substring was eliminated.

By induction (see (1)), the inclusion holds.

(6)

Acknowledgements

This work was supported by the Czech Grant Agency projects 201/07/0005 and 102/05/H050, FRVˇS grant FR762/2007/G1, and the Czech Ministry of Education under the Research Plan MSM 0021630528.

References

[1] J. Dassow, G. P˘aun, Regulated Rewriting in Formal Language Theory, Springer- Verlag, Berlin, 1989.

[2] V. Geffert, Context-free-like forms for the phrase-structure grammars, in:

M. Chytil, L. Janiga, V. Koubek (eds.), MFCS, vol. 324 of Lecture Notes in Computer Science, Springer, 1988.

[3] J. Kelemen, Conditional grammars: Motivations, definitions, and some properties, in: Proc. Conf. Automata, Languages and Mathematical Sciences, Salg´otarj´an, 1984.

[4] T. Masopust, An improvement of the descriptional complexity of grammars regulated by context conditions, in: Second Doctoral Workshop on Mathematical and Engineering Methods in Computer Science (MEMICS 2006), Mikulov, 2006.

[5] A. Meduna, Automata and Languages: Theory and Applications, Springer- Verlag, London, 2000.

[6] A. Meduna, M. ˇSvec, Reduction of simple semi-conditional grammars with respect to the number of conditional productions, Acta Cybernetica 15 (2002) 353–360.

[7] A. Meduna, M. ˇSvec, Grammars with Context Conditions and Their Applications, John Wiley & Sons, New York, 2005.

[8] G. P˘aun, A variant of random context grammars: Semi-conditional grammars, Theoretical Computer Science 41 (1985) 1–17.

[9] G. Vaszil, On the descriptional complexity of some rewriting mechanisms regulated by context conditions, Theoretical Computer Science 330 (2005) 361–

373.

Referenzen

ÄHNLICHE DOKUMENTE

There are many different forms of conditional sentences using if. In zero conditional sentences, all the verbs are in the present tense... • If your name's not on the guest list,

There are many different forms of conditional sentences using if. In zero conditional sentences, all the verbs are in the present tense. • If your name's not on the guest list,

There are many different forms of conditional sentences using if. In zero conditional sentences, all the verbs are in the present tense... • If your name's not on the guest list,

Very often people in computer science use the terms semi-decidable and recursively enumerable equi- valently. The following exercise shows in which way they actually

The reduction in the variance due to orthonormal variates is appreci- able, but even t h e crude estimator gives acceptable results.. After some reflection i t

limited the number of non-context-free productions by showing that the family of recursively enumerable languages is characterized by scattered context grammars with no more than

Three-nonterminal scattered context grammars: In this paper, we have shown that scattered context grammars with three nonterminals, where no more than nine nonterminals

Specifically, it proves that every recursively enumerable language is generated (A) by a generalized forbidding grammar that has no more than nine nonterminals, ten