Cet outil a été développé en Grand-Bretagne pour apporter un support pratique pour la modélisation de systèmes concurrents. Il a été utilisé pour les exemples dans le livre "Concurrency: State Models and Java Programs".
Il y a la version originale, tres simple (que j'utilise dans le cours), qui vient comme applet en Java (ou peut être copiée d'ici). Une nouvelle version a été intégré dans l'environnement Eclipse et a essentiellement les mêmes fonctionalités (download ici). La version Eclipse a aussi un peu de documentation: un help-guide qui contient un appendice A avec un Quick Reference Guide. Dans ce cours, nous n'utilisons qu'un nombre restreint de fonctionalités, et vous allez comprendre les pluparts des aspects en regardant les examples donnés dans le cours.
Tous les exemples LTSA utilisés dans SEG-2506 se trouvent ici.
We use the example of the hotel system to explain the basic features of LTSA. Here is the text of this example:
// state machine of the client: it has only one state, all client actions are possible any time.
CLIENT = (checkIn -> CLIENT | checkOut -> CLIENT |
eat -> CLIENT | payCash -> CLIENT | chargeRoom -> CLIENT).// state machine of a restaurant. The alphabet of this LTS is {eat, payCash, chargeRoom}
RESTAURANT = (eat -> DONE),
DONE = (payCash -> RESTAURANT | chargeRoom -> RESTAURANT).// state machine of a room. The alphabet of this LTS is {checkIn, checkOut, chargeRoom}
ROOM = (checkIn -> OCCUPIED),
OCCUPIED = (checkOut -> ROOM | chargeRoom -> OCCUPIED).ROOM2 = (checkIn -> checkOut -> ROOM2).
// The system consists of one client, one restaurant and one room
||SYSTEM = (CLIENT || RESTAURANT || ROOM).
// List of interactions in this system:
// (a) Rendezvous involving the CLIENT and the RESTAURANT: eat, payCash
// (b) Rendezvous involving the CLIENT and the ROOM: checkIn, checkOut
// (c) Rendezvous involving all three objects: chargeRoom
As the last line indicates, the system consists of three state machines that work concurrently. Working concurrently, means that transitions of different state machines that have the same name can only be execute jointly, that is, in rendezvous.
The first two lines define the state machine CLIENT. CLIENT is the name of the state machine and also the name of its initial state. All state names are written in upper case characters. The CLIENT machine has only one state. The words in lower case characters are transition names. The first line indicates that from the CLIENT state, the machine can make a checkIn transition which leads to the next state CLIENT, or a check-out transition that leads to the same state. Etc. The definition of state machine is terminated by a dot "."
The RESTAURANT state machine has two states, the initial state RESTAURANT and another state called DONE.The first line of its definition indicates that from the initial state, there is only one transition named eat. The second line defines the transitions available from the state DONE. Note that all transitions from a given state are put in paranthesis, followed by a comma "," if this is not the last state of the machine definition.
Note that some of the states of a state machine may not be explicitely mentioned (they have no name). For instance, the definition of the ROOM2 state machine has two states: ROOM2 and the state reached after the transition checkIn. This second state is in-between the transitions checkIn and the following checkOut. After checkOut, the machine is again in its initial state ROOM2.
Note: It is important to note for each state machine the set of transition names, which is called the "alphabet" of the machine. It is the set of interactions in which it participates. If there is an intersection between the alphabets of two (or more) machines, then the transitions with these names can only be executed in rendezvous. A transition with a name that is unique to the given machine, is executed independently of the other machines within the system. For instance, the transition eat is performed by RESTAURANT independently of other machines, check-in is performed by CLIENT and ROOM in rendezvous, and chargeRoom is executed in rendezvous by all three machines (and it can only occur if all three machines are in a respective state where this transition is allowed).
The LTSA tool has the drop-down menues File, Edit, Check, Build, Window, Help and Options. Below are three buttons: Edit, Output, and Draw. A typical steps of using the tool are the following: