Advanced Programming - Concurrency, Lab 1

Aims

The aim of this lab is to familiarise yourself with the LTSA (Labelled Transition Systems Analyser) tool on one hand and to try your hand at some simple models, so as to learn the FSP (Finite State Processes) language.

The LTSA tool provides you with a very simple editor for writing models in the FSP language. But unlike other modelling tools (e.g., most UML ones), editing is just the first step with this tool. It can:

  1. Try starting the LTSA tool:

  2. Start LTSA and write a simple model for a bomb. Someone _starts_ the timer of the bomb and that runs until the _timeout_ event. The _timeout_ is followed by the _explode_ event, at which point the behaviour of the bomb stops.

    So a model for the above specification would be something like:

    BOMB = (start -> timeout -> explode -> STOP).
    
    We have a process that models the bomb (called BOMB - all process names are in capital letters) - this process can engage in the start action, then in the timeout action, then in the explode action and at that point it behaves like the STOP process (which does nothing).

    Now from the "Build" menu option, select "Parse". This lets you know if your specification contains syntax errors.

    If you have no syntax errors, then select "Check -> Compile". This will generate the state machine (Labelled Transition System - LTS) that corresponds to your specification.

    You can also experiment with actually "animating" the model of the bomb. Select "Check -> Run -> Default". An animator window comes up. On the right, you have the actions that can be performed by the Bomb. The "ticked" ones are those that are eligible at the current state.

    Go to "Window" and select the "Alphabet" option. Another tab is now available (along with "Edit", "Output" and "Draw"), called "Alphabet". Select that tab and see what the alphabet of the BOMB process is.

    Questions

  3. Now perform all the above steps for the following specification of a lamp:
    LAMP = (switch_on -> switch_off -> LAMP).
    

    Questions