Production (computer science)

Production (computer science)

A production or production rule in computer science is a "rewrite rule" specifying a symbol substitution that can be recursively performed to generate new symbol sequences. A finite set of productions P is the main component in the specification of a formal grammar (specifically a generative grammar). The other components are a finite set N of nonterminal symbols, a finite set (known as an alphabet) Sigma of terminal symbols that is disjoint from N and a distinguished symbol S in N that is the start symbol.

In an unrestricted grammar, a production is of the form u o v where u and v are arbitrary strings of terminals and nonterminals however u may not be the empty string. If v is the empty string, this is denoted by the symbol epsilon, or lambda (rather than leave the right-hand side blank). So productions are of the form:

:(N cup Sigma)^+ o (N cup Sigma)^*

Where {}^{+} is the Kleene plus operator, {}^{*} is the Kleene star operator, and cup denotes set union.

The other types of formal grammar in the Chomsky hierarchy impose additional restrictions on what constitutes a production. Notably in a context-free grammar, the left-hand side of a production must be a single nonterminal symbol. So productions are of the form:

:N o (N cup Sigma)^*

Grammar generation

To generate a string in the language, one begins with a string consisting of only a single "start symbol", and then successively applies the rules (any number of times, in any order) to rewrite this string. This stops when we obtain a string containing only terminals. The language consists of all the strings that can be generated in this manner. Any particular sequence of legal choices taken during this rewriting process yields one particular string in the language. If there are multiple different ways of generating a single string, then the grammar is said to be ambiguous.

For example, assume the alphabet consists of a and b, with the start symbol S, and we have the following rules:

: 1. S ightarrow aSb: 2. S ightarrow ba

then we start with S, and can choose a rule to apply to it. If we choose rule 1, we replace S with aSb and obtain the string aSb. If we choose rule 1 again, we replace S with aSb and obtain the string aaSbb. This process is repeated until we only have symbols from the alphabet (i.e., a and b). If we now choose rule 2, we replace S with ba and obtain the string aababb, and are done. We can write this series of choices more briefly, using symbols: S Rightarrow aSb Rightarrow aaSbb Rightarrow aababb. The language of the grammar is the set of all the strings that can be generated using this process: left {ba, abab, aababb, aaababbb, ... ight }.

ee also

* Formal grammar
* Finite automata
* Generative grammar
* L-system
* Rewrite rules
* Backus–Naur form (A compact form for writing the productions of a context-free grammar.)


Wikimedia Foundation. 2010.

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

Look at other dictionaries:

  • computer science — computer scientist. the science that deals with the theory and methods of processing information in digital computers, the design of computer hardware and software, and the applications of computers. [1970 75] * * * Study of computers, their… …   Universalium

  • Kernel (computer science) — In computer science, the kernel is the central component of most computer operating systems (OS). Its responsibilities include managing the system s resources (the communication between hardware and software components). As a basic component of… …   Wikipedia

  • List of important publications in computer science — This is a list of important publications in computer science, organized by field. Some reasons why a particular publication might be regarded as important: Topic creator – A publication that created a new topic Breakthrough – A publication that… …   Wikipedia

  • Career domains in computer science — The knowledge developed by academic computer science (CS) is applied to various non academic situations to arrive at systems that help humans perform tasks that were either out of their reach for being too complex or the tasks that are repetitive …   Wikipedia

  • List of pioneers in computer science — This article presents a list of individuals who helped in the creation, development and imagining of what computers and electronics could do. Contents 1 See also 2 External links Person Achievement Ach. Date John Atanasoff Built the first… …   Wikipedia

  • On the Cruelty of Really Teaching Computer Science — “On the Cruelty of Really Teaching Computing Science” is a 1988 paper by E. W. Dijkstra[1] which argues that computer programming should be understood as a branch of mathematics, and that the formal provability of a program is a major criterion… …   Wikipedia

  • The Cruelty of Really Teaching Computer Science — “The Cruelty of Really Teaching Computing Science” is a 1988 paper by E. W. Dijkstra, which argues that computer programming should be understood as a branch of mathematics, and that the formal provability of a program is a major criterion for… …   Wikipedia

  • Production — may be:In Economics: * Production, the act of making products (goods and services) * Production, the act of manufacturing goods * Production as statistic, gross domestic productIn Entertainment: * Production, phase of filmmaking * Production,… …   Wikipedia

  • Science fiction on television — Science fiction first appeared on television during the golden age of science fiction, first in Britain (UK) and then in the United States (US). Special effects and other production techniques allow creators to present a living visual image of an …   Wikipedia

  • Computer ethics — is a branch of practical philosophy which deals with how computing professionals should make decisions regarding professional and social conduct.[1] Margaret Anne Pierce, a professor in the Department of Mathematics and Computers at Georgia… …   Wikipedia

Share the article and excerpts

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