TOPICS
Search

Formal Language


A formal language is a set of finite strings over an alphabet. The alphabet specifies the symbols from which the strings are built. The strings belonging to the language are also called words.

A formal language may be specified by formation rules that determine which strings are well-formed. Such rules can give initial expressions and specify how to build further expressions from those already constructed. In this case, only expressions obtained by applying the rules belong to the language.

For example, the language of propositional calculus could be defined as follows. The alphabet of this language is comprised of English letters with optional indexes and the following special symbols: ¬ (NOT),  ^ (AND),  v (OR), => (implies), and () (grouping). The formation rules are then that every English letter and every letter with an index is a sentential formula, and if A and B are sentential formulas, then so are ¬A, A v B, A ^ B, A=>B, and (A).

Grammars specify languages through productions. A regular language can also be specified by a regular expression.

The formation rules of propositional calculus and most other formation rules can be straightforwardly transformed into grammar productions. For example, the formation rule A ^ B becomes the production S->S ^ S, where S is the start symbol.


See also

Grammar, Kleene Star, Regular Expression

Portions of this entry contributed by Alex Sakharov (author's link)

Explore with Wolfram|Alpha

References

Aho, A. V. and Ullman J. D. Theory of Parsing, Translation and Compiling, Vol. 1. Englewood Cliffs, NJ: Prentice Hall, 1972.Aho, A. V. and Ullman J. D. Theory of Parsing, Translation and Compiling, Vol. 2. Englewood Cliffs, NJ: Prentice Hall, 1972.Kleene, S. C. Introduction to Metamathematics. Princeton, NJ: Van Nostrand, p. 39, 1964.Wolfram, S. "Computation Theory of Cellular Automata." Comm. Math. Phys. 96, 15-57, 1984.Wolfram, S. A New Kind of Science. Champaign, IL: Wolfram Media, p. 893, 2002.

Referenced on Wolfram|Alpha

Formal Language

Cite this as:

Weisstein, Eric W., with contributions by Alex Sakharov. "Formal Language." From MathWorld--A Wolfram Resource. https://mathworld.wolfram.com/FormalLanguage.html

Subject classifications