Head grammar

Short description: Concept in generalized context free grammar

Head grammar (HG) is a grammar formalism introduced in Carl Pollard (1984)[1] as an extension of the context-free grammar class of grammars. Head grammar is therefore a type of phrase structure grammar, as opposed to a dependency grammar. The class of head grammars is a subset of the linear context-free rewriting systems.

One typical way of defining head grammars is to replace the terminal strings of CFGs with indexed terminal strings, where the index denotes the "head" word of the string. Thus, for example, a CF rule such as A->abc might instead be A->(abc,0), where the 0th terminal, the a, is the head of the resulting terminal string. For convenience of notation, such a rule could be written as just the terminal string, with the head terminal denoted by some sort of mark, as in A->a^bc.

Two fundamental operations are then added to all rewrite rules: wrapping and concatenation.

## Contents

* 1 Operations on headed strings
* 1.1 Wrapping
* 1.2 Concatenation
* 1.3 Form of rules
* 2 Example
* 3 Formal properties
* 3.1 Equivalencies
* 4 References

## Operations on headed strings

### Wrapping

Wrapping is an operation on two headed strings defined as follows:

Let αx^β and γy^δ be terminal strings headed by x and y, respectively.

w(αx^β,γy^δ)=αxγy^δβ

### Concatenation

Concatenation is a family of operations on n > 0 headed strings, defined for n = 1, 2, 3 as follows:

Let αx^β, γy^δ, and ζz^η be terminal strings headed by x, y, and z, respectively.

c1,0(αx^β)=αx^β

c2,0(αx^β,γy^δ)=αx^βγyδ

c2,1(αx^β,γy^δ)=αxβγy^δ

c3,0(αx^β,γy^δ,ζz^η)=αx^βγyδζzη

c3,1(αx^β,γy^δ,ζz^η)=αxβγy^δζzη

c3,2(αx^β,γy^δ,ζz^η)=αxβγyδζz^η

And so on for cm,n:0≤n<m. One can sum up the pattern here simply as "concatenate some number of terminal strings m, with the head of string n designated as the head of the resulting string".

### Form of rules

Head grammar rules are defined in terms of these two operations, with rules taking either of the forms

X->w(α,β)

X->cm,n(α,β,...)

where α, β, ... are each either a terminal string or a non-terminal symbol.

## Example

Head grammars are capable of generating the language {anbncndn:n≥0}. We can define the grammar as follows:

S->c1,0(ϵ^)

S->c3,1(a^,T,d^)

T->w(S,b^c)

The derivation for "abcd" is thus:

c3,1(a^,T,d^)

c3,1(a^,w(S,b^c),d^)

c3,1(a^,w(c1,0(ϵ^),b^c),d^)

c3,1(a^,w(ϵ^,b^c),d^)

c3,1(a^,b^c,d^)

ab^cd

c3,1(a^,T,d^)

c3,1(a^,w(S,b^c),d^)

c3,1(a^,w(c3,1(a^,T,d^),b^c),d^)

c3,1(a^,w(c3,1(a^,w(S,b^c),d^),b^c),d^)

c3,1(a^,w(c3,1(a^,w(c1,0(ϵ^),b^c),d^),b^c),d^)

c3,1(a^,w(c3,1(a^,w(ϵ^,b^c),d^),b^c),d^)

c3,1(a^,w(c3,1(a^,b^c,d^),b^c),d^)

c3,1(a^,w(ab^cd,b^c),d^)

c3,1(a^,abb^ccd,d^)

aabb^ccdd

## Formal properties

### Equivalencies

Vijay-Shanker and Weir (1994)[2] demonstrate that linear indexed grammars, combinatory categorial grammar, tree-adjoining grammars, and head grammars are weakly equivalent formalisms, in that they all define the same string languages.

## References

1. ↑ Pollard, C. 1984. Generalized Phrase Structure Grammars, Head Grammars, and Natural Language. Ph.D. thesis, Stanford University, CA.
2. ↑ Vijay-Shanker, K. and Weir, David J. 1994. The Equivalence of Four Extensions of Context-Free Grammars. Mathematical Systems Theory 27(6): 511-546.

* v
* t
* e

Automata theory: formal languages and formal grammars

| Chomsky hierarchy| Grammars| Languages| Abstract machines

|
|
|

* Type-0
* —
* Type-1
* —
* —
* —
* —
* —
* Type-2
* —
* —
* Type-3
* —
* —

* Unrestricted
* (no common name)
* Context-sensitive
* Positive range concatenation
* Indexed
* —
* Linear context-free rewriting systems
* Tree-adjoining
* Context-free
* Deterministic context-free
* Visibly pushdown
* Regular
* —
* Non-recursive

* Recursively enumerable
* Decidable
* Context-sensitive
* Positive range concatenation*
* Indexed*
* —
* Linear context-free rewriting language
* Tree-adjoining
* Context-free
* Deterministic context-free
* Visibly pushdown
* Regular
* Star-free
* Finite

* Turing machine
* Decider
* Linear-bounded
* PTIME Turing Machine
* Nested stack
* Thread automaton
* restricted Tree stack automaton
* Embedded pushdown
* Nondeterministic pushdown
* Deterministic pushdown
* Visibly pushdown
* Finite
* Counter-free (with aperiodic finite monoid)
* Acyclic finite

Each category of languages, except those marked by a *, is a proper subset of the category directly above it. Any language in each category is generated by a grammar and by an automaton in the category in the same line.

0.00

(0 votes)

Original source: https://en.wikipedia.org/wiki/Head grammar. Read more

|

Retrieved from "https://handwiki.org/wiki/index.php?title=Head_grammar&oldid=283959"
*[v]: View this template
*[t]: Discuss this template
*[e]: Edit this template