Opentopia Directory Encyclopedia Tools

Formal language

Encyclopedia : F : FO : FOR : Formal language


In mathematics, logic, and computer science, a formal language L is a set of finite-length sequences drawn from a specified finite set A. Among the more common options that are found in applications, a formal language may be viewed as being analogous to (1) a collection of words or (2) a collection of sentences. In Case 1, the set A is called the alphabet of L, whose elements are called words. In Case 2, the set A is called the lexicon or the vocabulary of L, whose elements are then called sentences. In any case, the mathematical theory that treats formal languages in general is known as formal language theory.

Although it is common to hear the term formal language used in other contexts to refer to a mode of expression that is more disciplined or more precise than everyday speech, the sense of formal language discussed in this article is restricted to its meaning in formal language theory.

An alphabet might be [\left \], and a string over that alphabet might be [ababba].

A typical language over that alphabet, containing that string, would be the set of all strings which contain the same number of symbols [a] and [b].

The empty word (that is, length-zero string) is allowed and is often denoted by [e], [\epsilon] or [\Lambda]. While the alphabet is a finite set and every string has finite length, a language may very well have infinitely many member strings (because the length of words in it may be unbounded).

A question often asked about formal languages is "how difficult is it to decide whether a given word belongs to the language?" This is the domain of computability theory and complexity theory.

Examples

Some examples of formal languages:

Specification

A formal language can be specified in a great variety of ways, such as:

Operations

Several operations can be used to produce new languages from given ones. Suppose [L_] and [L_] are languages over some common alphabet.

See also

Further reading

Automata, Languages and Programming.

Automata theory: formal languages and formal grammars
Chomsky
hierarchy
Grammars Languages Minimal
automaton
Type-0 Unrestricted Recursively enumerable Turing machine
n/a (no common name) Recursive Decider
Type-1 Context-sensitive Context-sensitive Linear-bounded
Type-2 Context-free Context-free Pushdown
Type-3 Regular Regular Finite
Each category of languages or grammars is a proper subset of the category directly above it.

 


From Wikipedia, the Free Encyclopedia. Original article here. Support Wikipedia by contributing or donating.
All text is available under the terms of the GNU Free Documentation License See Wikipedia Copyrights for details.

Search Titles
0123456789
ABCDEFGHIJ
KLMNOPQRST
UVWXYZ?

E-mail this article to:

Personal Message: