Difference between pages "ADVANCE D3.2 General Platform Maintenance" and "The Proving Perspective (Rodin User Manual)"

From Event-B
(Difference between pages)
Jump to navigationJump to search
imported>Tommy
 
imported>Wohuai
m
 
Line 1: Line 1:
This part concerns the general maintenance performed on the Rodin toolset within the first ten months of the ADVANCE project. As the maintenance is a task that concerns the whole toolset, and to ease the reading of this part of the deliverable, the maintenance section has been decomposed in a list of subsections corresponding to scopes of the toolset. These sections are: core Rodin platform, UML-B improvements, code generation, ProR and Camille. All these subsections maintain the template previously defined in the introduction.
+
{{Navigation|Previous= [[The_Event-B_Explorer_(Rodin_User_Manual)|The Event-B Explorer]]|Next= [[The_Mathematical_Language_(Rodin_User_Manual)|The Mathematical Language]]|Up= [[index_(Rodin_User_Manual)|User_Manual_index]]}}
 +
{{TOCright}}
  
= Core Rodin platform =
+
The Proving Perspective is made of a number of windows: the proof tree, the goal, the selected hypotheses, the proof control, the proof information, and the searched hypotheses. In subsequent sections, we study these windows, but before that let us see how one can load a proof.
  
== Overview ==
+
== Loading a Proof ==
The Rodin platform versions concerned by this deliverable are:
 
* 2.4 (released on 31.01.2012),
 
* 2.5 (released on 02.05.2012),
 
* 2.6 (released on 31.07.2012).
 
  
The core Rodin platform maintenance task focused on fixing the identified bugs and mitigating usability issues. During DEPLOY, many features and contributions were added to the toolset as users wishes and requests were collected along. At the same time, the Event-B models and proof got bigger and bigger, in the same way as the experience of the users involved constantly increased ergo the size of the systems they modelled. Scalability issues occured at some point when feature addition was favoured to design refactorings.  As the DEPLOY project was nearing its end, it appeared mandatory for the development team, to address the specific bugs and issues reported by the DEPLOY partners and related to scalability or usability, and wished resolved by the end of the project. The various tasks to be performed were scheduled, prioritized and regularly updated during bi-weekly teleconferences.
+
In order to load a proof, enter the Proof Obligation window, select the project, select and expand the component, finally select the proof obligation: the corresponding proof will be loaded. As a consequence:
  
