Rodin HandbookThis work is sponsored by the Deploy Project This work is sponsored by the ADVANCE Project This work is licensed under a Creative Commons Attribution 3.0 Unported License |
2.4.2 Project SetupModels typically consist of multiple files that are managed in a project. Create a new Event-B Project File New Event-B Project. Give the project the name tutorial-03 as shown in Figure 2.5.
Next, create a new Event-B Component. Either use File New Event-B Component or right-click on the newly created project and select New Event-B Component. Use mac as the component name, select Machine as component-type, and click Finish as shown in Figure 2.6. This will create a Machine (3.2.4) file. The newly created component will open in the Rodin Editor. This displays the machine hierarchy as text, although at this point, you cannot add any text apart from comments. Elements can be added to the model by using the wizards for variables, variants, invariants, and events (the , , , and buttons). You can also add elements by finding the name of the machine under the MACHINE heading. There is a small green arrow ( ) directly to the right of the name of the machine (in this case, the name of the machine is “mac"). Place your cursor directly to the left of the green arrow and right click. Select the element that you would like to add from the Add Child menu. If an element of a certain type has already been created, you can also create more elements of that type by right clicking on the type of the element you would like to add (e.g. VARIABLES) that is coloured in purple and select Add Child. You can also place your cursor directly before the green arrow to the left of an element name and hit CTRL-T or right click and select Add Sibling. You can also edit the machine using the Event-B Machine Editor. This was the default editor in Rodin 2.3 and earlier versions and is still available to view and edit machine files. To do this, right click on the mac component in the Event-B Explorer and select Open With Event-B Machine Editor. This editor has four tabs at the bottom. The Pretty Print tab shows the model as a whole with color highlighting, but it cannot be edited here. This is useful to inspect the model. Under the Edit tab, you can edit the model. The six main sections of a machine (REFINES, SEES, etc.) are displayed in a collapsed state. You can click on the button to the left of a section to expand it. This editor is form-based. This means that it can be modified by using controls (i.e. text fields, dropdowns, etc.) to input information. More information about this editor is available in the reference section (3.1.5).
|