Лекция: State-Based Programming

Henceforth automata approach was spread to the event-based (reactive) systems. In systems of this kind all limitations, mentioned above are taken away. It is obvious from the name of these systems that events are used among the input actions. Role of output actions could be played by arbitrary functions. Any real-time operating system could be used as an environment. For programming for event-based systems with the help of automata a procedural approach to software developing was used. So this king of programming was called as “statebased

programming”.

Using this method output actions are assigned to the arcs, loops or nodes of the transition graphs (mixed automata are to be used – Moore-Mealy automata). This allows to present sequences of actions, which are reactions to the corresponding input actions, in the compact form. On of the features of programming for the reactive systems is that liquidation of logic in the event handlers and forming of system of interacting automata, which are called from these handlers, causes logic centralization. Automata in such system can interact by nesting, by calling ability and with the help of state numbers interchange. Last type of interaction is described in work, which declares that “this type of interaction may be used as powerful tool for program verification”.

System of interconnected automata forms system-independent part of software. At the same time system-dependent part is formed by functions of input and output actions, event handlers and so on. Another important feature of this approach is that automata in it are used thrice: for specification, for implementation(they stay in the source code) and for drawing up the protocol, which is performed, as said above, in terms of automata.

Last property allows to verify the propriety of automata system functioning. Logging is performed automatically, it is based on the created program. This mechanism could be also used for large scale tasks and for task with difficult, smeared software logic. Any drawn up protocol could be considered as the action script. Note that for the large tasks it is impossible to use sequence diagrams, cooperation diagrams, which are parts of UML language. That is because usage of UML language listed diagrams are suggested to be drawn up manually on the projection phase of developing. In automata-based programming protocols will be build automatically at the run-time. Protocols allow to keep an eye on program execution and demonstrate that the fact is that automata are not just the “pictures”, but they are actually functioning entities.Automata approach is offered to be used not only for controlling system developing, but also for objects of control modeling.

This method was approved on the task of developing of controlling system for ship diesel generator. Mentioned system was specified with help of more than thirteen interacting automata. For describing of model of diesel generator automata were also used. While designing each automaton was provided with four following documents:

· verbal description (“expectancies declaration ”);

· bonds scheme, which explains on the human language all symbols which are involved inautomatons interface;

· state transition graph with symbolic indication of events, input and output actions;

· source code of program module, which realizes state transition graph (also without usageof meaningful identifiers and comments).

These documents replace self documenting programs, which contains meaningful identifiers and comments. These standard facilities cannot ensure the understandability and clearness of the source code for further developing, modifying and enlarging. This problem for difficult logic cannot be solved also with the help of self documenting state transition graphs.

Realized project had proved expediency of protocols usage for verifying propriety of interaction of such great amount of automata and each automaton separately.

This project had been implemented for computing system with architecture ix86. Henceforward described approach was evolved by N. I. Tukkel for developing systems for microcontrollers.

Advantage of automata technology is that all design may be done on personal

computer using Switch-technology and only on last phase of developing software could be ported to microcontroller.

еще рефераты
Еще работы по информатике