n-Ary Cartesian Composition of Multiautomata with Internal Link for Autonomous Control of Lane Shifting

In this paper, which is based on a real-life motivation, we present an algebraic theory of automata and multi-automata. We combine these (multi-)automata using the products introduced by W. Dörfler, where we work with the cartesian composition and we define the internal links among multiautomata by means of the internal links’ matrix. We used the obtained product of n-ary multi-automata as a system that models and controls certain traffic situations (lane shifting) for autonomous vehicles.


Motivation
Every physical object in real time and space is defined by its specific properties such as its position in spacetime, temperature, shape, or dimension. This set of properties may be regarded as a state in which the physical object evinces. While focusing on transport infrastructure, there are a lot of elements of characteristic properties. These characteristics are considered as states of elements in the transport infrastructure, for example, a state of traffic lights, a state of velocity, a state of mileage, or a state of traffic density. A clear description of such states is not the only requirement. The possibility of a state change is an equally important requirement. In this respect, the algebraic theory of automata suggests a specific tool (automata or multi-automata) that enables to change a state using the transition function and input words. In other words, the input symbol (or input word) is applied to a state by a transition function, and consequently, a new state is obtained. In the past, these structures were considered as systems that transmitted a specific type of information. Nowadays, this concept cannot sufficiently describe or even control real-life applications as these are too complex. In such complex and difficult systems, a change of a state causes a change of another state, for example, a train that passes a railroad crossing stops vehicles on a road. In current traffic, a driver of a vehicle usually responds to the change in the state of the surrounding elements in transport-generally, this is what we consider a human factor. Traffic situations will get more complicated when autonomous vehicles or even whole autonomous systems that control the traffic are included. In the case of autonomous systems, we suggest that every vehicle communicates with other vehicles or the infrastructure, and as a result, it influences the next state of a system. The fact that autonomous vehicles can communicate and send information about their state or information about a planned change of their state is considered as an advantage that makes the traffic infrastructure more effective. In this paper, we construct a cartesian composition of multi-automata, i.e., we combine some multi-automata (or automata) and we add internal links between their particular states. This new

1.
There exists an element e ∈ I such that δ(e, s) = s for any state s ∈ S. 2.
The set I is called the input set or input alphabet, the set S is called the state set and the mapping δ is called next-state or transition function. Condition 1 is called the unit condition (UC) while condition 2 is called the Mixed Associativity Condition (MAC).
Next, we are going to work with the idea of a quasi-multiautomaton as a hyperstructure generalization of a quasi-automaton, see [14][15][16][17][18]. When adjusting the conditions imposed on the transition function δ, it must be defined cautiously because we get a state on the left-hand side of Definition 1, condition 2, whereas we get a set of states on the right-hand side.

