Hubbry Logo
search
logo

Production (computer science)

logo
Community Hub0 Subscribers
Write something...
Be the first to start a discussion here.
Be the first to start a discussion here.
See all
Production (computer science)

In computer science, a production or production rule is a rewrite rule that replaces some symbols with other symbols. A finite set of productions is the main component in the specification of a formal grammar (specifically a generative grammar).

In such grammars, a set of productions is a special case of relation on the set of strings (where is the Kleene star operator) over a finite set of symbols called a vocabulary that defines which non-empty strings can be substituted with others. The set of productions is thus a special kind subset

and productions are then written in the form to mean that (not to be confused with being used as function notation, since there may be multiple rules for the same ). Given two subsets , productions can be restricted to satisfy , in which case productions are said "to be of the form . Different choices and constructions of lead to different types of grammars. In general, any production of the form

where is the empty string (sometimes also denoted ), is called an erasing rule, while productions that would produce strings out of nowhere, namely of the form

are never allowed.

In order to allow the production rules to create meaningful sentences, the vocabulary is partitioned into (disjoint) sets and providing two different roles:

In the most general case of an unrestricted grammar, a production , is allowed to map arbitrary strings and in (terminals and nonterminals), as long as is not empty. So unrestricted grammars have productions of the form

or if we want to disallow changing finished sentences

See all
User Avatar
No comments yet.