Difference between pages "Relevance Filter Plug-in" and "Rodin Editor User Guide"

From Event-B
(Difference between pages)
Jump to navigationJump to search
imported>Roederja
 
imported>Tommy
 
Line 1: Line 1:
The purpose of the '''Relevance Filter Plugin''' is to try to automatically
+
== Introduction ==
select relevant hypotheses for a proof as opposed to the user doing this
 
manually.
 
  
=== Instructions ===
+
The Rodin Editor plug-in provides a structured editor to model in Event-B withing Rodin. This editor uses a textual representation, and edition is done through an overlay text editor and action depending on the caret position in the text.<br>
 +
For more details about the principles of this editor,  see [[Rodin_Editor|the Rodin Editor Plug-in page]].<br>
  
The relevance filter can be invoked either by clicking the RF button in
+
'''IMPORTANT FOR RODIN PLATFORMS BELOW RODIN 2.5''' :  ''we identified a source of concurrency issue in the current version (0.5.0) of the plug-in.''<br>
the proof control, or automatically as part of the auto tactic.
+
'''The Rodin Editor is not maintained for these versions of Rodin  since Rodin 2.4. Please try to upgrade your plaform to the latest [[Rodin_Platform_Releases | version of Rodin available]].'''
 +
'''To avoid any trouble, please do not generate files while having some Rodin Editor open, and edit only one model per project at once.'''
  
It also comes with a preference dialog (under Event-B > Sequent Prover > Meta Prover) that allows you to configure the
+
== Installation ==
filter(s). The plugin implements several filtering methods that will be
 
tried sequentially. The default setting is a selection of filters that
 
have been found to work well.
 
  
If you want to add the relevance filter to the auto tactic you should
+
=== Setup ===
add the Meta Prover item. It replaces NewPP after lasoo, NewPP
+
Since Rodin 2.4, the Rodin Editor is part of the core platform (i.e. it is pre-installed and available out of the box).
unrestricted, Atelier B P1 and Atelier B PP since this functionality is
+
Once you've installed Rodin 2.4 or upper, you are ready to use the Rodin Editor plug-in.
already included in the Meta prover. You still have to add ML at the
 
appropriate place in the tactic as well as NewPP restricted and Atelier
 
B P0.
 
  
You can install the feature composition plug-in from the Rodin Update Site.
+
=== Release Notes ===
 +
See [[Rodin_Editor_Release_History | Rodin Editor Release Notes]]
  
=== Filters ===
 
The relevance filter plugin includes the following filtering methods:
 
* Meng & Paulson's relevance filter
 
This filter uses a set of relevant symbols which is initialized with the symbols contained in the goal. Hypotheses are then selected if they contain the symbols contained in this set of relevant symbols. When selected their symbols are also added to the set of relevance filters. The passmark parameter determines how many symbols a hypothesis may contain that are not in the relevant set, in order to be selected. When the pass mark parameter is 0.8 a hypothesis is still considered relevant if 20% of its symbols are not in the relevant set. I.e. higher numbers select less hypotheses. When running the algorithm the pass mark is increased incrementaly to avoid selecting too many hypotheses. The c paramter determines how fast this happens. The parameter must be greater or equal to 1, where 1 is the fastest increase.
 
* SInE
 
SInE is based on the idea that each symbol has a defining hypothesis. It selects all hypotheses that define a symbol contained in the goal and recursively all hypotheses that define a symbol contained in the previously selected hypotheses.
 
* DCR
 
This filter builds a weighted graph between all hypotheses and the goal. The edges are weighted based on the symbol overlap between the connected formulas. The threshold parameter defines the maximal distance a hypothesis may have from the goal in order to be considered relevant. If "use contextual relevance" is selected the overall frequency of a symbol is taken into account when computing the distance between two formulas.
 
* Sub-Expression filter
 
Selects hypotheses that have a common expression with the goal. The initial selection size parameter determines how many hypotheses similar to the goal are selected in the initialization step at most. The threshold parameter defines how similar the formulas selected in the initialization step must be to the goal. Higher means more similar. The value must be between 0 and 1.
 
* Lasso
 
Selects all hypotheses that have a symbol in common with the goal or any of the selected hypotheses
 
* Unrestricted
 
