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 , and a string over that alphabet might be .
A typical language over that alphabet, containing that string, would be the set of all strings which contain the same number of symbols and .
The empty word (that is, length-zero string) is allowed and is often denoted by , or . 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.
Some examples of formal languages:
A formal language can be specified in a great variety of ways, such as:
Several operations can be used to produce new languages from given ones. Suppose and are languages over some common alphabet.
Формален език | Formální jazyk | Formale Sprache | Τυπική γλώσσα | Lenguaje formal | Langage formel | 형식 언어 | Linguaggio formale (matematica) | Formele taal | 形式言語 | Język formalny | Linguagem formal | Limbaje formale | Формальный язык | Formálny jazyk | Formaali kieli | Biçimsel dil kuramı | 形式语言
This article is licensed under the GNU Free Documentation License.
It uses material from the
"Formal language".
Home Page • arts • business • computers • games • health • hospitals • home • kids & teens • news • physicians • recreation• reference • regional • science • shopping • society • sports • world