formal languages

Texts

2022

We explain what formal languages ​​are, their characteristics, examples and types. Also, its differences with natural languages.

A formal language is organized by a limited set of combination rules.

What is a formal language?

In computing and information science, when we refer to a formal language as opposed to natural languages, we refer to those systems of signs endowed with primitive symbols and a formally specified system of rules of use, that is, endowed with a alphabet and of a grammar (or syntax) formal:

  • An alphabet is understood to be the finite and non-empty set of primitive symbols.
  • Formal grammar is understood to be the finite set of combination rules of said alphabet to form finite chains with a specific meaning.

In this it differs from natural languages, arisen around the human need to communicate, in which the rules are complex and ambiguous, and the meaning depends on the interpretation of the linguistic signs. For this reason, natural languages ​​are infinitely more complex than the reading of a formal language whose rules they are finite and established in advance.

Formal languages ​​are important to the world of math and of the computing, since they allow us to create codes communication between human beings and machines, that is, the programming. We should not confuse formal languages ​​with the formal level of the language or with the formal language, which is the formal, polite and formal use of verbal language, as opposed to its use colloquial, disheveled and informal.

According to the American linguist Noam Chomsky (1928-), formal languages ​​can be classified into four types:

  • Type 3: regular languages ​​endowed with regular grammars, that is, with systems of rules that can be obtained by regular expressions and that allow all possible symbol strings to be obtained.
  • Type 2: non-contextual languages ​​endowed with non-contextual grammars, that is, they allow obtaining all possible symbol strings, but at a much higher level of complexity than the regular ones.
  • Type 1: contextual languages ​​endowed with contextual grammars, that is, that allow obtaining strings of dependent symbols, as their name indicates, of the context.
  • Type 0: free languages ​​endowed with free grammars, without restrictions, which produces recursively enumerable languages.

Examples of formal languages

Examples of formal languages ​​are:

!-- GDPR -->