• No se han encontrado resultados

4. Dimensiones del desarrollo humano

7.4 Dimensión cognitiva (7, 9 y 12)

A linear indexed grammar (LIG) (originally defined by Gazdar [Gaz88]) is similar to an IG, but restricts the number of stacks propagated to the next sentential form during a derivation to one. In every production rule righthand side, one nonterminal is appointed to carry over the stack from the nonterminal on the lefthand side.

Definition 12 (Linear Indexed Grammar) A LIG is a 5-tuple G = (N,Σ, I, P, S) in

which all parts are defined identically to an IG, except for the composite production rules in

P, where the stack inheritant on the righthand side is indicated by a marker. We use here a hat Ab on top of the nonterminal A to identify the stack inheritant. Hence, productions in a linear indexed grammar are of the following form:

Let A, B, C∈N, a∈Σ and f ∈I.

terminal productions : A→a, A→ǫ,

composite productions : A→BCb , A→BC,b

push productions : A→B[f],

pop productions : A[f]→B.

A marked (indexed) nonterminal is a Ad[δ] for some A∈ N and some δ ∈I∗. An indexed

nonterminal is, as above, aA[δ], and we writeA instead of A[] again.

A sentential form of a linear indexed grammar is a sentential form in the usual sense, i.e. a word consisting of terminal symbols and indexed nonterminals, with the additional restriction, that at most one (indexed) nonterminal is marked.

The relation⇒ on such sentential forms is the least relation that satisfies the following for all sentential forms α, β, γ, all indices δ ∈ I∗, all index symbols f ∈ I, all nonterminals

A, B, C, and all terminal symbols a. A ⇒ ǫ , Ab ⇒ ǫ ,if A→ ǫ A ⇒ a , Ab ⇒ a ,if A→a A[δ] ⇒ B[δ]C , Ad[δ] ⇒ Bd[δ]C ,if A→BCb A[δ] ⇒ BC[δ] , Ad[δ] ⇒ BCd[δ] ,if A→BCb A[δ] ⇒ B[f δ] , Ad[δ] ⇒ \B[f δ] ,if A→ B[f] A[f δ] ⇒ B[δ] , \A[f δ] ⇒ Bd[δ] ,if A[f]→B αA[δ]β ⇒ αγβ ,if A[δ]⇒γ αAd[δ]β ⇒ αγβ ,if Ad[δ]⇒γ.

The last two rules are of course only applicable if αγβ is a valid sentential form again, i.e. contains at most one marked (indexed) nonterminal.

We remark that the definition of the derivation relation deviates from the original one in [Gaz88] insofar as it uses marked nonterminals simultaneously to unmarked ones. The original definition uses no markers. The use of markers is solely for technical reasons since some theorems later on need to track the stack inheritance from nonterminal to nonterminal through a derivation and to make this explicit. Note that by this definition there is for every derivation using markers a corresponding one without and vice versa but they do not get mixed up in the sense that either the currently derived sentential form has a marker on some nonterminal during every derivation step or during none. Note that in a derivation step α ⇒ β, it is impossible for β to contain a marked nonterminal while α does not. Hence, if Sb ⇒+ w then S can derive w without markers in the derivation. If markers

are present, however, then they trace the inheritance of a stack through sentential forms. In order to understand the language derivation mechanism of LIG it suffices to take the definition without markers (which corresponds to the one in [Gaz88]).

The language of a LIG G is L(G) := {w ∈ Σ∗ | S + w}. By the above remark this

means that the markers on indexed nonterminals in sentential forms are irrelevant for the language derived by a grammar.

Example 4 Consider the language L = {anbncn | n 1}. It is generated by the linear

indexed grammar

where P is given as

S → SAC[f], SAC → AScC, SC → SCb |ScBC,

SB[f] → D, D → ScBB, SB → ǫ,

A → a, B → b, C → c.

A derivation of the word a2b2c2 is:

S ⇒ SAC[f] ⇒ ASC[f] ⇒ AS[f]C ⇒

ASAC[f f]C ⇒ AASC[f f]C ⇒ AASB[f f]CC ⇒ AAD[f]CC ⇒

AASB[f]BCC ⇒ AADBCC ⇒ AASBBBCC ⇒7 aabbcc.

Again, there is a corresponding derivation Sb ⇒ a2b2c2 but it exists solely for technical

reasons and has no implications on the language derived by G.

LIL belong to themildly context-sensitive languages (MCSL) and are equivalent to several on first glance very different grammar formalisms, namely head grammars (HG),tree ad- joining grammars (TAG) andcombinatory categorical grammars (CCG), giving rise to the language classes HL,TAL and CCL respectively [VsW94]. The following theorem shows their embedding into the Chomsky hierarchy.

Theorem 11

CFL(LIL = HL = TAL = CCL( IL(CSL.

Proof CFL are LIL with empty stacks and the strictness of the inclusion is witnessed by

e.g. the language {anbncn | n 1} which is a LIL but not a CFL [HU79]. As mentioned

before, the equivalence of the four mildly context-sensitive formalisms is proved in [VsW94]. Their inclusion in IL is given by a rather simple translation: note that the composite production rules of LIL are the only ones in which LIL differ from IL. Now, in a production rule of the formA→BCb ,Cis substituted by a fresh dummy nonterminalC′ (and of course

the marker is erased). It is clear that we can add further production rules in which the stack content of C′ is popped until it is empty and further rules which transformCback

toC but with an empty stack now. This has the effect that the only way of eliminatingC′

in a sentential form during a derivation is by emptying its stack and transforming it back into C which exactly simulates the behaviour of the original LIL rule. The same holds of course for rules of the formA→BCb. Strictness is witnessed by the language{a2i

|i≥0} which is not a LIL but an IL [Aho68, Gaz88].

Theorem 12 (Closure Properties, [VsW94]) Let L1 and L2 be LIL and R be a reg-

ular language. Then the following languages are LIL:

L1 ∪L2, L1L2, L∗1, L1 ∩R.

Theorem 13 (Emptiness, [Bou96]) The emptiness-problem for LIL is PTIME-complete.

Documento similar