The following paragraphs will give an overview of the the work that has been performed concerning maintenance on the existing platform components (i.e. core platform and plug-ins).
+
* the proof tree is loaded in the Proof Tree window. As we shall see in section [[The_Proving_Perspective_(Rodin_User_Manual)#The_Proof_Tree|6.2]], each node of the proof tree is associated with a sequent.
Release Notes<ref name="relNotes">http://wiki.event-b.org/index.php/Rodin_Platform_Releases</ref> and the SourceForge trackers<ref>http://sourceforge.net/projects/rodin-b-sharp/</ref> (bugs and feature requests) are available for more details about the previous and upcoming releases of the Rodin platform.
+
* In case the proof tree has some "pending" nodes (whose sequents are not discharged yet) then the sequent corresponding to the first pending node is decomposed: its goal is loaded in the Goal window (section [[The_Proving_Perspective_(Rodin_User_Manual)#Goal and Selected Hypotheses|6.3]]), whereas parts of its hypotheses (the "selected" ones) are loaded in the Selected Hypotheses window (section [[The_Proving_Perspective_(Rodin_User_Manual)#Goal and Selected Hypotheses|6.3]]).
 +
* In case the proof tree has no pending node, then the sequent of the root node is loaded as explained previously.
  
== Motivations / Decisions ==
+
== The Proof Tree ==
'''Provide 64-bit versions of the Rodin platform on Linux and Windows systems'''<br>
 
End users asked the Rodin team to provide 32-bit and 64-bit versions of the Rodin platform for Linux and Windows operating systems. Before Rodin 2.4, the only 64-bit version of Rodin was available on Mac platforms as 32-bit Mac (early 2006) platforms are no longer maintained by Apple. The motivation that would push forward 64-bit architectures is the possibility to increase the available java heap size which is, for example, extensively used during the automated proof. After a phase of testing and despite the drawbacks of assembling and maintaining five platforms instead of three, Linux and Windows 64-bit as well as 32-bit platforms are now systematically made available since the Rodin 2.4 release.
 
  
'''The Rodin Editor and the Theory plug-in in the Rodin core platform'''<br>
+
=== Description of the Proof Tree ===
According to their role in the Rodin toolset, and their stabilization, the Rodin Editor,<ref>http://wiki.event-b.org/index.php/Rodin_Editor</ref> and later the Theory plug-in<ref>http://wiki.event-b.org/index.php/Theory_Plug-in</ref> were reintegrated into the core platform. The Rodin Editor was released in the core platform since Rodin 2.4, and the Theory plug-in is planned to be integrated in Rodin 2.7.
 
  
== Available Documentation ==
+
The proof tree can be seen in the corresponding window as shown in the following screen shot:
The release notes, that appear and are maintained on the wiki, and that accompany each release, give useful information about the Rodin platforms. Moreover, two web trackers list and detail the known bugs and open feature requests:
 
* a sourceforge bug tracker,<ref>http://sourceforge.net/tracker/?group_id=108850&atid=651669</ref>
 
* a sourceforge feature requests tracker.<ref>http://sourceforge.net/tracker/?group_id=108850&atid=651672</ref>
 
The Event-B wiki,<ref name="rodinWiki">http://wiki.event-b.org/</ref> basic source of documentation for the users and developers of the Rodin toolset, was completed by the Rodin handbook, an ultimate source of documentation which reached completion by the end of the DEPLOY project. The handbook aimed to overcome the lack of a centralized source of information providing the necessary assistance to an engineer in the need to be productive using Event-B and minimize the access to an expert user.  It is continuously maintained by the various actors involved in the environment of the Rodin toolset and is available as a PDF version, a HTML version, and help contents within Rodin. Both the Rodin handbook and the Event-B wiki represent the main source of documentation about Event-B and the Rodin toolset.
 
Finally, a channel has been created on Youtube, in order to provide video tutorials about the use of the platform.<ref>http://www.youtube.com/user/EventBTv</ref>
 
  
== Planning ==
+
[[Image:um-0095.png|center]]
Two platforms have been scheduled after Rodin 2.6 has been published: Rodin 2.7 followed by Rodin 3.0. Rodin 2.7 is intended to be released by the end of October 2012, and Rodin 3.0 will be available by the end of January 2013. Rodin 2.7 will be corrective. It has been scheduled to respect the 3 monthly release policy, as the Rodin 3.0 version will require more that 3 months of development. Indeed, this latter version of the platform is being prepared since Rodin 2.6, and will include lots of refactorings and evolutions in the published programming interfaces (API). Here is a non exhaustive list of the main improvements and refactorings that will be part of it:  
 
*Binders will be allowed in extensions.
 
*The platform will be based on Eclipse 4.
 
*The AST will be made stronger.
 
*The sequent prover will be enhanced.
 
*Parent-child element relationship extension points will be moved from the UI plug-in to the EventB core plug-in.
 
*The Event-B keyboard plug-in will be refactored to separate the UI code from the ASCII/Math translation mechanism.
 
*The statistics view will be refactored to handle other kinds of component files (currently just Contexts and Machines are supported).
 
  
= UML-B Improvements =
+
Each line in the proof tree corresponds to a node which is a sequent. A line is right shifted when the corresponding node is a direct descendant of the node of the previous line. Here is an illustration of the previous tree:
  
== Overview ==
+
[[Image:Tree.png|center]]
  
The UML-B plug-in and associated frameworks are developed and maintained by Dr Colin Snook at the University of Southampton. Significant contributions (to the latest version) have been made by Vitaly Savicks (State-machines) and Gintautas Sulskus (Class Diagrams). The UML-B plugin provides UML-like diagrammatic modelling as an extension to Event-B and the Rodin platform. UML-B is an established plug-in which will be developed and improved to support the aims of the ADVANCE project. UML-B was redeveloped during the DEPLOY project to provide closer integration with Event-B. A state-machine diagram editor is already released in this integrated version and a class diagram editor is now being developed as a prototype.
+
Each node is labelled with a comment explaining how it can be discharged. By selecting a node in the proof tree, the corresponding sequent is decomposed and loaded in the Goal and Selected Hypotheses windows as explained in section [[The_Proving_Perspective_(Rodin_User_Manual)#Loading a Proof|6.1]].
[[Image:Umlb_cap2.jpg|center|A UML-B state machine and its Event-B counterpart]]
 
Other improvements will include new diagrammatic notations which are directly related to the aims of ADVANCE, such as component diagrams, as well as more general improvements, such as usability, and any features required by the projects industrial partners.
 
  
== Motivations / Decisions ==
+
=== Decoration ===
  
The implementation of the UML-B tool is structured to provide re-usable features as much as possible. To achieve this, wherever possible, generic frameworks are developed and the implementation of specific diagram tools is minimised by utilising these frameworks. The following frameworks are now in use by UML-B and available as a basis for future diagrammatic modelling notations.
+
The leaves of the tree are decorated with three kinds of logos:
  
* The ''Event-B EMF framework'' provides an EMF basis for Event-B models (developed during the DEPLOY project). Indeed, it provides an EMF representation of Event-B models with persistence into the Rodin database.
+
* a green logo with a "<math>\surd </math>" in it means that this leaf is discharged,
* The ''Event-B EMF Support for Modelling Extensions framework'' provides support for extending Event-B with new modelling features (initially developed during the DEPLOY project and now being extended in the ADVANCE project). It provides Navigator support for EMF-only model elements, a persistence mechanism for model extensions that are not needed to be processed by Rodin and a Generic Refiner for modelling extensions (which has recently been added).
+
* a red logo with a "?" in it means that this leaf is not discharged,
* ''The Event-B GMF Diagrams Generic Support framework'' provides support for developing new diagram notations (started in the DEPLOY project but mostly developed during the ADVANCE project). It provides generic support for diagrammatic aspects of modelling extensions, and a generic validation and Event-B generation service (which has recently been added).
+
* a blue logo with a "R" in it means that this leaf has been reviewed.
 
A new release of the State-machine diagram editor has been made. This release corrected some problems and improved use of the generic framework features.
 
  
Work is in progress on a new version of the UML-B Class Diagram editor. This takes the same approach as the State-machines editor in that the models are contained within Machines (and, in this case, also Contexts) and that diagrammatic model features link to and enhance existing Event-B elements rather than generate everything. The Class diagram editor is currently a prototype and has not been released.
+
Internal nodes in the proof tree are decorated in the same (but lighter) way. Note that a "reviewed" leaf is one that is not discharged yet by the prover. Instead, it has been "seen" by the user who decided to have it discharged later. Marking nodes as "reviewed" is very convenient in order to perform an interactive proof in a gradual fashion. In order to discharge a "reviewed" node, select it and prune the tree at that node (section [[The_Proving_Perspective_(Rodin_User_Manual)#Pruning|6.2.5]]): the node will become "red" again (undischarged) and you can now try to discharge it.
  
== Available Documentation ==
+
=== Navigation within the Proof Tree ===
  
A paper exists about the framework for diagrammatic modelling extension in Rodin:
+
On top of the proof tree window one can see three buttons:
Savicks, Vitaly, Snook, Colin (2012) ''A Framework for Diagrammatic Modelling Extensions in Rodin'' in Rodin User & Developer Workshop 2012 Proceedings. Newcastle University. (Unpublished) <ref>http://deploy-eprints.ecs.soton.ac.uk/382/</ref>
 
  
Wiki pages are available for developers using the Generic extensions and Diagrams frameworks:<br>
+
* the "G" buttons allows you to see the goal of the sequent corresponding to the node
http://wiki.event-b.org/index.php/EMF_framework_for_Event-B<br>
+
* the "+" button allows you to fully expand the proof tree
http://wiki.event-b.org/index.php/Generic_Event-B_EMF_extensions (Under Construction)
+
* the "-" allows you to fully collapse the tree: only the root stays visible.
  
A paper exists about the Event-B Statemachines:
+
=== Hiding ===
Savicks, Vitaly, Snook, Colin and Butler, Michael (2009) ''Animation of UML-B State-machines'' in Rodin User & Developer Workshop 2010 Proceedings. Düsseldorf University, 2010.<ref>http://eprints.soton.ac.uk/268261/</ref>
 
  
Wiki pages are available for users of UML-B, everything starts from http://wiki.event-b.org/index.php/UML-B<ref>http://wiki.event-b.org/index.php/UML-B</ref>
+
The little triangle next to each node in the proof tree allows you to expand or collapse the subtree starting at that node.
  
== Planning ==
+
=== Pruning ===
  
The following work is planned:
+
The proof tree can be pruned from a node: it means that the subtree starting at that node is eliminated. The node in question becomes a leaf and is red decorated. This allows you to resume the proof from that node. After selecting a sequent in the proof tree, pruning can be performed in two ways:
* Re-base the Event-B EMF framework on the EMF model of the Rodin database (which is now available as a result of the development of a new Rodin editor to replace the form based editor).
 
* Re-write the Event-B generator of the State-machine diagram editor so that it uses the generic generator from the Event-B GMF Support for Generic Diagrams framework. This will improve performance.
 
* Improve the State-machine diagram animation interface so that it supports animation of multiple diagrams.
 
* Complete the development of the new version of the UML-B Class Diagram editor.
 
* Develop Animation interface for the Class diagram editor.
 
* Develop a Component diagram editor and associated simulation tools.
 
  
= Code generation =
+
* by right-clicking and then selecting "Prune",
 +
* by pressing the "Scissors" button in the proof control window (section [[The_Proving_Perspective_(Rodin_User_Manual)#The Proof Control Window|6.4]]).
  
== Overview ==
+
Note that after pruning, the post-tactic (section [[The_Proving_Perspective_(Rodin_User_Manual)#The Automatic Post-tactic|6.8]]) is not applied to the new current sequent: if needed you have to press the "post-tactic" button in the Proof Control window (section [[The_Proving_Perspective_(Rodin_User_Manual)#The Proof Control Window|6.4]]). This happens in particular when you want to redo a proof from the beginning: you prune the proof tree from the root node and then you have to press the "post-tactic" button in order to be in exactly the same situation as the one delivered automatically initially.
We released the latest Code Generation Feature on 30th May 2012.
 
New features include code generation from state-machine diagrams.
 
  
== Motivations / Decisions ==
+
When you want to redo a proof from a certain node, it might be advisable to do it after copying the tree so that in case your new proof fails you can still resume the previous situation by pasting the copied version (see next section).
State machines are frequently used to describe the behaviour of embedded systems. It is a relatively new feature in Event-B, and we augment the tool with the ability to generate code from state-machine diagrams in version 0.2.3 of the code generation feature plug-in. Implementation code is generated from the diagram itself, and no additional mark-up of the model is required; that is, nothing over and above the usual mark-up required for Tasking Event-B, such as identifying non-typing/typing invariants, and guards etc. State-machines are created, using the existing state-machine plug-in, subject to the limitations described after.
 
  
The current code generation tool is restricted to generating code for a single Event-B machine, which may contain one or more state-machines. We have yet to explore the decomposition/composition of machines containing state-machines. In principal we should be able to apply decomposition techniques to decompose the single Event-B machine with state-machines into a number of machines, with the state-machines, or the elements of state-machines, distributed between them.
+
=== Copy/Paste ===
Another limitation is that we do not handle nested state-machines, although this should be feasible.
 
Only the state-machines of tasking/environ machines generate code. State-machines of shared machines do not generate code. This should be explored further during research into decomposition.
 
  
The translation of the diagrammatic elements to code has been hard-coded in the code generation plug-in. We have introduced new types to the translator's common language model (IL1). We add case-statements, and a container for them (analogous to switch) since these are commonly used to implement state-machines. The code generator navigates through each state of a state-machine, generating an internal representation of the state-machine, which is used to create the IL1 model. The IL1 model is then used to generate code for the various target languages that may have been implemented. We have also updated the IL1-to-target code generators, to generate case/switch statements in Ada, C and Java.
+
By selecting a node in the proof tree and then clicking on the right key of the mouse, you can copy the part of the proof tree starting at that sequent: it can later be pasted in the same way. This allows you to reuse part of a proof tree in the same (or even another) proof.
Each state-machine has an Enumerated type whose elements take the names of the states. A state variable is created in the target that keeps track of the current state, and has the type of the enumeration.
 
  
== Available Documentation ==
+
== Goal and Selected Hypotheses ==
A specific page on the Event-B wiki<ref>http://wiki.event-b.org/index.php/Code_Generation_Activity</ref> is dedicated to Code Generation Updates.
 
  
== Planning ==
+
The "Goal" and "Selected Hypotheses" windows display the current sequent you have to prove at a given moment in the proof. Here is an example:
Efforts will focus on extending the existing code generation approach, and developing new techniques, for the simulation of cyber-physical systems.
 
  
= ProR =
+
[[Image:um-0098.png|center]]
  
== Overview ==
+
A selected hypothesis can be deselected by first clicking in the box situated next to it (you can click on several boxes) and then by pressing the red (-) button at the top of the selected hypothesis window:
  
The Rodin/ProR integration plugin is developed and maintained by Lukas Ladenberger and Michael Jastram at the University of Duesseldorf. ProR is a tool for working with requirements in natural language. It is part of the Eclipse Requirements Modeling Framework (RMF).<ref>http://www.eclipse.org/rmf/</ref>
+
[[Image:um-0099.png|center]]
  
The following paragraphs will give an overview of the the work that has been performed concerning maintenance on the Rodin/ProR plugin.
+
Here is the result:
  
== Motivations / Decisions ==
+
[[Image:um-0100.png|center]]
  
The motivation of the Rodin/ProR integration plugin was to bring two complimentary fields of research, requirements engineering and formal modelling, closer together. Especially, the traceability within a system description is a challenging problem of requirements engineering. In particular, formal models of the system are often based on informal requirements, but creating and maintaining the traceability between the two can be challenging. In ''A Method and Tool for Tracing Requirements into Specifications''<ref name="req1ref">http://www.stups.uni-duesseldorf.de/w/Special:Publication/HalJasLad2012</ref>, we presented an incremental approach for producing a system description from an initial set of requirements. The foundation of the approach is a classification of requirements into artefacts W (domain properties), R (requirements) and S (specification). In addition, the approach uses designated phenomena as the vocabulary employed by the artefacts. The central idea is that adequacy of the system description must be justified, meaning that W ∧ S ⇒ R. The approach establishes a traceability, and the resulting system description may consist of formal and informal artefacts. We created tool support for this approach by integrating Rodin and ProR. We designed it with the goal to support the approach described in <ref name="req1ref"/>, and to ease the integration of natural language requirements and Event-B.
+
Notice that the deselected hypotheses are not lost: you can get them back by means of the Searched Hypotheses window (section [[The_Proving_Perspective_(Rodin_User_Manual)#srchhyp|6.7]]).
  
== Available Documentation ==
+
The three other buttons next to the red (-) button allow you to do the reverse operation, namely keeping some hypotheses. The (ct) button next to the goal allows you to do a proof by contradiction: pressing it makes the negation of the goal being a selected hypothesis whereas the goal becomes "false". The (ct) button next to a selected hypothesis allows you to do another kind of proof by contradiction: pressing it makes the negation of the hypothesis the goal whereas the negated goal becomes an hypothesis.
  
* ''A Method and Tool for Tracing Requirements into Specifications''.<ref name="req1ref"/> The paper has been submitted to Science of Computer Programming.
+
== Rewrite Rules ==
* ''Requirements Traceability between Textual Requirements and Formal Models Using ProR''.<ref>http://www.stups.uni-duesseldorf.de/w/Special:Publication/LadenbergerJastram_iFMABZ2012</ref> The paper has been accepted for iFM'2012 & ABZ'2012.
 
  
* A Tutorial for the Rodin/ProR integration<ref>http://wiki.event-b.org/index.php/ProR</ref> can be found on the Event-B wiki.
+
Rewrite rules are applied either automatically (A) or manually (M).
* The User Guide<ref>http://wiki.eclipse.org/RMF/User_Guide</ref> is available on the Event-B wiki and contains an additional tutorials for ProR.
 
  
== Planning ==
+
A rule may be applied:
 +
* Automatically (A), when post tactics are enabled. These rules are equivalence simplification laws.
 +
* Manually (M), through an interactive command. These rules gathers non equivalence laws, definition laws, distributivity laws and derived laws.
  
There are still some limitations on the ProR/Rodin integration plugin, however. While all required data structures exist, the plugin would benefit from more sophisticated reporting. In particular, <ref name="req1ref"/> lists a number of properties of a correct system description. While the presence of these properties does not guarantee correctness, their absence indicates a problem. This is already done, to a degree, through the colour highlighting, but a reporting tool that lists all violations of those properties would be valuable and is planned.
+
Rewrite rules are applied from left to right either in the goal or in the selected hypotheses, when their ''side condition'' hold.
  
Currently, each used artifact is identified as belonging to one of the following class: domain properties, requirement items, specification elements, implementation elements and design decisions. This in turn determine the different kinds of phenomena that are allowed to be used by the artefact. For the moment, the plugin does not support such phenomena classification. In a next step, we will work on a concept for classifying and maintaining phenomena with ProR.
+
Each rule is named after the following elements:
  
= Camille =
+
* The law category: simplification law (SIMP), definition law (DEF), distributivity law (DISTRI), or else derived law (DERIV).
 +
* Particularity on terminal elements of the left part of the rule (optional): special element (SPECIAL) such as the empty-set, type expression (TYPE), same element occurring more then once (MULTI), literal (LIT). A type expression is either a basic type (<math>\intg, \Bool</math>, any carrier set), or <math>\pow</math>(type expression), or type expression<math>\cprod</math>type expression.
 +
* One or more elements describing from top to down the left part of the rule, eg. predicate AND, expression BUNION.
 +
* Detail to localize those elements (optional): left (L), right (R).
  
== Overview ==
+
Rewrite rules having an equivalence operator in their left part may also describe other rules. eg: the rule:
The Camille plug-in provides a textual editor for Rodin.
 
Though such a text editor is prefered by many users, Camille currently has the drawback of not supporting extensibility.
 
It only supports the core Event-B language and plug-in-specific additions are simply ignored. Such extensions can not be edited through Camille.
 
Consequently, users have to switch back to Rodin's native Editor to edit plug-in-specific modelling extensions.
 
This has become a major issue during the last years, since many plug-ins have been developed in the meantime that are widely used by many users.
 
  
This issue is currently being adressed by Ingo Weigelt at the University of Duesseldorf.
+
<math>  \True  = \False  \;\;\defi\;\;  \bfalse </math>
  
== Motivations / Decisions ==
+
should also produce the rule:
A new version of Camille will be implemented during the ADVANCE project to enable users to edit extended Event-B models solely through a text editor.
 
To plan the new version, the problem and a number of possible solutions have been analysed and related in a technical report<ref name="Architectures_for_an_Extensible_Text_Editor_for_Rodin">http://www.stups.uni-duesseldorf.de/mediawiki/images/0/0a/Pub-Weigelt2012.pdf</ref> from Ingo Weigelt.
 
The results of this work have been dicussed in the Rodin community and one of the proposed solution (a blockparser) has been selected to be implemented during the next months.
 
The dedicated solution promises to provide Camille extensibility with minimal extra workload required from plug-in developers while still being very flexible regarding future, yet unknown, requirements.
 
  
== Available Documentation ==
+
<math>  \False  = \True  \;\;\defi\;\;  \bfalse </math>
  
* ''Architectures for an Extensible Text Editor for Rodin''.<ref name="Architectures_for_an_Extensible_Text_Editor_for_Rodin"/> Bachelor thesis analysing the problem and discussing possible solutions.
 
* An earlier version of the thesis has been published as a technical report<ref>http://www.stups.uni-duesseldorf.de/w/Special:Publication/Weigelt2012></ref> that has been discussed on the Roding Developers Mailing List and the ADVANCE Progress Meeting in May 2012 in Paris.
 
  
== Planning ==
+
For associative operators in connection with distributive laws as in:
The new Camille version will be implemented at the University of Duesseldorf during 2012. The final version is expected in January or February 2013.
 
  
= References =
+
<center><math> P \land (Q \lor \ldots \lor R) </math></center>
<references/>
 
  
[[Category:ADVANCE D3.2 Deliverable]]
+
it has been decided to put the "button" on the first associative/commutative operator (here <math>\lor </math>). Pressing that button will generate a menu: the first option of this menu will be to distribute all associative/commutative operators, the second option will be to distribute only the first associative/commutative operator. In the following presentation, to simplify matters, we write associative/commutative operators with two parameters only, but it must always be understood implicitly that we have a sequence of them. For instance, we shall never write <math> Q \lor \ldots \lor R </math> but <math> Q \lor R </math> instead. Rules are sorted according to their purpose.
 +
 
 +
Rules marked with a star in the first column are implemented in the current prover.  Rules without a star are planned for implementation.
 +
 
 +
Rewrite rules are split into:
 +
 
 +
* [[Set Rewrite Rules]]
 +
* [[Relation Rewrite Rules]]
 +
* [[Arithmetic Rewrite Rules]]
 +
 
 +
They are also available in a single large page [[All Rewrite Rules]].
 +
 
 +
== Inference Rules ==
 +
 
 +
Inference rules are applied either automatically (A) or manually (M).
 +
 
 +
Inference rules applied automatically are applied at the end of each proof step when the post-tactic is enabled. They have the following possible effects:
 +
 
 +
* they discharge the goal,
 +
* they simplify the goal and add a selected hypothesis,
 +
* they simplify the goal by decomposing it into several simpler goals,
 +
* they simplify a selected hypothesis,
 +
* they simplify a selected hypothesis by decomposing it into several simpler selected hypotheses.
 +
 
 +
Inference rules applied manually are used to perform an interactive proof. They can be invoked by pressing "buttons" which corresponds to emphasized (red) operators in the goal or the hypotheses. A menu is proposed when there are several options.
 +
 
 +
See the [[Inference Rules]] list.
 +
 
 +
== The Proof Control Window ==
 +
 
 +
The Proof Control window contains the buttons which you can use to perform an interactive proof. Next is a screen shot where you can see successively from top to bottom:
 +
 
 +
* some selected hypotheses,
 +
* the goal,
 +
* the "Proof Control" window,
 +
* a small editing area within which you can enter parameters used by some buttons of the Proof Control window
 +
* the smiley (section [[The_Proving_Perspective_(Rodin_User_Manual)#The Simley|6.5]])
 +
 
 +
[[Image:um-0101.png|center]]
 +
 
 +
The Proof Control window offers a number of buttons which we succinctly describe from left to right:
 +
 
 +
* (p0): the prover PP attempts to prove the goal (other cases in the list)
 +
* (R) review: In an attempt by the user to carry out proofs in a gradual fashion, they might decide to postpone the task of discharging some interactive proofs for a later stage.  In this case they have the possibility to mark these proofs as reviewed (by choosing the proof node and pressing the blue button with a “R” letter on the top-left corner of the Proof Control view).  This means that by visually checking this proof, the user convinced that they can discharge it later but they do not want to do it right now.
 +
* (dc) proof by cases: the goal is proved first under the predicate written in the editing area and then under its negation,
 +
* (ah) lemma: the predicate in the editing area is proved and then added as a new selected hypothesis,
 +
* (ae) abstract expression: the expression in the editing area is given a fresh name,
 +
* the auto-prover attempts to discharge the goal. The auto-prover is the one which is applied automatically on all proof obligations (as generated automatically by the proof obligation generator after a "save") without any intervention of the user. With this button, you can call yourself the auto-prover within an interactive proof.
 +
* the post-tactic is executed (see section [[The_Proving_Perspective_(Rodin_User_Manual)#The Automatic Post-tactic|6.8]]),
 +
* lasso: load in the Selected Hypotheses window those unseen hypotheses containing identifiers which are common with identifiers in the goal and selected hypotheses,
 +
* backtrack form the current node (i.e., prune its parent),
 +
* scissors: prune the proof tree from the node selected in the proof tree,
 +
* show (in the Search Hypotheses window) hypotheses containing the character string as in the editing area,
 +
* '''Cache Hypotheses Button''': By pressing ''"Cache Hypotheses"'' button the tool displays the ''"Cache Hypotheses"'' view. This view displays all hypotheses that are related to the current goal. Some of these hypotheses might not been chosen as current active hypotheses (this is the set of hypotheses that considered by the prover to discharge the current goal). By opening the cached hypotheses view the user can manually select and add some of them to the current active hypotheses view.
 +
* load the previous non-discharged proof obligation,
 +
* load the next undischarged proof obligation,
 +
* (i) show information corresponding to the current proof obligation in the corresponding window. This information correspond to the elements that took directly part in the proof obligation generation (events, invariant, etc.),
 +
* goto the next pending node of the current proof tree,
 +
* load the next reviewed node of the current proof tree.
 +
 
 +
== The Smiley ==
 +
 
 +
The smiley can take three different colors: (1) red, meaning that the proof tree contains one or more non-discharged sequents, (2) blue, meaning that all non-discharged sequents of the proof tree have been reviewed, (3) green, meaning that all sequents of the proof tree are discharged.
 +
 
 +
== The Operator "Buttons" ==
 +
 
 +
In the goal and in the selected, searched, or cache hypotheses some operators are colored in red. It means that they are "buttons" you can press. When doing so, the meaning (sometimes several) is shown in a menu where you can select various options. The operation performed by these options is described in sections [[The_Proving_Perspective_(Rodin_User_Manual)#Interactive Rewrite Rules|6.9.1]] and [[The_Proving_Perspective_(Rodin_User_Manual)#Interactive Inference Rules|6.9.2]].
 +
 
 +
== The Search Hypotheses Window ==
 +
 
 +
By typing a string in the '''Proof Control''' window and pressing the '''Search Hypotheses''' button a window is provided which contains the hypotheses having a character string in common with the one entered by the user in the editing area. For example, if we search for hypotheses involving the character string "cr", then after pressing the '''Search Hypothesis''' button on the proof control window, we obtain the following:
 +
 
 +
[[Image:um-0102.png|center]]
 +
 
 +
This view also integrates a "quick search" area (A), that allows us to search quickly hypothesis involving short character strings such as "cr". A '''search hypothesis button (B)''' that behaves the same as the button of the proving window, a '''refresh button (C)''' that updates the window manually for more control, and a '''drop down menu (D)''' to set the preferences of the view up.
 +
 
 +
By pressing '''return''' key or the button (B) (once a short string has been given in the input area (A)), hypotheses can be searched quickly as if we used the '''Proof Control''' as described before.
 +
 
 +
The drop down menu (D) is accessible to set some preferences over the searched hypotheses :
 +
 
 +
[[Image:SearchHyp_view_menu.png|center]]
 +
 
 +
If we change preferences for the search, we might need to "update" manually the view with the button (C).
 +
By selecting "Consider hidden hypotheses in search" option, we can review all hypotheses that have been unselected in the selected hypotheses window(more info about[[Rodin_Proving_Perspective#Goal and Selected Hypotheses| selected/hidden hypotheses]]...).
 +
 
 +
In the next step any of these hypotheses can be selected and then by pressing the '''(+)button''' they will be moved to the '''Selected Hypotheses''' window . Adding these hypotheses to the set '''Selected Hypotheses''' means that they will be visible to the prover. This means that they can be used during the next interactive proof phase. Accordingly by selecting any numbers of hypotheses and pressing the '''(-)button''' they will be removed from the '''Search Hypotheses''' window. The '''(-)button''' also appears above the selected hypotheses, and allow the user to remove any hypothesis form the '''Selected Hypotheses''' window. The other button which is situated in the left-hand-side of all hypotheses is the '''(ct) Button'''. By pressing the '''(ct) Button''' the negation of the corresponding hypothesis is taken as a new hypothesis. For this purpose we have to prove it first and therefore it appears as a new goal which the user must discharge it first and then proceed with the previous goal.
 +
 
 +
== The Automatic Post-tactic ==
 +
 
 +
In this section, we present the various rewrite or inference rules which are applied automatically as a systematic post-tactic after each proof step. Note that the post-tactic can be disabled by using the "'''P'''<math>\! \! \! \! /</math>" button situated on the right of the proof control window.
 +
 
 +
The post-tactic is made of two different rules: rewrite rules, which are applied on any sub-formula of the goal or selected hypotheses (section [[The_Proving_Perspective_(Rodin_User_Manual)#Rewrite Rules|6.8.1]]) and inference rules which are applied on the current sequent (section [[The_Proving_Perspective_(Rodin_User_Manual)#Automatic Inference Rules|6.8.2]]).
 +
 
 +
 
 +
 
 +
 
 +
 
 +
=== Preferences for the Post-tactic ===
 +
 
 +
The post-tactic can be configured by means of a preference page which can be obtained as follows: press the "Window" button on the top tooolbar. On the coming menu, press the "Preferences" button. On the coming menu, press the "Event-B" menue, then the "Sequent Prover’, and finally the "Post-Tactic" button. This yilds the following window:
 +
 
 +
[[Image:um-0147.png|center]]
 +
 
 +
In the left part you can see the ordered sequence of individual tactics composing the post-tactic, whereas the right part contains further tactics you can incorporate in the left part. By selecting a tactic you can move it from on part to the other or change the order in the left part.
 +
 
 +
 
 +
[[Category:User documentation|The Proving Perspective]]
 +
[[Category:Rodin Platform|The Proving Perspective]]
 +
[[Category:User manual|The Proving Perspective]]

Revision as of 12:15, 30 August 2010

The Proving Perspective is made of a number of windows: the proof tree, the goal, the selected hypotheses, the proof control, the proof information, and the searched hypotheses. In subsequent sections, we study these windows, but before that let us see how one can load a proof.

Loading a Proof

In order to load a proof, enter the Proof Obligation window, select the project, select and expand the component, finally select the proof obligation: the corresponding proof will be loaded. As a consequence:

  • the proof tree is loaded in the Proof Tree window. As we shall see in section 6.2, each node of the proof tree is associated with a sequent.
  • In case the proof tree has some "pending" nodes (whose sequents are not discharged yet) then the sequent corresponding to the first pending node is decomposed: its goal is loaded in the Goal window (section 6.3), whereas parts of its hypotheses (the "selected" ones) are loaded in the Selected Hypotheses window (section 6.3).
  • In case the proof tree has no pending node, then the sequent of the root node is loaded as explained previously.

The Proof Tree

Description of the Proof Tree

The proof tree can be seen in the corresponding window as shown in the following screen shot:

Um-0095.png

Each line in the proof tree corresponds to a node which is a sequent. A line is right shifted when the corresponding node is a direct descendant of the node of the previous line. Here is an illustration of the previous tree:

Tree.png

Each node is labelled with a comment explaining how it can be discharged. By selecting a node in the proof tree, the corresponding sequent is decomposed and loaded in the Goal and Selected Hypotheses windows as explained in section 6.1.

Decoration

The leaves of the tree are decorated with three kinds of logos:

  • a green logo with a "\surd " in it means that this leaf is discharged,
  • a red logo with a "?" in it means that this leaf is not discharged,
  • a blue logo with a "R" in it means that this leaf has been reviewed.

Internal nodes in the proof tree are decorated in the same (but lighter) way. Note that a "reviewed" leaf is one that is not discharged yet by the prover. Instead, it has been "seen" by the user who decided to have it discharged later. Marking nodes as "reviewed" is very convenient in order to perform an interactive proof in a gradual fashion. In order to discharge a "reviewed" node, select it and prune the tree at that node (section 6.2.5): the node will become "red" again (undischarged) and you can now try to discharge it.

Navigation within the Proof Tree

On top of the proof tree window one can see three buttons:

  • the "G" buttons allows you to see the goal of the sequent corresponding to the node
  • the "+" button allows you to fully expand the proof tree
  • the "-" allows you to fully collapse the tree: only the root stays visible.

Hiding

The little triangle next to each node in the proof tree allows you to expand or collapse the subtree starting at that node.

Pruning

The proof tree can be pruned from a node: it means that the subtree starting at that node is eliminated. The node in question becomes a leaf and is red decorated. This allows you to resume the proof from that node. After selecting a sequent in the proof tree, pruning can be performed in two ways:

  • by right-clicking and then selecting "Prune",
  • by pressing the "Scissors" button in the proof control window (section 6.4).

Note that after pruning, the post-tactic (section 6.8) is not applied to the new current sequent: if needed you have to press the "post-tactic" button in the Proof Control window (section 6.4). This happens in particular when you want to redo a proof from the beginning: you prune the proof tree from the root node and then you have to press the "post-tactic" button in order to be in exactly the same situation as the one delivered automatically initially.

When you want to redo a proof from a certain node, it might be advisable to do it after copying the tree so that in case your new proof fails you can still resume the previous situation by pasting the copied version (see next section).

Copy/Paste

By selecting a node in the proof tree and then clicking on the right key of the mouse, you can copy the part of the proof tree starting at that sequent: it can later be pasted in the same way. This allows you to reuse part of a proof tree in the same (or even another) proof.

Goal and Selected Hypotheses

The "Goal" and "Selected Hypotheses" windows display the current sequent you have to prove at a given moment in the proof. Here is an example:

Um-0098.png

A selected hypothesis can be deselected by first clicking in the box situated next to it (you can click on several boxes) and then by pressing the red (-) button at the top of the selected hypothesis window:

Um-0099.png

Here is the result:

Um-0100.png

Notice that the deselected hypotheses are not lost: you can get them back by means of the Searched Hypotheses window (section 6.7).

The three other buttons next to the red (-) button allow you to do the reverse operation, namely keeping some hypotheses. The (ct) button next to the goal allows you to do a proof by contradiction: pressing it makes the negation of the goal being a selected hypothesis whereas the goal becomes "false". The (ct) button next to a selected hypothesis allows you to do another kind of proof by contradiction: pressing it makes the negation of the hypothesis the goal whereas the negated goal becomes an hypothesis.

Rewrite Rules

Rewrite rules are applied either automatically (A) or manually (M).

A rule may be applied:

  • Automatically (A), when post tactics are enabled. These rules are equivalence simplification laws.
  • Manually (M), through an interactive command. These rules gathers non equivalence laws, definition laws, distributivity laws and derived laws.

Rewrite rules are applied from left to right either in the goal or in the selected hypotheses, when their side condition hold.

Each rule is named after the following elements:

  • The law category: simplification law (SIMP), definition law (DEF), distributivity law (DISTRI), or else derived law (DERIV).
  • Particularity on terminal elements of the left part of the rule (optional): special element (SPECIAL) such as the empty-set, type expression (TYPE), same element occurring more then once (MULTI), literal (LIT). A type expression is either a basic type (\intg, \Bool, any carrier set), or \pow(type expression), or type expression\cprodtype expression.
  • One or more elements describing from top to down the left part of the rule, eg. predicate AND, expression BUNION.
  • Detail to localize those elements (optional): left (L), right (R).

Rewrite rules having an equivalence operator in their left part may also describe other rules. eg: the rule:

  \True  = \False  \;\;\defi\;\;  \bfalse

should also produce the rule:

  \False  = \True  \;\;\defi\;\;  \bfalse


For associative operators in connection with distributive laws as in:

 P \land (Q \lor \ldots \lor R)

it has been decided to put the "button" on the first associative/commutative operator (here \lor ). Pressing that button will generate a menu: the first option of this menu will be to distribute all associative/commutative operators, the second option will be to distribute only the first associative/commutative operator. In the following presentation, to simplify matters, we write associative/commutative operators with two parameters only, but it must always be understood implicitly that we have a sequence of them. For instance, we shall never write  Q \lor \ldots \lor R but  Q \lor R instead. Rules are sorted according to their purpose.

Rules marked with a star in the first column are implemented in the current prover. Rules without a star are planned for implementation.

Rewrite rules are split into:

They are also available in a single large page All Rewrite Rules.

Inference Rules

Inference rules are applied either automatically (A) or manually (M).

Inference rules applied automatically are applied at the end of each proof step when the post-tactic is enabled. They have the following possible effects:

  • they discharge the goal,
  • they simplify the goal and add a selected hypothesis,
  • they simplify the goal by decomposing it into several simpler goals,
  • they simplify a selected hypothesis,
  • they simplify a selected hypothesis by decomposing it into several simpler selected hypotheses.

Inference rules applied manually are used to perform an interactive proof. They can be invoked by pressing "buttons" which corresponds to emphasized (red) operators in the goal or the hypotheses. A menu is proposed when there are several options.

See the Inference Rules list.

The Proof Control Window

The Proof Control window contains the buttons which you can use to perform an interactive proof. Next is a screen shot where you can see successively from top to bottom:

  • some selected hypotheses,
  • the goal,
  • the "Proof Control" window,
  • a small editing area within which you can enter parameters used by some buttons of the Proof Control window
  • the smiley (section 6.5)
Um-0101.png

The Proof Control window offers a number of buttons which we succinctly describe from left to right:

  • (p0): the prover PP attempts to prove the goal (other cases in the list)
  • (R) review: In an attempt by the user to carry out proofs in a gradual fashion, they might decide to postpone the task of discharging some interactive proofs for a later stage. In this case they have the possibility to mark these proofs as reviewed (by choosing the proof node and pressing the blue button with a “R” letter on the top-left corner of the Proof Control view). This means that by visually checking this proof, the user convinced that they can discharge it later but they do not want to do it right now.
  • (dc) proof by cases: the goal is proved first under the predicate written in the editing area and then under its negation,
  • (ah) lemma: the predicate in the editing area is proved and then added as a new selected hypothesis,
  • (ae) abstract expression: the expression in the editing area is given a fresh name,
  • the auto-prover attempts to discharge the goal. The auto-prover is the one which is applied automatically on all proof obligations (as generated automatically by the proof obligation generator after a "save") without any intervention of the user. With this button, you can call yourself the auto-prover within an interactive proof.
  • the post-tactic is executed (see section 6.8),
  • lasso: load in the Selected Hypotheses window those unseen hypotheses containing identifiers which are common with identifiers in the goal and selected hypotheses,
  • backtrack form the current node (i.e., prune its parent),
  • scissors: prune the proof tree from the node selected in the proof tree,
  • show (in the Search Hypotheses window) hypotheses containing the character string as in the editing area,
  • Cache Hypotheses Button: By pressing "Cache Hypotheses" button the tool displays the "Cache Hypotheses" view. This view displays all hypotheses that are related to the current goal. Some of these hypotheses might not been chosen as current active hypotheses (this is the set of hypotheses that considered by the prover to discharge the current goal). By opening the cached hypotheses view the user can manually select and add some of them to the current active hypotheses view.
  • load the previous non-discharged proof obligation,
  • load the next undischarged proof obligation,
  • (i) show information corresponding to the current proof obligation in the corresponding window. This information correspond to the elements that took directly part in the proof obligation generation (events, invariant, etc.),
  • goto the next pending node of the current proof tree,
  • load the next reviewed node of the current proof tree.

The Smiley

The smiley can take three different colors: (1) red, meaning that the proof tree contains one or more non-discharged sequents, (2) blue, meaning that all non-discharged sequents of the proof tree have been reviewed, (3) green, meaning that all sequents of the proof tree are discharged.

The Operator "Buttons"

In the goal and in the selected, searched, or cache hypotheses some operators are colored in red. It means that they are "buttons" you can press. When doing so, the meaning (sometimes several) is shown in a menu where you can select various options. The operation performed by these options is described in sections 6.9.1 and 6.9.2.

The Search Hypotheses Window

By typing a string in the Proof Control window and pressing the Search Hypotheses button a window is provided which contains the hypotheses having a character string in common with the one entered by the user in the editing area. For example, if we search for hypotheses involving the character string "cr", then after pressing the Search Hypothesis button on the proof control window, we obtain the following:

Um-0102.png

This view also integrates a "quick search" area (A), that allows us to search quickly hypothesis involving short character strings such as "cr". A search hypothesis button (B) that behaves the same as the button of the proving window, a refresh button (C) that updates the window manually for more control, and a drop down menu (D) to set the preferences of the view up.

By pressing return key or the button (B) (once a short string has been given in the input area (A)), hypotheses can be searched quickly as if we used the Proof Control as described before.

The drop down menu (D) is accessible to set some preferences over the searched hypotheses :

SearchHyp view menu.png

If we change preferences for the search, we might need to "update" manually the view with the button (C). By selecting "Consider hidden hypotheses in search" option, we can review all hypotheses that have been unselected in the selected hypotheses window(more info about selected/hidden hypotheses...).

In the next step any of these hypotheses can be selected and then by pressing the (+)button they will be moved to the Selected Hypotheses window . Adding these hypotheses to the set Selected Hypotheses means that they will be visible to the prover. This means that they can be used during the next interactive proof phase. Accordingly by selecting any numbers of hypotheses and pressing the (-)button they will be removed from the Search Hypotheses window. The (-)button also appears above the selected hypotheses, and allow the user to remove any hypothesis form the Selected Hypotheses window. The other button which is situated in the left-hand-side of all hypotheses is the (ct) Button. By pressing the (ct) Button the negation of the corresponding hypothesis is taken as a new hypothesis. For this purpose we have to prove it first and therefore it appears as a new goal which the user must discharge it first and then proceed with the previous goal.

The Automatic Post-tactic

In this section, we present the various rewrite or inference rules which are applied automatically as a systematic post-tactic after each proof step. Note that the post-tactic can be disabled by using the "P\! \! \! \! /" button situated on the right of the proof control window.

The post-tactic is made of two different rules: rewrite rules, which are applied on any sub-formula of the goal or selected hypotheses (section 6.8.1) and inference rules which are applied on the current sequent (section 6.8.2).



Preferences for the Post-tactic

The post-tactic can be configured by means of a preference page which can be obtained as follows: press the "Window" button on the top tooolbar. On the coming menu, press the "Preferences" button. On the coming menu, press the "Event-B" menue, then the "Sequent Prover’, and finally the "Post-Tactic" button. This yilds the following window:

Um-0147.png

In the left part you can see the ordered sequence of individual tactics composing the post-tactic, whereas the right part contains further tactics you can incorporate in the left part. By selecting a tactic you can move it from on part to the other or change the order in the left part.