Lably
Skip to content

Affix grammar

Grammar formalism

  • 4 min read
  • 2 chapters

Related on Lably

Through Syntax (programming languages), Context-free grammar and Compiler

The formalism was invented in 1962 by Lambert Meertens while developing a grammar for generating English sentences. Meertens also applied affix grammars to the description and composition of music, and obtained a special prize from the jury at the 1968 International Federation for Information Processing (IFIP) Congress in Edinburgh for his computer-generated string quartet, Quartet No. 1 in C major for 2 violins, viola and violoncello, based on the first non-context-free affix grammar. The string quartet was published in 1968, as Mathematical Centre Report MR 96.

The grammatical rules of an affix grammar are those of a context-free grammar, except that certain parts in the nonterminals (the affixes) are used as arguments. If the same affix occurs multiple times in a rule, its value must agree, i.e. it must be the same everywhere. In some types of affix grammar, more complex relationships between affix values are possible.

Example

We can describe an extremely simple fragment of English in the following manner:

Sentence → Subject Predicate
Subject → Noun
Predicate → Verb Object
Object → Noun
Noun → John
Noun → Mary
Noun → children
Noun → parents
Verb → like
Verb → likes
Verb → help
Verb → helps

This context-free grammar describes simple sentences such as

John likes children
Mary helps John
children help parents
parents like John

With more nouns and verbs, and more rules to introduce other parts of speech, a large range of English sentences can be described; so this is a promising approach for describing the syntax of English.

However, the given grammar also describes sentences such as

John like children
children helps parents

These sentences are wrong: in English, subject and verb have a grammatical number, which must agree.

An affix grammar can express this directly:

Sentence → Subject + number Predicate + number
Subject + number → Noun + number
Predicate + number → Verb + number Object
Object → Noun + number
Noun + singular → John
Noun + singular → Mary
Noun + plural → children
Noun + plural → parents
Verb + singular → likes
Verb + plural → like
Verb + singular → helps
Verb + plural → help

This grammar only describes correct English sentences, although it could be argued that

John likes John

is still incorrect and should instead read

John likes himself

This, too, can be incorporated using affixes, if the means of describing the relationships between different affix values are powerful enough. As remarked above, these means depend on the type of affix grammar chosen.

Sign in to keep reading

One more chapter is free with a Lably account.

More in Computing and communication