Formal language
In 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 within this article is the precise sense studied in formal language theory.
Related Topics:
Mathematics - Logic - Computer science - Set - Character string - Alphabet
~ ~ ~ ~ ~ ~ ~ ~ ~ ~
An alphabet might be left { a , b ight }, 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).
~ ~ ~ ~ ~ ~ ~ ~ ~ ~
Some examples of formal languages:
~ ~ ~ ~ ~ ~ ~ ~ ~ ~
- the set of all words over
- the set , n is a prime number and means repeated times
- the set of syntactically correct programs in a given programming language; or
- the set of inputs upon which a certain Turing machine halts.
- Strings produced by some formal grammar (see Chomsky hierarchy);
- Strings produced by a regular expression;
- Strings accepted by some automaton, such as a Turing machine or finite state automaton;
- From a set of related YES/NO questions those ones for which the answer is YES — see decision problem.
- The concatenation consists of all strings of the form where is a string from and is a string from .
- The intersection of and consists of all strings which are contained in and also in .
- The union of and consists of all strings which are contained in or in .
- The complement of the language consists of all strings over the alphabet which are not contained in .
- The right quotient of by consists of all strings for which there exists a string in such that is in .
- The Kleene star consists of all strings which can be written in the form with strings in and . Note that this includes the empty string because is allowed.
- The reverse contains the reversed versions of all the strings in .
- The shuffle of and consists of all strings which can be written in the form where and are strings such that the concatenation is in and are strings such that is in .
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 L_{1} and L_{2} are languages over some common alphabet.
~ ~ ~ ~ ~ ~ ~ ~ ~ ~
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.
Related Topics:
Computability theory - Complexity theory
~ ~ ~ ~ ~ ~ ~ ~ ~ ~
~ Table of Content ~
| ► | Introduction |
~ What's Hot ~
~ Community ~
| ► | History Forum Come and discuss about History, Civilizations, Historical Events and Figures |
| ► | History Web-Ring A community of sites, blogs and forums dedicated to History. Do not hesitate to submit your site. |
and are licensed under the GNU Free Documentation License.
Lexicon - Privacy Policy - Spiritus-Temporis.com ©2005.
