A formal language can be entirely defined by the way a set of symbols is organized. This way, it can be defined before it has any meaning- without any reference to any meanings of its expressions and before any interpretations are given to it. Formal languages are tools in the field of mathematical logic and computer science. As such they are designed to express the logic of executable programs.
Like languages in linguistics, formal languages generally have two aspects: syntax and semantics. The syntax of a language is what the language looks like without regard to its meaning. The syntax is defined by the set of rules that govern how the symbols of a formal language can be used to construct valid expressions. The semantics is what those expressions mean. This is formalized in various ways, depending on the type of language in question.
A formal language can be identified by its well formed formulas (wffs). The set of well-formed formula of a particular formal language is determined by a fiat of its creator. Usually, the determination of what is and is not a well-formed formula is laid down by designating a) a set of symbols which are the alphabet of the language and b) a set of formation rules which determine what sequences of symbols from the alphabet are the well-formed formula of the language. Hunter, Geoffrey, Metalogic: An Introduction to the Metatheory of Standard First-Order Logic
The branch of mathematics and computer science which studies exclusively the theory of language syntax is known as formal language theory. In formal language theory, a language is nothing more than its syntax; questions of semantics are not addressed in this specialty.
Contents |
In mathematics, a formal language consists of two parts, an alphabet and rules of syntax. The alphabet is any set of symbols; the rules of syntax define what strings (concatenations of elements of the alphabet) are considered part of the formal language.
As a simple example, consider the alphabet {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, +, =} together with the following rules of syntax:
Under these rules, the string "23+4=555" is in the language, the string "=234=+" is not. This formal language expresses whole numbers, well-formed addition statements, and well-formed addition equalities, but it expresses only what they look like (their syntax), not what they mean (semantics). For instance, nowhere in these rules is it defined that 0 means the number zero, or that + means addition.
The rest of this article is devoted to the basic notions of formal language theory.
As an example of a formal language, 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 belonging to it may be unbounded).
Some more examples:
Formal language theory rarely concerns itself with particular languages (except as examples), but is mainly concerned with the study of various types of formalisms to describe languages. For instance, a language can be given as
Typical questions asked about such formalisms include:
Surprisingly often, the answer to these decision problems is "it cannot be done at all", or "it is extremely expensive" (with a precise characterization of how expensive exactly). Therefore, formal language theory is a major application area of computability theory and complexity theory.
Certain operations on languages are common. This includes the standard set operations, such as union, intersection, and complementation. Another class of operation is the elementwise application of string operations.
Examples: suppose and are languages over some common alphabet.
Such operations are used to investigate closure properties of classes of languages. A class of languages is closed under a particular operation when the operation, applied to languages in the class, always produces a language in the same class again. For instance, the context-free languages are known to be closed under union, concatenation, and intersection with regular languages, but not closed under intersection or complementation.
Some other operations frequently used in the study of formal languages are the following:
Drafts of some chapters in the "Handbook of Formal Language Theory", Vol. 1-3, G. Rozenberg and A. Salomaa (eds.), Springer Verlag, (1997):t
This article is licensed under the GNU Free Documentation License. It uses material from Wikipedia