Definition 2 ([13]).
A quasi-multiautomaton is a triad MA = (I, S, δ), where (I, * ) is a semihypergroup, S is a non-empty set and δ : I × S → S is a transition function satisfying the condition: (1) The semihypergroup (I, * ) is called the input semihypergroup of the quasi-multiautomaton A (I alone is called the input set or input alphabet), the set S is called the state set of the quasi-multiautomaton A, and δ is called next-state or transition function. Elements of the set S are called states, elements of the set I are called input symbols or letters. Condition (1) is called Generalized Mixed Associativity Condition (GMAC).
In the theory of automata, ways to combine automata into one structure have been described. We will recall homogeneous, heterogeneous products, and cartesian composition, which was introduced by [9]. These products were constructed and investigated primarily on classical automata without output in [19]. In the following definition, we recall all three types of products/compositions introduced by W. Dörfler Definition 3 ([20]). Let A 1 = (I, S, δ), A 2 = (I, R, τ) and B = (J, T, σ) be quasi-automata. By the homogeneous product A 1 × A 2 we mean the quasi-automaton (I, S × R, δ × τ), where δ × τ : I × (S × R) → S × R is a mapping satisfying, for all s ∈ S, r ∈ R, a ∈ H, (δ × τ)(a, (s, r)) = (δ 1 (a, s), τ(a, r)), while the heterogeneous product A 1 ⊗ B is the quasi-automaton (I × J, S × T, δ ⊗ σ), where δ ⊗ τ : (I × J) × (S × T) → S × T is a mapping satisfying, for all a ∈ I, b ∈ J, s ∈ S, t ∈ T, δ ⊗ σ((a, b), (s, t)) = (δ(a, s), σ(b, t)). For I, J disjoint we, by A · B, denote the cartesian composition of A and B, i.e., the quasi-automaton (I ∪ J, S × T, δ · σ), where δ · σ : (I ∪ J) × (S × T) → S × T is defined, for all x ∈ I ∪ J, s ∈ S and t ∈ T, by One can see that in the homogeneous product, we have the same input set, which operates on every component of the state set. In the heterogeneous product, the input is a pair of symbols such that each input symbol from the pair is operated on the respective component of the state pair. In the cartesian composition, the input is directed to the corresponding state and operates on one component of the state pair only.
By the cartesian composition of e-quasi-multiautomata A and B, denoted as A · E B, we mean the e-quasi-multiautomaton A · E B = (((I ∪ J), ), S × T, δ · σ), where δ · σ is for all x ∈ I ∪ J, s ∈ S and t ∈ T defined by and : (I ∪ J) × (I ∪ J) → P * (I ∪ J) is for all x, y ∈ I ∪ J defined by {x, y} if x ∈ I, y ∈ J or x ∈ J, y ∈ I and δ · σ : When modelling the process of data aggregation from underwater wireless sensor networks, Křehlík and Novák [21] suggested that using an internal link between respective automata in their cartesian composition describes the real-life context better because the internal link influences not only the given individual automaton but to a certain extent the whole system. In this paper we make use of [21]. Therefore, we include the following definition. For an example explaining the concept (together with calculations) see [21], Example 1.

Definition 5 ([21]
). Let A = (I, S, δ A ) and B = (J, T, δ B ) be two quasi-automata δ A : for all x ∈ I ∪ J, s ∈ S and t ∈ T. The quasi-automaton A · B is called the cartesian composition of quasi-automata A and B with an internal link. If in Definition 4 we replace Condition (4) with (5), we call the resulting quasi-multiautomaton the cartesian composition of quasi-multiautomata A and B with an internal link.

New Theoretical Model
In the classical theory, automata were considered as systems for transfering information of specific types. However, given complicated systems used nowadays, their benefits may not seem sufficient. In [9,13,19,20] we presented some real-life applications. In this section, we introduce an extension of ideas first included in [21] regarding internal links in the cartesian composition of quasi-multiautomata. We discuss systems in which there is a whole set of internal links. For our theoretical purposes we will organize them in a matrix considered by, for example, Golestan et al. [22]. In Section 3, we show the application of our theoretical results in the context of autonomous cars and their navigation.

