Prefix grammar

Prefix grammar

In computer science, a prefix grammar is a type of string rewriting system, consisting of a set of string rewriting rules, and similar to a formal grammar or a semi-Thue system. What is specific about prefix grammars is not the shape of their rules, but the way in which they are applied: only prefixes are rewritten.

Formal definition

A prefix grammar "G" is a 3-tuple, (Σ, "S", "P"), where
*Σ is a finite alphabet
*"S" is a finite set of base strings over Σ
*"P" is a set of production rules of the form "u" → "v" where "u" and "v" are strings over Σ

For strings "x", "y", we write "x →G y" (and say: "G" can derive "y" from "x" in one step) if there are strings "u, v, w" such that "x = vu, y = wu", and "v → w" is in "P". Note that "→G" is a binary relation on the strings of Σ.

The "language" of "G", denoted "L(G)", is the set of strings derivable from "S" in zero or more steps: formally, the set of strings "w" such that for some "s" in "S", "s R w", where "R" is the transitive closure of "→G".

Example

The prefix grammar
*Σ = {0, 1}
*"S" = {01, 10}
*"P" = {0 → 010, 10 → 100}describes the language defined by the regular expression: 01(01)^* cup 100^*

Properties

The prefix grammars describe exactly all regular languages. [ [http://portal.acm.org/citation.cfm?id=185820 M. Frazier and C. D. Page. Prefix grammars: An alternative characterization of the regular languages. Information Processing Letters, 51(2):67–71, 1994.] ]

References

ee also

* Regular grammar
* Simple grammar


Wikimedia Foundation. 2010.

Игры ⚽ Поможем написать реферат

Look at other dictionaries:

  • prefix — In grammar, a prefix is a word or element added at the beginning of another word to adjust or qualify its meaning, such as ex (ex husband), non (non smoking), and super (supermodel) …   Modern English usage

  • grammar — I (New American Roget s College Thesaurus) Mode of speaking and writing Nouns 1. grammar; accidence, syntax, analysis, synopsis, praxis, punctuation, syllabi[fi]cation; agreement. See speech, language, writing. 2. a. part of speech; participle;… …   English dictionary for students

  • prefix — noun /ˈprifɪks / (say preefiks) 1. Grammar an affix which is put before a word, stem, or word element to add to or qualify its meaning (as un in unkind), strictly speaking an inseparable form, but usually applied to prepositions and adverbs also …  

  • prefix — n 1.Grammar. affix. 2. name, denomination, designation, title, appellation, epithet, cognomen. v 3. place before; introduce, preface, prelude, prologize …   A Note on the Style of the synonym finder

  • Regular grammar — Strictly regular grammars = In computer science, a right regular grammar (also called right linear grammar) is a formal grammar ( N , Σ, P , S ) such that all the production rules in P are of one of the following forms: # A → a where A is a non… …   Wikipedia

  • HEBREW GRAMMAR — The following entry is divided into two sections: an Introduction for the non specialist and (II) a detailed survey. [i] HEBREW GRAMMAR: AN INTRODUCTION There are four main phases in the history of the Hebrew language: the biblical or classical,… …   Encyclopedia of Judaism

  • Hungarian grammar — Hungarian language Closeup view of a Hungarian keybo …   Wikipedia

  • Modern Hebrew grammar — is the grammar of the Modern Hebrew language. It is partly analytical, expressing such forms as dative, ablative, and accusative using prepositional particles rather than morphological cases. However, inflection plays a decisive role in the… …   Wikipedia

  • Pipil grammar — This article provides a grammar sketch of the Nawat or Pipil language, an endangered language spoken by the Pipils of western El Salvador, belonging to the Nahua group within the Uto Aztecan language family. There also exists a brief typological… …   Wikipedia

  • Lithuanian grammar — is the study of rules governing the use of the Lithuanian language. Lithuanian grammar retains many archaic features from Proto Indo European that have been lost in other Indo European languages. It has extremely complex morphology; words have… …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”