Synchronous programming language

A synchronous programming language is a programming language that is mainly based on its behavior for reactive systems.

General

Synchronous programming languages ​​are generally based on the synchronous hypothesis, which consists of the following assumptions:

  • Multi -form time,
  • Zero -delay model of circuits,
  • Perfectly synchronous model.

Multi -form time: is based on this basic procedure of a synchronous program. The time is determined solely by the ranking of inputs. A period can be defined by the number and form of inputs, for example, a three-time reception of a user-defined signal MINUTE results in a period of three minutes.

Zero -delay model of circuits: A program sequence can be decomposed into individual (process) steps. A process step involves the transformation of a (program) state to the next, such as closing an open elevator door: current state = door open, next state = door. The linear program code for the process step is executed in a finite, predictable time, but without time resolution. To stay with the example elevator door: The program can execute the state transition either when the door is to be closed (timeout or "" button ), or when the door is actually closed, but it can not perceive the process of closing. In order to implement the functionality that a user can interrupt the closing ( "" button, photocell, foot), would another state be provided.

Perfectly synchronous model: this model after all process steps run (at least in concept ) in parallel ( at the same time = ) from. Is the smallest unit of time ( between two temporally different inputs ) a cycle and operate a plurality of processes to each other so they communicate, in principle at the same time, that is in the same cycle. The output of a process is used in the same cycle a process other than input, similar to a chain. As a simple example used an incandescent lamp and a brightness sensor. Turns on the light bulb, the sensor will detect this immediately, and ideally in the same cycle, a result from.

Deterministic behavior, a peculiarity about Esterel and Lustre, forms the basis for program verification and easy ways for the determination of ( program ) maturities. The latter is the case of non - deterministic systems or languages, such as Ada, very expensive. Therefore are acyclic (linear) programs, which do not contain loops, generally preferable.

Synchronous programming languages

  • Argos
  • Esterel
  • Lustre
  • Quartz
  • Signal
  • SyncCharts
  • State mate

Pros and Cons

Synchronous programming languages ​​are mainly use in safety-critical systems. Due to their deterministic structure and easier assessable runtime synchronous languages ​​have here a clear advantage over imperative languages ​​. Through the machine structure, the verification of programs by means of model verification ( model checking ) are possible and thus additional security for the implementation.

Languages ​​such as Esterel, one static scheduling (fixed sequence of instructions of all involved processes considered ) produce, as all occurring in this program concurrent processes and all the instructions at compile time are known. Programs with static scheduling are safe in terms of concurrency.

Synchronous languages ​​are of course not suitable for any kind of problem. That what gives them security, for example, namely the knowledge of how many processes occur at all, is at the expense of dynamic properties. It is therefore possible, for example, not spontaneous processes are created that serve a network connection, the process would have to be already generated at compile- time. Nor is dynamically allocated or freed memory. So they are not suitable, for example, for database systems, since here may apply enormous amounts of data and the predictability of memory needed is not or only partially given.

Software for microcontrollers with pipelining and caching is also not buildable, since undefined states as a result, may appear from the caching. This type of complex programs is possible only in conjunction with other languages.

Well suited they are but for example, for control applications, or more generally for anything that can be reasonably expressed in a finite automaton with the corresponding semantics.

Further reading

  • D. Potop - Butucaru, R. de Simone, J.-P. Talpin: The synchronous hypothesis and synchronous languages ​​. In: R. Zurawski (ed. ), The Embedded Systems Handbook. CRC Press. to appear (2005)
758303
de