Temporal feature analysis method describing for automata models of computation systems

The paper reported the temporal feature analysis method describing for automata models of computation systems. The method is based on from source algorithm to modified algorithm expanding makes it possible to take characteristics of work process related to execution time measurement. The paper considers the transition method from source algorithm representation to modification a final state machine with additional states providing registration of temporal features. The paper demonstrates method usage example on computer system authorization algorithm, approves an algorithm complexity for features registration O(n) for n-states automata algorithm. The method can be used for a large class algorithm, but is recommended to apply it to an algorithm, separated on procedure thus mean of commands amount should be more than 500 for more time measurement accuracy.


Introduction
Computational complexity holds an important place in software developmentit is a dependency of time for result computation from input data amount. The characteristic is fundamental in algorithm computational complexity analysis. In practice, frequently requirement is determination specific parameters of algorithm work that influent execution time, not O-notation order [1,2]. For example, it may be functions or methods calls count, its execution time, or function-to-function transition amount.
In our time final states machines model has found wide application in the computer science. Its advantages are simplicity and power simultaneously because straightforward automates define regular grammar. An algorithm in automata representation [3] can be modified to observe parameters of the algorithm execution, such as procedure execution time interval or function-to-function transition amount. It allows deep analysis of processes executed inside of algorithm and detect more optimal solution for tasks or debug it [4,5]. Therefore, we can modify an algorithm for automated collecting and following analyzing characteristics if transform it to automata model.

Method describing
A finite state machine that described the analyzed algorithm is an oriented graph ( ) where every (vertex) is incidental for (edge). It more practice mean, a state is elementary pat of computation process (algorithm step) which consist is: Notice that set of arcs must correlate with the signals, upon consuming of which finite state machine performed the transition to the next state. We can implement it by associative array; it is a tuple whereset of possible keys,set of possible values,mapping function, ( ) → , , . States are objects that the main essence of which consists in delegated method or function executing that is a part of modeled algorithm. These objects contain associated array mapped input signals to the next states. These objects have an associative array that mapped input signals to the next states. In physical systems, a transition might belong some time, and we introduce mapping signal on the delay time (in ticks). Notice that ticks amountdiscrete value that can be translated into analog value. The translation is realized by whereticks amount,mean tick length (in target unit). Use set theory, automata state defined by a tuple of: tuple transitions,input automata alphabet, nset of adjacent vertex , spmapping function of an input signal to state;delay ticks tuple,set of integers, szmapping function signal to delay value;function executed upon state activation;symbolic name (identifier).
For parameters recording, we must extend a tuple described above. We try to extract two parameters, that is why there are tuples: integer of state visiting,tuple of integers that appended every time on computation in the current state t.
Every from tuples contains base tuple . In this case, is the function called on active state visiting, and inside this function has the explicit call of target function (part of algorithm). function is required for computing parameters appearing in f process execution.
So, we can define finite state machine any complexity and record characteristics such as a delay between transitions. Thus, the method of temporal characteristic estimation include the stages: 1. Definition of a set of states , from which we want to take characteristics. 2. Modify initial automata so, for every we build tuple с or t, and for every ∉ , we build tuple. The result of the stage is modified automata. 3. Modeling of modified automat work. The result of the stage is a temporal characteristic value set. Notice that for more representative data registration should repeat the described process several times (amount of repetition depends on modeled algorithm task).

