Difference between pages "Event-B to SMT-LIB" and "Extending the Rodin Event-B Explorer (How to extend Rodin Tutorial)"

From Event-B
(Difference between pages)
Jump to navigationJump to search
imported>Pascal
 
imported>Tommy
m (New page: {{Navigation|Previous= Extending_the_Rodin_Structured_Editor_(How_to_extend_Rodin_Tutorial) | Up= How to extend Rodin Tutorial (Index) | Next= }} === In this part...)
 
Line 1: Line 1:
{{TOCright}}
+
{{Navigation|Previous= [[Extending_the_Rodin_Structured_Editor_(How_to_extend_Rodin_Tutorial)]] | Up= [[Plug-in_Tutorial|How to extend Rodin Tutorial (Index)]] | Next= }}
  
== Introduction ==
+
=== In this part ===
The Event-B to [[#ancre_3|SMT-LIB]] plug-in allows to translate mathematical lemmas that rely on the Event-B language to the SMT-LIB format.
 
  
The considered lemmas are those often encountered in practice, but not yet well supported by proving
+
We will continue our work on the UI integration of our plug-in and extend the Event-B Explorer view. This view provides a view of the structure of Event-B projects, represented as a tree. As we introduced a new element "''Bound''", we want it to appear in this view as any other machine element such as ''variables'' or ''invariants''.
tools such as those embedded in the Rodin platform. The purpose is not here to entirely define the translation, but rather to give a mapping for this subset of Event-B formulas. These typical mathematical problems are entry points for the [[#ancre_1|DECERT]] project, and more precisely for the Work Package 1. Using the SMT-LIB standard is among the requirements for this project.
+
The Event-B Explorer uses the Common Navigator Framework (extension point <tt>org.eclipse.ui.navigator</tt>), thus we will not use a Rodin extension point but directly eclipse extension points.
  
This version mainly focuses on lemmas based on unquantified integer linear arithmetic.
+
''What we want to get :''
 +
We want our bound element to appear in the Event-B Explorer view as a direct child (as there will be only one bound element per machine), as described in the picture below:
  
== Specification ==
+
[[Image:Extend_Rodin_Tuto_1_9_Bound_in_EventB_Explorer.png]]
A first [[#ancre_2|specification draft]] has been written.
 
  
== Implementation ==
+
First we will create Bound element contents to fill the navigator view with, and then we will bind those contents to the navigator view.
A first plug-in prototype is accessible under the following respositories:
 
* <tt>_exploratory/carinepascal/fr.systerel.decert</tt>
 
* <tt>_exploratory/carinepascal/fr.systerel.decert.tests</tt>
 
  
The following theories are currently supported: Linear Arithmetic, Linear Order and Integer. The lemmas referencing other theories will not be translated.
+
=== Step 1 ===
  
== How to perform the translation? ==
+
Add a dependency to the package <tt>org.eclipse.ui.navigator</tt>.<br>
 +
Add the extension point <tt>org.eclipse.ui.navigator.navigatorContent</tt>.
  
The XML files containing the Event-B lemmas are assumed to be stored in the <tt>Lemmas</tt> folder. The SMT files containing the SMT-LIB benchmarks are assumed to be stored in the <tt>Benchmarks</tt> folder.
+
=== Step2 ===
 +
Add a new <tt>navigatorContent</tt> extension using the newly added extension point <tt>org.eclipse.ui.navigator.navigatorContent</tt>.
 +
In a first time, we will add 2 clause expressions to the <tt>navigatorContent</tt> extension to explain in which context this content shall be displayed and what to display (''item A''). In a second time, we will give contents to this extension (''item B''). The two clauses expressions we will use from <tt>navigatorContent</tt> extension are :
 +
:- ''triggerPoints''. The <tt>triggerPoints</tt> expression defines the nodes to be used when resolving the Common Navigator content provider's <tt>getElements()</tt> or <tt>getChildren()</tt>. This is also used to select the extension for providing labels, images, descriptions and for sorting.
  
Follow the following steps in order to translate Event-B lemmas to SMT-LIB benchmarks:
+
:- ''possibleChildren''. The <tt>possibleChildren</tt> expression defines the node to be used when resolving the Common Navigator content provider's <tt>getParent()</tt>. It is also used to help determine the parent when handling drop operations.
<ol>
 
<li> Launch the <tt>fr.systerel.decert.tests.TypeCheckingTests</tt> JUnit test to type-check the lemmas (optional).
 
Note that it is previously necessary to set the <tt>XMLFolder</tt> field of the <tt>TypeCheckingTests</tt> class to specify the absolute path of the <tt>Lemmas</tt> folder.
 
  
<li> Launch the <tt>fr.systerel.decert.tests.smt.TranslationTests</tt> JUnit test to translate the lemmas (mandatory).
+
''(A)'' First, add a clause ''triggerPoints'' to the <tt>navigatorContent</tt> extension, and add
Note that it is necessary to previously configure the test:
 
* The <tt>XMLFolder</tt> field shall contain the absolute path of the <tt>Lemmas</tt> folder.
 
* The <tt>SMTFolder</tt> field shall contain the absolute path of the <tt>Benchmarks</tt> folder.
 
* If the format of the generated SMT files is to be checked, the <tt>CHECK_FORMAT</tt> option shall be set and the <tt>SMTParserFolder</tt> field shall contain the absolute path of the directory where is installed the SMT-LIB parser. Otherwise, the option shall be turned off. The SMT-LIB parser is available from the [http://goedel.cs.uiowa.edu/smtlib SMT-LIB web page].
 
* If the generated benchmarks are to be checked for satisfiability, the <tt>CHECK_SAT</tt> option shall be set and the <tt>SMTSolverFolder</tt> field shall contain the absolute path of the directory where is installed the Z3 SMT solver. Otherwise, the option shall be turned off. The Z3 SMT solver is available from the [http://research.microsoft.com/en-us/um/redmond/projects/z3 following address].
 
</ol>
 
  
== Bibliography ==
 
* <font id="ancre_1">DECERT</font>, [http://decert.gforge.inria.fr/index.html ''DEduction and CERTification'']
 
* C. Pascal, [http://wiki.event-b.org/images/B2SMTLIB.pdf <font id="ancre_2">''From Event-B lemmas to SMT-LIB benchmarks''</font>], May 2009.
 
* S. Ranise and C. Tinelli, [http://goedel.cs.uiowa.edu/smtlib/papers/format-v1.2-r06.08.30.pdf <font id="ancre_3">''The SMT-LIB standard''</font>], Version 1.2, 2006, 2006.
 
  
[[Category:Design]]
+
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
{{Navigation|Previous= [[Extending_the_Rodin_Structured_Editor_(How_to_extend_Rodin_Tutorial)]] | Up= [[Plug-in_Tutorial|How to extend Rodin Tutorial (Index)]] | Next= }}
 +
 
 +
 
 +
[[Category:Developer documentation|*Index]]
 +
[[Category:Rodin Platform|*Index]]
 +
[[Category:Tutorial|*Index]]

Revision as of 10:35, 23 August 2010

In this part

We will continue our work on the UI integration of our plug-in and extend the Event-B Explorer view. This view provides a view of the structure of Event-B projects, represented as a tree. As we introduced a new element "Bound", we want it to appear in this view as any other machine element such as variables or invariants. The Event-B Explorer uses the Common Navigator Framework (extension point org.eclipse.ui.navigator), thus we will not use a Rodin extension point but directly eclipse extension points.

What we want to get : We want our bound element to appear in the Event-B Explorer view as a direct child (as there will be only one bound element per machine), as described in the picture below:

Extend Rodin Tuto 1 9 Bound in EventB Explorer.png

First we will create Bound element contents to fill the navigator view with, and then we will bind those contents to the navigator view.

Step 1

Add a dependency to the package org.eclipse.ui.navigator.
Add the extension point org.eclipse.ui.navigator.navigatorContent.

Step2

Add a new navigatorContent extension using the newly added extension point org.eclipse.ui.navigator.navigatorContent. In a first time, we will add 2 clause expressions to the navigatorContent extension to explain in which context this content shall be displayed and what to display (item A). In a second time, we will give contents to this extension (item B). The two clauses expressions we will use from navigatorContent extension are :

- triggerPoints. The triggerPoints expression defines the nodes to be used when resolving the Common Navigator content provider's getElements() or getChildren(). This is also used to select the extension for providing labels, images, descriptions and for sorting.
- possibleChildren. The possibleChildren expression defines the node to be used when resolving the Common Navigator content provider's getParent(). It is also used to help determine the parent when handling drop operations.

(A) First, add a clause triggerPoints to the navigatorContent extension, and add