exercises1-5

exercises1-5 - Concurrency: State Models and Java Programs...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
Concurrency: State Models and Java Programs 1 1 Chapter 1 - exercises This is not really meant as an exercise, but as a way for you to get a first contact with the LTSA tool, which you will be using extensively in this course. 1.1 Start the LTSA, and type the following in the Edit window: BOMB = (start -> timeout -> explode -> STOP). This is a simplified model of a bomb. The timer of the bomb is started, and when it expires (action timeout) the bomb explodes. 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 want to see what it looks like? Select “Window – Draw”. Is this what you expected? 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. Select an action that you would like the bomb to perform (by clicking in its corresponding box). Can all actions be selected? What happens when you select an eligible action? Does anything change on the displayed LTS? 1.2 Perform all of the above steps for the following specification of a lamp: LAMP = (switch_on -> switch_off -> LAMP). Can you see an important difference from the first model?
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Concurrency: State Models and Java Programs 2 2 Chapter 2 - exercises 2.1 For each of the following processes, give the Finite State Process (FSP) description of the Labeled Transition System (LTS) graph. The FSP process descriptions may be checked by generating the corresponding state machines using the analysis tool, LTSA . I. MEETING: hello converse goodbye 0 1 2 3 II. JOB: arrive work leave 0 1 2 III. GAME: one two three lose win 0 1 2 IV. MOVE: ahead left right 0 1 2 V. DOUBLE
Background image of page 2
Concurrency: State Models and Java Programs 3 3 in.1 in.2 in.3 out.2 out.4 out.6 0 1 2 3 VI. FOURTICK: tick tick tick tick 0 1 2 3 4 VII. PERSON: weekday weekend sleep sleep work shop play 0 1 2 3 4 For each of the following exercises 2.2 to 2.6, draw the state machine diagram
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 02/08/2012 for the course CSCI 6232 taught by Professor Rotenstreich during the Spring '11 term at GWU.

Page1 / 7

exercises1-5 - Concurrency: State Models and Java Programs...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online