Example of temporal characteristics definition from algorithm presented in automat view
Consider the final state machine describing one of the most popular algorithms from client-server architecture systemsuser authentication/authorization [8,9]. The automat is temporal because inside 3 executing processes take some time [10,11]. Automat can use two variables: _ variable storing actual timestamp, _ variable storing last time token update. Access token expires in AT_TIME, refresh token expires in RT_TIME.
To automat states, will bound next functions: Signals used in the automat has the semantic: SCE: S 5 (t + 1) = 2 5 (12) The authorization algorithm presented in the final state machine view is shown in figure 1.  For this task important knowledge about durations of processes that used internet connection, it's S_2, S_3, and S_7 According to previously described stages of the method, we should use characteristics determined by Pt tuple for there, for others P tuple. For all states we build tuple P, then we fill tuple T and D (symbolic name can be same with the state name in automat). After the stage, the model will have ready; hence, there is it realization possibility by programming language.
We can initiate characteristics collecting when the automat has attained the final state. The collecting process is a graph objects traversal (tuple elements), from which information is extracted; it depends on tuple type: in case, where tuple type is Pt an extracted information is a collection of integers that characterize a duration in ticks [12] of substituted process work. Else for Pc, a target characteristic is the amount of a state visiting. Because modeling of automata's work is a determined graph traversal, we can visit the state several times; on characteristics collecting we keep a separate list tuple Pm -containing all of the other tuples of Pc and Pt. In other cases, we can apply Dijkstra's algorithm because tree structure is the special case of a graph with edge weights = 1, or Prim's algorithm, where is a possibility for traversal in a tree by getting spanning tree and deleting cycles.
Nevertheless, we can define any substituted object that will be collect another information that will be unlike from proposed. It requires defining a tuple Px which at least one of the elements of this is P tuple.
The collecting temporal characteristics method from an automat is shown in figure 2. In rectangles with rounded corners are held virtual methods executed on tuples P. In case, where the state does not require characteristics extracting, an automat executes f function that bound to state (included in P tuple). Else there is occurring of wrapping of a method by a proxy pattern (executing β function that delegates execution to f). For Pc and Pt own registration methods execute respectively.

Complexity estimation
The registration method of temporal characteristics is based on modifying an existing final state machine built for the algorithm. Wherein initial and final models have some structural differences enclosed in the appearance of new states. These states spawn as the result of a registration characteristics requirement (because registration one or the other characteristics is a function computation). The process offers two base characteristics that can be evaluated on a graph traversalthere are amount of a state visiting and set of ticks amount during an automat was in state .
The visiting amount can be evaluated by injecting a state that will increment a variable storing a count of incoming transitions. Notice, the increment may be prefix or postfix operation for state .
Ticks amount spent on computation bound with a state requires two statesstate measuring global ticks before state and state evaluating the difference between current ticks counter and stored value.
The method's structural complexity can be defined by: some subset of transitions (edges) ⊂ of modified automat that at the same time is graph ( , ) wherestates set, must be constricted. The subset defined by t is one from the target states that registration of characteristics will occur; therefore, we build additional set tm which states are used to characteristic's computation (in this paper characteristics is so that max(| tm |) = 2).
Let functions.
( t ) → tm (14) define states set tm for state t , (function say explicitly about states built for it) the set of unordered pairs ( , ), ∈ tm , (edges incidental to a target state and an additional states). Then the result of constriction = (∀ t ∈ , ( t ) = tm ≠ ∅)(⋃ µ( t , tm ) t ) is an initial graph. Obviously | | < | |, therefore, we can get an initial automat for linear time.
It includes the next methods: • addUnitaddition unit to an automat; arguments are procedure of an algorithm, characteristic type, state name; • setMappingcreating named edge between states; • setStartUnitspecifying the initial state; • setEnvironmentcreating an initial context of execution algorithms; • startinitial procedure execution.
After execution of the method, it must specify the next node of computation in the "out" parameter. We can model an automata behavior and a work process characteristics registering.

Conclusion
Our result of developing and researching temporal characteristics method analysis confirms that the method can be applied to algorithms presented in automata form. In our opinion, the method can be applied for many algorithms except these where a block size ( procedure) is too small. In this case, the time characteristics may be imprecise. In addition, we should notice, time characteristics may be measured more accurately by using processor-time measuring procedures for processtime interval when is executed on CPU. An example of that function is system call times from sys/times.h for Unixlike operating systems.
The next explorative question is API implementation, the analyzer of algorithms presented in final state machines.