Education, Secondary education and schools
What can be attributed to formal languages? Examples of using
What is a formal language and how does it differ from the natural one? How was it formed? What can be attributed to formal languages? And what is used to indicate it?
Characteristics of formal languages
Definition
- A simple list of words that are included in a given language - usually so speak of a finite type of construction and about those of them that have a simple structure.
- Words generated by a certain formal grammar.
- A structure created by regular expressions.
- Words generated by BNF-construction.
- Structure recognized by a finite state machine.
Let's look at an example. Suppose we have the whole alphabet given by two digits: 1 and 0. To display the letter "O" we use the combination 1010001. This is the application of the formal language. It is also possible to use an empty word (when the string has zero length and there is nothing in it) with a special designation in the form we are familiar with. But more detailed understanding of what a formal language, will help 4 examples, which will be given further. What is it for? That the reader had an understanding that it is possible to attribute to formal languages. But a little more about how they are created.
The construction of formal languages
- To begin with, choose an alphabet or some collection of certain symbols, from which the expressions used in the language will be built. The formal languages include any way of programming using a computer.
- Describes the syntax, that is, the features and rules by which meaningful sentences will be built.
- According to certain rules, words and expressions are composed. There is a rule: any sequence of letters should be able to be considered a word.
To formal languages is any design that has clear rules - this should be remembered. When constructing, there are some features. So, the concept of "symbol" is very multifunctional from the point of view of the semantic load, therefore in its mass the term "letter" is used. But under them can understand not only the usual notation for us, but also brackets, special signs and much more. This applies only to formal languages.
Example 1
Let's start with 1 and 0. In such cases, the terms "term" and "formula" are used. The first acts as an analogue of the name of the object and is used to refer to something specific. First of all, they mean constants and objective variables. Of these, in turn, more complex constructions are built, for which the function used in some language is used. A formula is understood to mean a group of terms, the use of which in a particular programming language is possible. This "instruction" will be processed, and the person will receive the necessary result.
Example 2
- A;
- А∧В ⇒ ¬А
- ¬ (А∨¬С)
As symbols A, B, C substitute the variables and you will get logical operations. Where are formal languages of this type used? Wide use of such a mechanism found in programming languages, mathematics, relationships, logical and mathematical functions or individual parts that were described by the programmer himself.
Example 3
Let's look at a more complex logical formula:
¬ (А∨¬С) ⇔ ¬А∧С = 1
That's why we need formal languages. Imagine what would happen if it was described in words? And now, based on the formula, we will deduce inferences. Meaningful expressions can be obtained in the formal language only when the pre-determined rules for the formation, change and "understanding" of the formulas and terms from which they are made are observed:
- Construction of terms and formulas;
- Study of the semantic aspect and interpretation;
- The order of some formulas and terms from others.
In each formal language, a set of these rules must be well worked out.
Example 4
Due to the presence of the output rules for terms and formulas in the syntax of the language, it is possible to perform isomorphic transformations of models. This will not only reflect (represent) a certain set of knowledge that already exists, but, perhaps, receive new information. Moreover, the transformation, although it will happen according to clear and strict rules, can be automated. Similar technologies are used in expert systems, knowledge bases and decision support software products.
Conclusion
Similar articles
Trending Now