In this exercise we create the text representation of the MSC specification for our example. The specification consists of two text files: an MSC describing the desired sequence of events for the example, and an HMSC describing the infinite repetition of this sequence.
File ask.mpr
mscdocument Ask;
msc Ask;
S:
instance;
A:
instance;
all:
condition start;
A:
out Question to S;
S:
in Question from A;
S:
out Answer to A;
A:
in Answer from S;
all:
condition start;
S:
endinstance;
A:
endinstance;
endmsc;
The corresponding Graphical Representation (MSC GR format) looks like this:
The MSC Ask specifies two instances (A and S). This MSC has two shared conditions with the same name start at the beginning and at the end of the sequence of events. Between the two conditions there is an interchange with messages between the two instances.
File dialog.mpr
mscdocument Dialog;
msc Dialog;
expr L1;
L1: condition start seq (L2);
L2: (Ask) seq (L1);
endmsc;
This HMSC contains a start symbol at the top followed by symbol of condition start followed by an MSC reference symbol Ask and a flowline back to the start condition. Condition start in HMSC Dialog stands for both initial and final conditions in MSC Ask. This HMSC describes an infinite loop in which events from the MSC Ask are performed.
We have completed the textual specification of our model.
The next exercise will describe how to use the command-line interface to the KLOCwork MSC to SDL Synthesizer to produce an executable state machine model for our model.