# Temporal Multimodal Data-Processing Algorithms Based on Algebraic System of Aggregates
## 4 Basics Notions of ASA  
The ASA [18; 19] is an algebraic system whose carrier is a non-empty set of objects, which we call aggregates. Definition 1: An aggregate \(A\) is an ordered finite collection of elements defined by a tuple of sets \(\{A\}\) and a tuple of tuples of elements \(\langle A\rangle\), and the elements \(a_{i}^{j}\) of each tuple of elements \(\left\langle a_{i}^{j}\right\rangle_{i=1}^{n_{j}}\in\ \langle A\rangle\) belong to the corresponding set \(M_{j}\in\ \{A\}\), \(j=[1\ldots N]\), which specifies a one-to-one relationship between the sequence of sets and the sequence of tuples of elements:  
\[A=\llbracket M_{j}\ |\ \left\langle a_{i}^{j}\right\rangle_{i=1}^{n_{j}} \rrbracket_{j=1}^{N}=\llbracket\llbracket\{A\}\ |\ \langle A\rangle\rrbracket, \tag{1}\] \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Features** & **TTS** & **TS** & **TMS** & **ASA** \\ \hline Ordering & yes & no & no & yes \\ Logical operations & no & yes & yes & yes \\ Fuzziness & partly & partly & partly & yes \\ Data aggregation & no & no & partly & yes \\ Temporality & yes & no & no & yes \\ \hline \hline \end{tabular}
\end{table} 
Table 1: ASA comparison. _where \(\{A\}\) is a tuple of sets \(M_{j}\); \(\langle A\rangle\) is a tuple of tuples of elements \(\left\langle a_{i}^{j}\right\rangle_{i=1}^{n_{j}}\); and \(a_{i}^{j}\) is a separate element (value) or a composite element (a tuple of homogeneous values or a tuple of heterogeneous values), \(a_{i}^{j}\in M_{j}\)._  
The defining features of the aggregate, which distinguish this mathematical abstraction from others, are the following:  
* An aggregate is a complex mathematical object, all of whose components are ordered;
* Elements of the tuples can be individual values or tuples of values, and the tuples of values can consist of both values of the same type and values of different types, while each tuple contains elements belonging to one set. According to (1), the elements of the first tuple belong to the first set, the elements of the second tuple belong to the second set, etc. The sequence of sets in an aggregate determines how operations on the aggregate are performed. Sets in a tuple of sets can be repeated; this means that the aggregate includes several tuples consisting of elements of the same type. In software code, an aggregate can be defined as a data structure presented in Listing 1. ```
Aggregate structure: collection\(\leftarrow\) ordered collection of tuples length\(\leftarrow\) number of tuples in the aggregate InitializeAggregate define length of the aggregate create collection of size length initialize tuples in collection Insertion(entity)\(\leftarrow\) add an entity, i.e., a set of values from different tuples Extraction(entity)\(\leftarrow\) delete the specific entity TupleInsertion(position)\(\leftarrow\) add a new tuple to the specific position in the aggregate TupleExtraction(position)\(\leftarrow\) delete the specific tuple AscendingSorting(primaryTuple)\(\leftarrow\) sort tuples in the aggregate by the defined primary tuple in Asceding order DecodingSorting(primaryTuple)\(\leftarrow\) sort tuples in the aggregate by the defined primary tuple in descending order Singling(primatyTuple)\(\leftarrow\) remove all non-unique entities by the defined primary tuple SetsOrdering(orderOfTuples)\(\leftarrow\) reorder tuples by the defined order
```  
**Listing 1**. Interface of a data structure for representing an aggregate. As the order of elements in the aggregate is a crucial point in the ASA, the result of carrying out operations on aggregates depends on the aggregates' compatibility. **Definition 2**. : _Aggregates \(A_{1}\) and \(A_{2}\) are called compatible (\(A_{1}\doteqdot A_{2}\)) if they have the same length, and the type and sequence of sets in them match, that is, the conditions are met:_  
\[\left\{ \begin{array}{l}|A_{1}\ |=\ |\ A_{2}\ |\\ \{A_{1}\}\equiv\ \{A_{2}\}\.\end{array} \right. \tag{2}\]  
For example, the aggregates defined by (3) and illustrated by Figure 1 are compatible. \[