Notation 1.
We are going to use the following notation: Cartesian product o f state sets : Cartesian product o f transiton f unctions : . . δ n Definition 6. Let MA i = (I i , S i , δ i ) be e-quasi-multiautomata with input semihypergroups (I i , * i ) and δ i : By n-ary cartesian composition of the e-quasi-multiautomata we mean the following system of e-quasi-multiautomata with internal link (SMAil): and : satisfies the condition: One can easily explain what is meant by Definition 6 using Figure 1. When an arbitrary input I i is applied, the system, i.e., the cartesian composition, has to find out in which input set x belongs. Therefore, we determine the correct line in Equation (7), which through using we obtain a new state of the system. If, for example, x ∈ I 1 , the new state s 1 ∈ S 1 will be computed. Then, it will be adjusted to s 1 ∈ S 1 using ϕ 11 , i.e., by the self-mapping internal link. This new state s 1 ∈ S 1 will be mapped to remaining input sets I 2 , I 3 , . . . as defined by the matrix of internal links. In other words, the matrix determines which other states can be influenced by the change of the primary state. We apply inputs on states using respective transition functions. If there is 0 instead of ϕ ij in the matrix of internal links, then the link between the state set S ij and input set I j does not exist. Notice that in Equation (7) e.g., δ 1 (ϕ n1 (δ n (x, s n )), s 1 ) = δ 1 (ϕ n1 (s ), s 1 ) = δ 1 (i 1 , s 1 ) = s . Since we obviously have to regard directions (see the oriented arrows), the matrix of internal links is not symmetric. In Section 3 we apply the matrix of internal links in the context of modelling the navigation of autonomous vehicles. In this context, each vehicle obviously adjusts its behaviour based on the behaviour of other vehicles. Also obviously, not all vehicles need to be autonomous, which explains the use of zeros in the matrix (only autonomous vehicles communicate).
The above reasoning can be seen applied in the following example. Notice that we will use it also for the construction of the state set in Theorems 2 and 4 of Section 3.

Example 1.
Consider a section of a road in front of an autonomously controlled intersection in Figure 2. All vehicles are autonomous with compatible self-driving control parameters. Every car is in a certain state s, for example, car A 3 is in state s = (3; 45; 250; 1; 0; 0), which means, for example, that car number 3 going at 45 km/h is in the position 250 m from the intersection in the 1st lane from the right. The first 0 means no change in speed while the second 0 means that the car is about to turn left.
In our system it is obvious that vehicle A 3 does not need to communicate with vehicle A 4 because it is not an obstacle in its intended driving operation. Thus, introducing an internal link between A 3 and A 4 is not necessary. However, vehicles A 1 and A 2 are problematics for A 3 because it intends to turn left. Therefore, A 1 should increase its speed while A 2 should slow down.

Remark 1.
Notice that some theoretical requests in the above example are not possible or even absurd, i.e., we have to keep in mind their feasibility. We already faced this problem in [12,23], where it was eliminated by using a suitable state set, input set, or operations on them. In this paper, we will choose special input and state sets as well.

SMAil-Application of the Theoretical Model for Autonomous Cooperation
We are going to construct our system, called SMAil, for the above context of Example 1. Naturally, Example 1 is an example of a possible usage of SMAil only.
First, we need to define suitable sets S p RM and I p V M , where p ∈ N is the index. The elements of the state set are ordered pairs-the first component being an ordered sextuple of numbers while the second component is a matrix. The state set is where R p 6 = s = (s 1 , s 2 , . . . s 6 )|s 1 = p; s 2 , s 3 , and where m, n are a odd numbers. The state set describes the complete position of every vehicle in all lanes. Notice that this is the same approach as in [24,25]. Now, the elements of R p 6 defined by Equation (10) correspond to states mentioned in Example 1, i.e., s 1 stands for the vehicle number, s 2 for its speed, s 3 for distance from the intersection, s 4 for the respective lane (calculated from the right using odd numbers only, even number are reserved for positions between two lanes), s 5 stands for changing velocity (i.e., an interval (0, 1) is deceleration, an interval (1, ∞) is acceleration, 1 stands for constant speed), s 6 stands for changing direction (i.e., an interval [− π 4 , 0) means manoeuvring left, interval (0, π 4 ] means manoeuvring right, 0 means straight direction). Of course, more parameters can be used; for an example see [26]. Matrices A used in Equation (9) are taken from the set M m,n defined by Equation (11). Notice that we use these matrices in the form suggested in [25,27,28] where, for the purpose of its control policy, the intersection is divided into a grid of reservation tiles. To be more precise, where 0 are parts of the grid (or tiles) occupied by the given vehicle, 1 stands for tiles occupied by some other vehicles and −1 are free tiles. The above matrix A describes the situation depicted in Figure 3 from the point of view of A 3 . Next, for construction of the i-th quasi-multiautomaton and consequently SMAil, we will need an input alphabet, i.e., input sets (since we will be working with quasi-multiautomata, these will be algebraic hyperstructures). As mentioned above, we will define I p V M , where p ∈ N is the index of the input set.  Since vector components are real (or even natural) numbers, we can suppose that their sets are ordered; we write ≤ for this ordering. For all p ∈ N we define hyperoperation * p : In the following example we show what we mean by the hyperoperation. Notice that the hyperoperation will be later on used to construct a hypergroup in Theorem 1, which will fulfil the assumption regarding input alphabet stated in Definition 2.
where [ r, D 2,3 ] is defined by Equation (14), i.e., D 2,3 ∈ 1 −1 1 Proof. First, we have to show that the associativity axiom holds, i.e., for all Without losing generality, we can show that associativity axiom holds for both matrices and vectors. First, we consider vectors: In the case of matrices, the proof is straightforward: The reproductivity axiom holds automatically because the hyperoperation defined above is obviously extensive, i.e., for all A,

Remark 2.
We consider ordered pairs of vectors and matrices as elements of the input set and also of the state set. As a result, we will denote elements with index ı for input and with index s for the state, i.e., a ı , ı m,n A is an input word and u s , M s m,n is a state.
Proof. This proof is constructed as follows: first we calculate left hand side condition E-GMAC, second we show that left hand side is included in right hand side.
The left hand side: The right hand side: From the definition of hyperoproduct * p in Equation (14), we simply observe that the left hand side is not included in the right part of the right hand side union. Therefore, we have to proof, that the left hand side belongs to the left part of the right hand side union. Therefore we calculate: Once Theorem 2 is proved we will show a practical application af e-quasi-multiautomata in intelligent transport systems. In the following example, the e-quasi-multiautomaton represents an autonomous vehicle. Its state is described by parameters organized into a sextuple while the matrix is used to detect its environment. This example is also linked to Example 1.

Example 3.
We consider matrix B equivalent to matrix A of Equation (12), which describes the situation in   a 21 , a 24 , a 31 , a 34 , a 41 , a 44 , a 17 , a 27 , a 67 , a 77 , a 87 , a 97 , a 10,7 and 1 for other cases.
We know from the new state r s , R s m,n that the vehicle A 3 does not change its velocity or its acceleration. We also know that the vehicle A 3 is positioned about 2m far from the intersection border and is between lane 2 and 3, and it turns to the left. We can see the position surroundings in Figure 4. Consequently, this is what we use in the next step as input for full inclusion in lane 3.  We will use the e-quasi-multiautomata from Theorem 2 for the construction of a system called SMAil. Necessarily, a change on any component of the state of the system must trigger a change on another component of the state. However, there may be situations where the change of other components are not necessarily required. Therefore, we include the following theorem in which we assert that there are such inputs for which the state of the multiautomata do not change.
We prove, while maintaining generality, that i.e., Formula (18) without the left part of the right hand side of E-GMAC. There are two cases. The first, both input words are in the same input set, and the second, input words are from different input sets. and the state can alter by the internal link ϕ pp . This is performed again for input p a ı , p A ı m,n , then we have an input p c ı , p C ı m,n ∈ I p V M for which holds following (considering the proof of Theorem 2): δ p ( p a ı , p A ı m,n , δ p ( p b ı , p B ı m,n , p s s , p S s m,n )) = δ p ( p c ı , p C ı m,n , p s s , p S s m,n ).
When the inputs p a ı , p A ı m,n or p b ı , p B ı m,n are applied on the state t s s , t S s m,n other states react to this change by mapping ϕ pq . It is obvious that mapping ϕ pr influences other states by the input from the respective input set. Then for every component of the state on the right side there exists an element from the corresponding input set, that state on the left hand side is included on the right hand side. it is evident that the same inputs are the same on the right-hand side if internal links ϕ pp , ϕ qq do not change. At the moment, ϕ pp , ϕ pp influence corresponding components of the state, we have suitable inputs on the right-hand side, as in proof of Theorem 2. For mapping the influence of ϕ pr and ϕ qs on other components, we have the same situation as case a). Thus, it is obvious that SMAil holds condition E-GMAC.
In the conclusion of this section, we will demonstrate the theory explained by using the example of SMAil to describe and model a situation with several autonomous vehicles in traffic lanes each intending to perform some action. Next, we need a matrix of the internal link where 0 means no internal link and ϕ mean internal link between vehicles given by the respective indices.
We are going to describe how to proceed, i.e., what input symbols to use, if the grey car, represented by e-quasi-multiautomaton MA 3 , wants to change lane and turn left to lane 5.
We have two approaches to start changing the lane: we can correct of the state of the vehicle directly by the component on the 2nd, 3rd and 4th position in the input word, or to use the internal link and 6th component of the input. We will use an input ( 3 3 ı , 3 1 ı , 3 0.98 ı , 3 0 ı , 3 1 ı , 3 π 5 ı ), 3 b i,j ı = 1 ∈ I 3 V M , which will operate on the 6th component. Then, the resulting state-full correction-will be made by the internal link. The calculation will be done according to Equations (7) and (15), i.e., δ 3 ( 3 3 ı , 3 1 ı , 3 0.99 ı , 3 0 ı , 3 We obtain a state with new elements on the 5 th , 6th positions where these components have an effect on other components by means of the internal link ϕ 33 between the state and input of the e-quasi-multiautomaton MA 3 . With this internal link, we obtain a new input: , i.e., matrix to correct the state matrix detecting other vehicles or obstacles near vehicle A 3 . When we apply a new input on the state 3 3, 3 30, 3 192.06, 3 3, 3 1, 3 π 5 , 3 T s n,m , we obtain δ 3 ( 3 3 ı , 3 1 ı , 3 1 ı , 3 1 ı , 3  where matrix D has the same size and entries as depicted for MA 3 in Figure 7. Now consider internal link ϕ 32 , i.e., state of the e-quasi-multiautomaton MA 2 will be changed by the state 3 3 s , 3 30 s , 3 192.06 s , 3 3 s , 3 1 s , 3 π 5 s , 3 T s n,m of the e-quasi-multiautomaton MA 3 , which we obtained in Equation (20).
We will proceed using the definition of the link between two different e-quasi-multiautomata given as Equation (17). where 2 M ı n,m is a suitable matrix which enables us to obtain a state matrix with entries given in Figure 7 for the state of MA 2 . After we apply the input obtained by the internal link ϕ 32 in Equation (21) with the help of transition function δ 2 , we get a new state depicted in Figure 7 for e-quasi-multiautomaton MA 2 .
Next state of the (vehicle) MA 4 will not affect velocity by internal link ϕ 24 , because the input obtained by

Conclusions
In this paper, we presented the concept of cartesian compositions, which was first introduced by W. Dörfler. In the past, cartesian compositions were generalized in the sense of hyperstructure theory (using complete hypergroups). Now we considered the internal link between the cartesian product of state sets. We described these internal links by matrices and decision functions. These functions determine which state will influence other components. Our modified concept of the cartesian composition is suitable to describe and control systems used for real-life applications, as was shown in examples throughout the paper. While constructing our system called SMAil, we assumed that it was made up of e-quasi-multiautomata of a similar nature. This fact affected the proof of the E-GMAC condition (see Theorem 4), which was a substantial simplification of the procedure discussed in [13]. In our future research, we shall concentrate on answering the question of whether the internal link may not remove the necessity to use the extensions of GMAC, i.e., whether the pure GMAC could be used instead of E-GMAC.
Funding: This article was produced with the financial support of the Ministry of Education, Youth and Sports within the National Sustainability Programme I, project of Transport R&D Centre (LO1610), on the research infrastructure acquired from the Operation Programme Research and Development for Innovations (CZ.1.05/2.1.00/03.0064).

Conflicts of Interest:
The authors declare no conflict of interest.