Selects all hypotheses.
 
  
More information can be found in [http://e-collection.ethbib.ethz.ch/view/eth:2278 "Relevance Filters for Event-B"]
+
== Editing ==
  
== Releases ==
+
This is a small exercice to get used to the principles of the new structured editor. It is based on the 'Celebrity' project of the tutorial. You can download the resulting project [http://sourceforge.net/projects/rodin-b-sharp/files/Doc_%20Tutorial/1.1/Celebrity.zip/download <tt>here</tt>].<br>
 +
We will here build the context ''Celebrity_C0''.
  
===== Version 1.0.0 =====
+
=== Create a context, add elements to it ===
 +
Let's create a Rodin project, and add a context component called ''Celebrity_C0'' to it.<br>
 +
-- By opening this context with the Rodin Editor (right click > Open with > Rodin Editor) you shall obtain the following:<br>
 +
[[Image:RodinEditor_UserGuide_step1.png]]
  
''27th Sep 2010''
+
This editor allows to do things based on the position of the caret.<br>
 +
-- The caret is place at the front of the context name, and this is fine because we want to add a constant
 +
to the context.
 +
-- To add a constant, right click and select '[Child]-> Add Constant' as in the picture below:
  
Version compatible with Rodin 2.0
+
[[Image:RodinEditor_UserGuide_step3.png|400px]]
  
== References ==
+
-- Save the file. <br>
* Röder, Jann [http://e-collection.ethbib.ethz.ch/view/eth:2278 "Relevance Filters for Event-B"], ''ETH Zürich'', April 5, 2010
+
After saving the file, the error markers are recalculated, and you have an error that appears on the newly created constant 'cst1'.<br>
 +
You shall see something like this :
  
[[Category:User documentation]]
+
[[Image:RodinEditor_UserGuide_step4.png|400px]]
 +
 
 +
Note that you can visualize the error message by going over the error marker with the mouse.
 +
 
 +
-- Now we enter the edition mode by clicking inside the label 'cst1', as we want to name the constant 'cst1' to 'k'.
 +
 
 +
[[Image:RodinEditor_UserGuide_step5.png|550px]]
 +
 
 +
The overlay editor then appears (the background is grey and a box is drawn[see above]) and you can modify the label of the constant.<br>
 +
-- Modify the label to be 'k'and exit the overlay edition by pressing 'Enter' or click next to k. ''Note that because 'Enter' is used to enter or exit the overlay mode under the caret, in order to insert carriage return in text, you have to press CTRL+ENTER (Apple+Enter) on mac platforms.<br>''
 +
You can then save the file. <br>
 +
You then see something like the following.
 +
 
 +
[[Image:RodinEditor_UserGuide_step6.png|300px]]
 +
 
 +
Then we want to give this constant an integer type. As the caret is near 'k', and k is a constant, we will use '[Sibling]-> Add sibling' command to add an axiom.<br>
 +
-- Right-click and select "[Sibling]-> Add Axiom" you see then that a new axiom was created, named 'axm1'.
 +
 
 +
[[Image:RodinEditor_UserGuide_step8.png|400px]]
 +
 
 +
You've just created an axiom that you can edit to give the constant k a type.
 +
You can then enter the overlay edition mode to change this value to 'k : INT'.<br>
 +
After saving the file, you obtain the following context :
 +
 
 +
[[Image:RodinEditor_UserGuide_step9.png|500px]]
 +
 
 +
and the markers disappear because there is no error left in your context.
 +
Finally, suppose that the axiom axm1 should be considered as a theorem, click on not theorem after the axiom formula, to change the attribute of the predicate to a theorem.
 +
 
 +
''' CONGRATULATIONS! You learned how to use the Rodin Editor.'''
 +
You learned that :
 +
# To create an element:
 +
## or you place the caret before the label of its parent, and create a child using '[Child]->Add xxx' where xxx is the type of element you want to add, from the contextual menu,
 +
## or you place the caret next to a sibling element and you create a sibling using '[Sibling]->Add xxx' where xxx is the type of element you want to add, from the contextual menu.
 +
# To edit the attributes of an element:
 +
## you enter the overlay edition with left click or with "ENTER" and modify the textual contents,
 +
## you press 'ENTER' to quit overlay edition (or click outside the overlay editor).
 +
 
 +
=== Select, Move and delete elements ===
 +
 
 +
-- To select elements, you can double-click on them, or press CTRL and click on one element. The selected elements appear with a blue background,
 +
or a gray background if they are of different types. See the picture below.
 +
 
 +
[[Image:RodinEditor_UserGuide_step11.png|350px]]
 +
 
 +
-- To unselect element, by default, press ESC.
 +
 
 +
-- To move elements, try both:
 +
* Move Up and Move Down commands in the context menu, once elements are selected,
 +
* Drag and drop on the selection.
 +
 
 +
-- To delete elements, try both:
 +
* Use the 'Delete' command on a selection from the context menu,
 +
* Press the DEL or SUPPR key after selecting the elements you want to delete.
 +
 
 +
=== Using keyboard shorcuts ===
 +
Here is the list of the currently key bindings which are set by default and specific to the Rodin Editor.
 +
 
 +
{{SimpleHeader}}
 +
|-
 +
! scope=col | KEY SEQUENCE || ACTION
 +
|-
 +
| BACKSPACE (ENTER) || Enter the edition mode using the overlay editor if the caret is on an editable place.
 +
|-
 +
| DEL || Suppress the element after the caret position
 +
|-
 +
| ALT+T || Add a sibling of the element pointed by the caret position. The sibling is placed just after this latter one.
 +
|-
 +
| ALT+G || Opens a popup to select the element type of the child to add to the element pointed by the caret position. Note that if there is only one child type, the child will be directly created.
 +
|-
 +
| CTRL+BACKSPACE || Insert a new carriage return while editing with the overlay editor.
 +
|-
 +
| ALT+ARROW_UP || Move up the selected elements.
 +
|-
 +
| ALT+ARROW_DOWN || Move down the selected elements.
 +
|-
 +
| SHIFT+ARROW_UP || Select elements up.
 +
|-
 +
| SHIFT+ARROW_DOWN || Select elements down.
 +
|-
 +
| ESC || Quit the current overlay edition (if any) and forget the modifications made, frees the current selection.
 +
|-
 +
| TAB || Go to the next editable place (i.e. to the next editable element attribute)
 +
|-
 +
| SHIFT+TAB || Go to the previous editable place (i.e. to the next editable element attribute)
 +
|}
 +
 
 +
=== Customize these shortcuts ===
 +
If you don't like these shortcuts, you can modify them by setting your own key preferences.
 +
To do so, go to Window > Preferences and then General > Key. A table appears were you can find and edit the shortcuts.
 +
 
 +
<!--== Tips & Tricks ==
 +
A command currently disable the possibility to use the ESC instead of ALT+ESC sequence. This is quite cumbersome, and can be tuned!
 +
To do so, open the preference table for key shortcuts (described above) and after ensuring you disabled the filters of uncategorized commands (using the Filters... dialog)
 +
search for the command named "Restore Styles". This is the command to release the highlights in the proving views. You can then swith the sequence of this command to ALT+ESC and change the value of the "Abort edition and free selected items" command to ESC. After applying these settings, the shortcuts will be modified as wished above.
 +
-->

Revision as of 10:09, 18 July 2012

Introduction

The Rodin Editor plug-in provides a structured editor to model in Event-B withing Rodin. This editor uses a textual representation, and edition is done through an overlay text editor and action depending on the caret position in the text.
For more details about the principles of this editor, see the Rodin Editor Plug-in page.

IMPORTANT FOR RODIN PLATFORMS BELOW RODIN 2.5 : we identified a source of concurrency issue in the current version (0.5.0) of the plug-in.
The Rodin Editor is not maintained for these versions of Rodin since Rodin 2.4. Please try to upgrade your plaform to the latest version of Rodin available. To avoid any trouble, please do not generate files while having some Rodin Editor open, and edit only one model per project at once.

Installation

Setup

Since Rodin 2.4, the Rodin Editor is part of the core platform (i.e. it is pre-installed and available out of the box). Once you've installed Rodin 2.4 or upper, you are ready to use the Rodin Editor plug-in.

Release Notes

See Rodin Editor Release Notes


Editing

This is a small exercice to get used to the principles of the new structured editor. It is based on the 'Celebrity' project of the tutorial. You can download the resulting project here.
We will here build the context Celebrity_C0.

Create a context, add elements to it

Let's create a Rodin project, and add a context component called Celebrity_C0 to it.
-- By opening this context with the Rodin Editor (right click > Open with > Rodin Editor) you shall obtain the following:
RodinEditor UserGuide step1.png

This editor allows to do things based on the position of the caret.
-- The caret is place at the front of the context name, and this is fine because we want to add a constant to the context. -- To add a constant, right click and select '[Child]-> Add Constant' as in the picture below:

RodinEditor UserGuide step3.png

-- Save the file.
After saving the file, the error markers are recalculated, and you have an error that appears on the newly created constant 'cst1'.
You shall see something like this :

RodinEditor UserGuide step4.png

Note that you can visualize the error message by going over the error marker with the mouse.

-- Now we enter the edition mode by clicking inside the label 'cst1', as we want to name the constant 'cst1' to 'k'.

RodinEditor UserGuide step5.png

The overlay editor then appears (the background is grey and a box is drawn[see above]) and you can modify the label of the constant.
-- Modify the label to be 'k'and exit the overlay edition by pressing 'Enter' or click next to k. Note that because 'Enter' is used to enter or exit the overlay mode under the caret, in order to insert carriage return in text, you have to press CTRL+ENTER (Apple+Enter) on mac platforms.
You can then save the file.
You then see something like the following.

RodinEditor UserGuide step6.png

Then we want to give this constant an integer type. As the caret is near 'k', and k is a constant, we will use '[Sibling]-> Add sibling' command to add an axiom.
-- Right-click and select "[Sibling]-> Add Axiom" you see then that a new axiom was created, named 'axm1'.

RodinEditor UserGuide step8.png

You've just created an axiom that you can edit to give the constant k a type. You can then enter the overlay edition mode to change this value to 'k : INT'.
After saving the file, you obtain the following context :

RodinEditor UserGuide step9.png

and the markers disappear because there is no error left in your context. Finally, suppose that the axiom axm1 should be considered as a theorem, click on not theorem after the axiom formula, to change the attribute of the predicate to a theorem.

CONGRATULATIONS! You learned how to use the Rodin Editor. You learned that :

  1. To create an element:
    1. or you place the caret before the label of its parent, and create a child using '[Child]->Add xxx' where xxx is the type of element you want to add, from the contextual menu,
    2. or you place the caret next to a sibling element and you create a sibling using '[Sibling]->Add xxx' where xxx is the type of element you want to add, from the contextual menu.
  2. To edit the attributes of an element:
    1. you enter the overlay edition with left click or with "ENTER" and modify the textual contents,
    2. you press 'ENTER' to quit overlay edition (or click outside the overlay editor).

Select, Move and delete elements

-- To select elements, you can double-click on them, or press CTRL and click on one element. The selected elements appear with a blue background, or a gray background if they are of different types. See the picture below.

RodinEditor UserGuide step11.png

-- To unselect element, by default, press ESC.

-- To move elements, try both:

  • Move Up and Move Down commands in the context menu, once elements are selected,
  • Drag and drop on the selection.

-- To delete elements, try both:

  • Use the 'Delete' command on a selection from the context menu,
  • Press the DEL or SUPPR key after selecting the elements you want to delete.

Using keyboard shorcuts

Here is the list of the currently key bindings which are set by default and specific to the Rodin Editor.


KEY SEQUENCE ACTION
BACKSPACE (ENTER) Enter the edition mode using the overlay editor if the caret is on an editable place.
DEL Suppress the element after the caret position
ALT+T Add a sibling of the element pointed by the caret position. The sibling is placed just after this latter one.
ALT+G Opens a popup to select the element type of the child to add to the element pointed by the caret position. Note that if there is only one child type, the child will be directly created.
CTRL+BACKSPACE Insert a new carriage return while editing with the overlay editor.
ALT+ARROW_UP Move up the selected elements.
ALT+ARROW_DOWN Move down the selected elements.
SHIFT+ARROW_UP Select elements up.
SHIFT+ARROW_DOWN Select elements down.
ESC Quit the current overlay edition (if any) and forget the modifications made, frees the current selection.
TAB Go to the next editable place (i.e. to the next editable element attribute)
SHIFT+TAB Go to the previous editable place (i.e. to the next editable element attribute)

Customize these shortcuts

If you don't like these shortcuts, you can modify them by setting your own key preferences. To do so, go to Window > Preferences and then General > Key. A table appears were you can find and edit the shortcuts.