|
|
# Hello World
|
|
|
|
|
|
[TOC]
|
|
|
|
|
|
Here we walk through the basics involved in writing a simple behaviour model.
|
|
|
We use FSP (Finite State Process) language for definitions.
|
|
|
|
|
|
Here are two sequential processes and one parallel composition:
|
|
|
|
|
|
```
|
|
|
TEST_CELLS = (sCountCells -> PROCESSING),
|
|
|
PROCESSING = (eCountCells -> TEST_CELLS).
|
|
|
|
|
|
DOCTOR_CELLS = (analyseBlood -> INSPECTING | sCountCells -> DOCTOR_CELLS),
|
|
|
INSPECTING = (bloodResult -> BLOOD | sCountCells -> DOCTOR_CELLS),
|
|
|
BLOOD = (sCountCells -> DOCTOR_CELLS).
|
|
|
|
|
|
|
|
|
|| CELLS = (DOCTOR_CELLS || TEST_CELLS).
|
|
|
```
|
|
|
## Parse, Compile and Compose
|
|
|
|
|
|
Copy the above example in MTSA _Edit_ tab.
|
|
|
|
|
|
### Parse
|
|
|
|
|
|
To parse and verify that the text has no syntax errors, click on the parse icon. 
|
|
|
|
|
|
If something goes wrong the pointer will position automatically in the line and column where the error was found. And the error message will be displayed in the _Output_ tab.
|
|
|
You may try to force an error to verify this behavior, for instance with the following text:
|
|
|
```
|
|
|
TEST_CELLS = sCountCells -> PROCESSING.
|
|
|
```
|
|
|
|
|
|
You will get the following error message
|
|
|
**ERROR line:1 - (, if or process identifier expected**
|
|
|
|
|
|
### Compile
|
|
|
You can compile the FSP into LTS. For example, `TEST_CELLS` and `DOCTOR_CELLS`. Click on the 
|
|
|
|
|
|
### Compose
|
|
|
Parallel composition computed with the ` button. You must also choose the machine to compose. If you only have one parallel composition in your editor, MTSA will automatically select it. Otherwise, you can switch between the machines by clicking in the drop down menu.
|
|
|
|
|
|
### Result
|
|
|
Here is the graphic representation of the above LTS. You will see the same ones in _Draw_ tab.
|
|
|
|
|
|

|
|
|
|
|
|

|
|
|
|
|
|

|
|
|
|
|
|
### Parsing details
|
|
|
|
|
|
Note that the definition of one process ends when you use a dot. Use comma introduce local definitions within a process definition. In the above example, `INSPECTING` and `BLOOD` are local definitions to `DOCTOR_CELLS`. |
|
|
\ No newline at end of file |