📜 ⬆️ ⬇️

Organization of data in the LADA system

Organization of objects.

1. General principles.

The organization of data is one of the main tasks not only in programming, and the possibility of structuring objects and their grouping and, ultimately, the possibility of language depend on its solution. Recall at least the value of set theory for the development of mathematics. The simplicity and generality of this theory is the foundation of many theoretical and practical research. For effective implementation in determining the set, you must effectively implement the following operations:
1. Association of the object set.
2. Do not belong to the object set.
3.  Turn on.
4.  Turn on.
5.  Turn on the right.
6.Inclusion with closure on the right.
7.Not inclusion.
8. Combining.
9. Intersection.
10 ¬ Supplement. It is a denial.
')
Perhaps we did not include the difference between the two sets or something else that is often encountered, the proposed one is quite enough for the realization of the rest. Below we consider in detail the implementation of these operations. Noticing that for practical implementation it is of interest to access objects of a set. It is by these signs that we formulate different methods for organizing sets.

1. Classes, types. Class, Type
Classes and types represent a description of the structure of an object and serve as information carriers for creating an object. The created object stores information about its class or type. An additional function of classes and types is the analysis of references to the legality of access to an object. Checking for belonging to a class and type is carried out by checking the stored information about the class of an object when checking legality. For example, at the entrance to the procedure. Access to objects of a class or type is carried out directly by links. Note that the definition of a set in this case occurs before the creation of objects, just as classes and types are a kind of template for creating objects.
2. Arrays. Array
Typically, languages ​​do not provide for checking whether an object belongs to an array. The main goal, which is set in this data organization, is an arbitrary quick access to the objects of this group (or a set, or an array) using an index. An array can be created in the absence of objects. The objects themselves that make up the array can be created later. It should be noted that objects of one class or type can be located in this structure.
3. Tape. Tape. Group.
A tape is a group of objects that can be accessed only sequentially. First the first, then the second object, etc. to the end of the tape. This structure is used for sequential access to objects. For example, to commands executed by a computer sequentially. It is convenient for external access, since it does not require an index, and access can be externally performed by automatically increasing the index (or address). The same property is used in the analysis of the input chain of objects in its analysis. For example, when broadcasting. A check for the belonging of an object to a given group is carried out by enumerating all the objects of the group (taking into account the properties of the sample). An important feature of grouping the tape is the presence of objects in the group during the definition of the group Tape. And it does not allow adding or excluding objects of their group, and moreover, an object can belong to only one Tape group.
4. Group. Group.
The group combines existing objects. Depending on the properties and when the object is included in the group, creates a link to itself. In this case, checking an object for belonging to a group consists in checking that the object has a corresponding link (Indexed property = Yes). And, for the rest, is similar to the container in JAVA. This group allows you to add and remove objects from the group. It is allowed to belong to several groups at the same time. Allows access by index (Item).

A list that stores groups of items in the specified order.
Set (set), which allows the addition of one element of each type
Map (map) stores key-value pairs, which is similar to the mini database
In addition to objects, the group may contain other groups.
5. Sets. Multitude.
A set is defined by formal parameters and a predicate with respect to these parameters. The belonging of an object to a set is established by the truth of the predicate included in the definition of a set. Based on this definition, it is clear that at the time of defining the set the presence of objects is not necessary.

As only the first part is given, I will say that, for example, such a form is possible Private Sub (X: Mu), where Mu is not only a class or type, but also a group or a set.
And that grouping and sets create a so-called “horizontal hierarchy” of objects, in contrast to the “vertical hierarchy” created by the inheritance of classes and types. For example:
Multitude HaveColor: (X: Object) {Color "here sign belongs" X.Properties}
So the set of Having Color contains objects of any class having the Color property.

Source: https://habr.com/ru/post/26693/


All Articles