Formal languageIn mathematics, logic and computer science, a formal language is a set of finite-length words (i.e. character strings) drawn from some finite alphabet, and the scientific theory that deals with these entities is known as formal language theory. Note that we can talk about formal language in many contexts (scientific, legal, linguistic and so on), meaning a mode of expression more careful and accurate, or more mannered than everyday speech. The sense of formal language dealt with in this article is the precise sense studied in formal language theory. A typical alphabet would be {a, b}, and a typical string over that alphabet would be
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, ε 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). 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 L1 and L2 are languages over some common alphabet.
A typical question asked about a formal language is how difficult it is to decide whether a given word belongs to the language. This is the domain of computability theory and complexity theory.
de:Formale Sprache es:Lenguaje formal fr:Langage formel nl:Formele taal ja:形式言語 pl:Język formalny zh-cn:形式语言 zh-tw:形式語言 Categories: Formal languages |
|
This article is licensed under the GNU Free Documentation License. It uses material from Wikipedia article. Browse Wikipedia for more information. |