The B(PN)² editor
The B(PN)² editor is a text editor with some B(PN)² specific features.
In the main part of the editor window a B(PN)² program can be edited.
If the keyboard offers this possibility the cut , copy and paste keys can be used.
The icons underneath the pull-down menu are macros for typing part of a B(PN)² program.
-
- The proc()--end button pastes the declaration of a procedure to the current cursor position.
-
- The begin--end button pastes a begin-end block to the current cursor position.
-
- The var { 1,3..5 } button pastes the declaration of a variable to the current cursor position.
-
- The bool button pastes the declaration of a boolean variable to the current cursor position.
-
- The chan button pastes the declaration of a channel variable to the current cursor position.
-
- The stack button pastes the declaration of a stack variable to the current cursor position.
-
- The do--od button pastes a do-od construct to the current cursor position.
The icon underneath the Help item invokes an algorithm to display keywords in boldface and comments in italic.
Menus of the B(PN)² editor
File Menu
The items on the File Menu are: Open, Reload, Save, Save
as, Import File, Export Clipboard, and Quit.
- Open
- Opens the file browser to select a B(PN)² program.
- Reload
- Reloads the program (e.g. if you made a mistake and want to go back to the previous version).
- Save
- Saves the contents of the B(PN)² editor to a file. The name of the file is
displayed underneath the main part of the window.
- Save as
- Opens the file browser to save the contents of the B(PN)² editor to
a file.
- Import File
- Opens the file browser to select the name of a file to be loaded
into the B(PN)² editor at the current cursor position.
- Export Clipboard
- Opens the file browser to select the name of a file. The contents
of the clipboard are saved to this file. You can either use the copy
button on your keyboard or the menu entry Edit>Copy to copy a selection to the clipboard. Be carefull, the clipboard is not local to th PEP tool, it can be changed e.g. if you hit the copy key on your keyboard even if you work with a totally different program!
- Quit
- Closes the B(PN)² editor. If there are unsaved changes, a dialog box asks
whether or not these changes should be saved before the editor is closed.
Edit Menu
The items on the Edit Menu are: Cut, Copy, Paste, Add to
Multi-Selection, Clear Multi-Selection, Search, and Replace.
- Cut
- Cuts the current selection (a part of the text marked using the left mouse button). It is saved to the clipboard and can be used for further paste or export operations.
- Copy
- Copies the current selection to the clipboard.
- Paste
- Pastes the contents of the clipboard to the current cursor position.
- Add to Multi-Selection
- Sometimes it is necessary to select more than one items (e.g. 2 actions
corresponding to one transition in the Petri box). After selecting one of them
with the left mouse button it can be added to the current multi-selection
either by a click on the right mouse button or by this menu entry. A
multi-selection of more than one item can only be used for the operations in the Reference menu, but not for Copy or Paste operations.
- Clear Multi-Selection
- Clears a multi-selection.
- Search
- Opens a dialog box that offers a comfortable searching facility.
- Replace
- Opens a dialog box that offers a comfortable search and replace
facility.
Action Menu
The item on the Action Menu is Syntax Check.
- Syntax Check
- Invokes an algorithm checking whether or not the
B(PN)² program is syntactically correct. If you already edited the program
after the last saving, a dialog box asks you whether the current version should be saved first or the check should be cancelled. If there is no syntax error a
small box displays success. Otherwise a dialog box explains the errors and allows their correction. Each line gives a description of one
error. A double click on one of the lines positions the cursor of the B(PN)²
editor at the position where the error occured.
Reference Menu
The B(PN)² editor includes the facility for
determining which place in a Petri box corresponds to a given point in the
control flow of the associated B(PN)² program, or which transition in the Petri box corresponds to one or more actions in the program.
After selecting,
e.g., an action in the B(PN)² program, one of the entries in the
Reference menu can be used to paste the name of the corresponding
transition(s) to the formula editor. In this way temporal logic formulae can be made to refer to points of the control flow ar actions (using macros like LIVE of the program, even though technically speaking, the temporal logic refers only to place of a net.
If a transition in the Petri box belongs
to more than one action in the B(PN)² program (i.e., is a synchronisation), then there are two possibilities to refer to this transition. Either you select only one of these actions and use the menu entry Show Transition in Formula (partial) or you select all these actions with a multi-selection and use the menu entry Show Transition in Formula.
A good way to become familiar with all these kinds of references between a B(PN)² program and a net is to use the menu entry Show Reference (in combination with the option Highlight Execution in one of the net editors.
The items on the Reference Menu are Show Place in Formula, Show Transition(s)
in Formula (partial), and Show Transition(s) in Formula.
- Show Place in Formula
- Pastes the name of the place (of the Petri box) corresponding to the
current selection (in the B(PN)² editor) to the formula editor (at the latter's current cursor position),
provided there is a reference from the selection to a place of the net.
- Show Transition(s) in Formula (partial)
- Pastes the name(s) of the transition(s) (of the Petri box) corresponding to the current selection (in the B(PN)² editor) to the formula editor (at the latter's current cursor position), provided there is a reference from the selection to at least one transition of the net). It is sufficient for the transition(s) to belong to more actions than the selected ones.
- Show Transition(s) in Formula
- Pastes the name(s) of the transition(s) (of the Petri box) corresponding
to the current selection (in the B(PN)² editor) to the formula editor (at the current cursor
position), provided there is a reference from the selection to at least one
transition in the net. It is not sufficient for the transition(s) to belong
to more action(s) than the selected one(s).
Info
- Info
- Shows the about box for the text editors integrated in the PEP tool.