Difference between pages "Rodin Developer Support" and "Rodin Proving Perspective"

From Event-B
(Difference between pages)
Jump to navigationJump to search
imported>Colin
 
imported>Im06r
 
Line 1: Line 1:
The Developer Support provides resources for developing plug-ins for the Rodin Platform.
+
{{Navigation|Previous= [[The_Proof_Obligation_Explorer_(Rodin_User_Manual)|The Proof Obligation Explorer]]|Next= [[The_Mathematical_Language_(Rodin_User_Manual)|The Mathematical Language]]|Up= [[index_(Rodin_User_Manual)|User_Manual_index]]}}
 +
{{TOCright}}
 +
== Overview ==
 +
The Proving Perspective is made of a number of windows (views): the Proof Tree (see [[Rodin_Proving_Perspective#The_Proof_Tree]]), the Goal, the Selected Hypotheses, the Proof Control, the Search Hypotheses, the Cache Hypotheses and the Proof Information. In subsequent sections, we study each of these windows. Below is a screenshot of the proving perspective:
  
 +
[[Image:ProvPers.png|center]]
  
== Rodin Developer FAQ ==
+
== Loading a Proof ==
 +
In order to load a proof, switch to the Proving Perspective, select the project from the Event-B Explorer, select and expand the component (context or machine), finally select the proof obligation of interest. The corresponding proof will be loaded.
  
see [[Developer FAQ]].
+
== The Proof Tree ==
 +
The proof tree describe each individual proof step in the proof. The proof tree can be seen in its corresponding window as seen in the following screenshot:
  
== Architecture of the Rodin Platform ==
+
[[Image:ProTree.png|center]]
  
=== Rodin Platform Core ===
+
Each line in the 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. Each node is labelled with a comment (description) explaining how it can be discharged. By selecting a node in the proof tree, the corresponding sequent is loaded: the hypotheses of the sequent are loaded to the Selected Hypotheses window, and the goal of the sequent is loaded to the Goal window.
  
* [[Database]]
+
=== Decoration===
 +
The leaves of the tree are decorated with three kinds of logos:
  
* [[Builder]]
+
* a green logo with a "'''<math>\surd </math>'''" in it means that this leaf is discharged,
 +
* a brown 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.
  
* [[Rodin Index Design]]
+
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: the node will become "brown" again (undischarged) and you can now try to discharge it.
  
* [[Indexing System]]
+
=== Navigation within the Proof Tree===
 +
On top of the proof tree window, one can see three buttons:
  
* [[Undo Redo]]
+
* 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.
  
* [[File Root Separation]]
+
=== Manipulating the Proof Tree===
  
=== Event-B User Interface ===
+
==== Hiding ====
 +
The little triangle (with a "+" or "-" inside) next to each node in the proof tree allows you to expand or collapse the subtree starting at that node.
  
The Event-B User Interface of the Roding Platform has two major components that are concerned with either [http://handbook.event-b.org/current/html/event_b_perspective.html modelling] in Event-B or [http://handbook.event-b.org/current/html/proving_perspective.html proving] properties of models.
+
==== 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 brown decorated. This allows you to resume the proof from that node. After selecting a sequent in the proof tree, pruning can be performed by right-clicking and then selecting "Prune".
  
* [http://handbook.event-b.org/current/html/event_b_perspective.html Modelling User Interface]
+
Note that after pruning, the post-tactic is not applied to the new current sequent: if needed you have to press the "post-tactic" button in the Proof Control window. 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.
  
* [http://handbook.event-b.org/current/html/proving_perspective.html Proving User Interface]
+
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).
  
Apart from these are more minor components.
+
==== Copy/Paste ====
  
* [[Proof Purger Design|Proof Purger]] allows to delete unused proofs.  
+
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.
  
* [[Proof Skeleton Design]] is a view that displays skeletons of existing proofs
+
== 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:
 +
[[Image:GoalHyp.png|center]]
  
* [[Auto-Completion Design]] proposes a list of names to the user editing a model
+
A selected hypothesis can be deselected (and as a result becomes hidden) by first clicking in the box (check 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:
  
=== Event-B Component Library ===
+
[[Image:GoalHypSelect.png|center]]
  
Event-B models and all proof-related information are stored in the Rodin database. The syntax of the mathematical notation, that is, expressions, predicates, and assignments, are maintained in an [[Abstract Syntax Tree|abstract syntax tree]]. Abstract syntax trees are manipulated by means of a class library that can be used independently of Eclipse. They are saved in the database in human-readable form as Unicode character strings. Event-B constructs, such as contexts and machines, are not represented as abstract syntax trees. They are stored and retrieved directly from the database (by contrast, mathematical formulas need additional parsing). Well-formedness of Event-B constructs is verified by a [[Static Checker|static checker]]. The static checker has two main purposes: (1) it generates error messages for ill-formed constructs, and (2) it filters well-formed parts of components to be subjected to proof obligation generation. The [[Proof Obligation Generator|proof obligation generator]] uses those parts of constructs that are well-formed and generates proof obligations from them. Finally, the [[Proof Manager|proof manager]] attempts to prove proof obligations and maintains existing proofs associated with proof obligations. The proof manager works automatically and interactively. When new proof obligations have been generated it attempts to discharge them automatically. If it does not succeed, it permits interactive proof (by means of the [http://handbook.event-b.org/current/html/proving_perspective.html proving user interface]).
+
Here is the result:
  
* [[Abstract Syntax Tree]]
+
[[Image:GoalHypSelectRes.png|center]]
  
* [[Static Checker]]
+
Notice that the deselected hypotheses are not lost: you can get them back by means of the Search Hypotheses window. The other two buttons next to the red ('''-''') button allow the user (in the order of their appearance from left to right) to select all hypotheses as well as inverse the current selection.
  
* [[Proof Obligation Generator]]
+
The ('''ct''') button next to the goal allows you to do a proof by contradiction: by pressing it, the negation of the goal becomes a selected hypothesis whereas the goal becomes "'''⊥'''".
  
* [[Proof Manager]]
+
The ('''ct''') button next to a selected hypothesis allows you to do another kind of proof by contradiction: by pressing it, the negation of the concerned hypothesis becomes the goal whereas the negated goal becomes an hypothesis.
  
* [[Proof Simplification]]
+
=== Applying Proof Rules ===
 +
The red hyperlinks as well as the ('''ct''') buttons (also occasionally other green filled buttons next to it e.g., AND introduction in goal) allows the user to carry out interactive proofs. They are used to invoke proof rules (rewrite rules as well as inference rules).
  
== Extending Rodin ==
+
[[Image:ApplyRewRule.png|center]]
  
* [[Developer Documentation]]
+
==== Rewrite Rules ====
 +
Rewrite rules are one-directional equalities (and equivalences) that can be used to simplify formulas (the goal or a single hypothesis). A rewrite rule is applied from left to right either in the goal or in one of the selected hypotheses, when its ''side condition'' holds.
  
* [[Plug-in Tutorial]]
+
A rewrite rule is applied either automatically ('''A''') or manually ('''M'''):
 +
* automatically, when post tactics are enabled. These rules are equivalence simplification laws.
 +
* manually, through an interactive command. These rules gathers non equivalence laws, definition laws, distributivity laws and derived laws.
  
* [[Extending the Rodin Database]]
+
Each rule is named after the following elements:
  
* [[Extending the project explorer]]
+
* 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).
  
* [[Extending the Structure Editor]]
+
Rewrite rules having an equivalence operator in their left part may also describe other rules. eg: the rule:
  
* [[Extending the Pretty Print Page]]
+
<center><math>  \True  = \False  \;\;\defi\;\;  \bfalse </math></center>
  
* [[Extending the Proof Manager]]
+
should also produce the rule:
  
* [[Extending the Index Manager]]
+
<center><math>  \False  = \True  \;\;\defi\;\;  \bfalse </math></center>
  
* [[Extending the Static Checker]]
+
For associative operators in connection with distributive laws as in:
  
* [[Index Query]]
+
<center><math> P \land (Q \lor \ldots \lor R) </math></center>
  
== Useful Hints ==
+
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.
  
=== Version Control ===
+
Rules marked with a star in the first column are implemented in the current prover.  Rules without a star are planned for implementation.
  
All sources of the core Rodin platform (and of some plug-ins) are managed under version control in SourceForge.  The repository currently used is Subversion and can be accessed using URL [https://rodin-b-sharp.svn.sourceforge.net/svnroot/rodin-b-sharp  https://rodin-b-sharp.svn.sourceforge.net/svnroot/rodin-b-sharp].
+
Rewrite rules are split into:
  
=== Building against a version of Rodin ===
+
* [[Set Rewrite Rules]]
 +
* [[Relation Rewrite Rules]]
 +
* [[Arithmetic Rewrite Rules]]
  
To develop extensions to the Rodin platform your code build needs access to a consistent (version-wise) set of Rodin platform plug-ins. (Don't just check out the latest versions from 'Head' because it may be under development and in an inconsistent state). An easy way to set up your workspace is to import the Rodin platform source code from SVN into your workspace using the 'Releng' plug-in.
+
They are also available in a single large page [[All Rewrite Rules]].
See [http://wiki.event-b.org/index.php/Developer_FAQ#Installing_the_sources_from_Subversion_in_Eclipse Installing the sources from Subversion in Eclipse] for further instructions.
 
  
Alternatively, you can set your plugin development target platform to any Rodin installation you have installed (Eclipse-Preferences-Plug-in Development-Target Platform). This is useful as a final test that everything will work once installed into Rodin but because it uses a 'built' platform, you don't get access to the Rodin source code (e.g. for de-bugging).
+
==== Inference Rules ====
 +
Inference rules (see [[Proof Rules]]) are applied either automatically (A) or manually (M).
  
=== Testing ===
+
Inference rules applied automatically are applied at the end of each proof step. They have the following possible effects:
  
=== Debugging ===
+
* 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.
  
There is nothing special to the Rodin platform as concerns debugging. This is just like debugging any Eclipse plug-in. See for instance [http://eclipse.org/resources/?sort=date&category=Debugging Eclipse Debugging Resources].
+
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.
  
=== Publishing ===
+
See [[Inference Rules]] list.
  
A Plug-in developed for the Rodin Platform will normally consist of a collection of eclipse 'plugin' projects and a single eclipse 'feature' project. The feature project contains branding information such as logo's icons and licensing details. It is also used to identify your Plug-in so that users can install it. To build your Plug-in use an eclipse 'site' project. This will build the jar files for your plugin projects and a jar for your feature. See eclipse documentation for more details.
+
== The Proof Control Window ==
  
Now you need to make your Plug-in available for users to install via the Main Rodin Update site (which comes built-in to the Rodin platform).  
+
The Proof Control window contains the buttons which you can use to perform an interactive proof.
  
Create a new release folder in the FRS (On Sourceforge Rodin project website - Admin-file releases) noting the naming conventions (e.g. Plugin_<mypluginName>) and sub-folder structure conventions (one per release). Now you can upload your jar files using the controls on the releases webpage). Note that you should include a zip of the complete source projects to comply with Sourceforge rules.
+
[[Image:PControl.png|center]]
You should not repeat files that have not changed. The Feature jar will take care of unchanged plugin jars and use the existing links. Only new jars should be included in a particular release.
 
  
Finally, the update site must be updated to redirect the update requests to the files on the FRS. ([[Details for Uploading Main Rodin Update Site]]).
+
The Proof Control window offers a number of buttons which we succinctly describe from left to right:
  
=== Upgrading and maintain ===
+
* ('''nPP'''): the new predicate prover.
 +
* ('''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 this button.  This means that by visually checking this proof, the user is convinced that they can discharge it later but they do not want to do it right now.
 +
* ('''p0'''): the prover PP and ML can be invoked from the drop-down list.
 +
* ('''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 robot''': 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 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]]),
 +
* '''lasoo''': load in the Selected Hypotheses window those hidden 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.
 +
* load the '''previous''' undischarged 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 directly took 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.
 +
* '''Disable/Enable Post-tactics''': allows the user to choose whether post-tactics run after each interactive proof step.
 +
=== The Smiley ===
 +
The smiley can take three different colors: (1) red, meaning that the proof tree contains one or more undischarged sequents, (2) blue, meaning that all undischarged sequents of the proof tree have been reviewed, (3) green, meaning that all sequents of the proof tree are discharged.
  
Please note that you should always keep an existing version of your plug-in for the antepenultimate version of Rodin when you want to perform some clean-up of your update site.
+
=== The Editing Area ===
Indeed, not all the users switch to the latest version of Rodin by the time of its release, and certainly would like to use your plug-ins anyway.
+
The editing area allows the user to supply parameters to certain proof commands. For example, when the user attempts to add a new hypothesis (by pressing the lemma '''ah''' button), the new hypothesis should be written by the user in the editing area.
  
[[Category:Developer documentation]]
+
== The Search Hypotheses Window ==
[[Category:Rodin Platform]]
+
 
 +
By typing a string in the editing area of 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.
 +
 
 +
[[Image:SearchHyp.png|center]]
 +
 
 +
In the next step, any of these hypotheses can be selected (box checked), and then by pressing the '''(+)''' button, they will be moved to the '''Selected Hypotheses''' window. Adding these hypotheses to the set of 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 '''(-)''' 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. Pressing the '''(ct)''' button next to a hypothesis in the '''Search Hypotheses''' window achieves proof by contradiction. This has the same effect as selecting (making it part of the '''Selected Hypothesis''' window) that hypothesis, and then pressing the ('''ct''') button next to it in the '''Selected Hypotheses''' window.
 +
 
 +
== The Cache Hypotheses Window ==
 +
 
 +
This window allows the user to keep track of recently manipulated (e.g., used, removed, selected) hypotheses for any PO. For example, when the user applies a rewrite to an hypothesis, a new hypothesis (after the rewriting) is selected, and the original hypothesis is deselected and put in the '''Cache Hypotheses''' window.
 +
 
 +
Similar operations (to that of the '''Selected Hypotheses''' and '''Search Hypotheses''' windows) such as removing, selecting and proof by contradiction ('''ct''') are also available for the cached hypotheses. Interactive proof steps (e.g., rewriting) can also be carried out from the '''Cache Hypotheses''' window as well as the '''Search Hypotheses''' window.
 +
 
 +
== Proof Information View ==
 +
 
 +
This view displays information that can be used to relate the proof obligation to the model. For example, typical information for an event invariant preservation PO include the event as well as the invariant in question.
 +
 
 +
[[Image:PInfo.png|center]]
 +
 
 +
== Auto-tactics and Post-tactics ==
 +
 
 +
Auto-tactics apply a combination of ''rewrite'', ''inference'' and ''external provers'' to newly generated proof obligations. However, they can also be called upon by the user by pressing the ('''robot''') button in the '''Proof Control''' window.
 +
 
 +
Post-tactics are applied automatically after each interactive proof step. However, they can also be invoked manually by the user by pressing the ('''broomstick''') button in the '''Proof Control''' window.
 +
 
 +
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 17:52, 11 March 2010

Overview

The Proving Perspective is made of a number of windows (views): the Proof Tree (see Rodin_Proving_Perspective#The_Proof_Tree), the Goal, the Selected Hypotheses, the Proof Control, the Search Hypotheses, the Cache Hypotheses and the Proof Information. In subsequent sections, we study each of these windows. Below is a screenshot of the proving perspective:

ProvPers.png

Loading a Proof

In order to load a proof, switch to the Proving Perspective, select the project from the Event-B Explorer, select and expand the component (context or machine), finally select the proof obligation of interest. The corresponding proof will be loaded.

The Proof Tree

The proof tree describe each individual proof step in the proof. The proof tree can be seen in its corresponding window as seen in the following screenshot:

ProTree.png

Each line in the 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. Each node is labelled with a comment (description) explaining how it can be discharged. By selecting a node in the proof tree, the corresponding sequent is loaded: the hypotheses of the sequent are loaded to the Selected Hypotheses window, and the goal of the sequent is loaded to the Goal window.

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 brown 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: the node will become "brown" 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.

Manipulating the Proof Tree

Hiding

The little triangle (with a "+" or "-" inside) 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 brown decorated. This allows you to resume the proof from that node. After selecting a sequent in the proof tree, pruning can be performed by right-clicking and then selecting "Prune".

Note that after pruning, the post-tactic is not applied to the new current sequent: if needed you have to press the "post-tactic" button in the Proof Control window. 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:

GoalHyp.png

A selected hypothesis can be deselected (and as a result becomes hidden) by first clicking in the box (check 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:

GoalHypSelect.png

Here is the result:

GoalHypSelectRes.png

Notice that the deselected hypotheses are not lost: you can get them back by means of the Search Hypotheses window. The other two buttons next to the red (-) button allow the user (in the order of their appearance from left to right) to select all hypotheses as well as inverse the current selection.

The (ct) button next to the goal allows you to do a proof by contradiction: by pressing it, the negation of the goal becomes a selected hypothesis whereas the goal becomes "".

The (ct) button next to a selected hypothesis allows you to do another kind of proof by contradiction: by pressing it, the negation of the concerned hypothesis becomes the goal whereas the negated goal becomes an hypothesis.

Applying Proof Rules

The red hyperlinks as well as the (ct) buttons (also occasionally other green filled buttons next to it e.g., AND introduction in goal) allows the user to carry out interactive proofs. They are used to invoke proof rules (rewrite rules as well as inference rules).

ApplyRewRule.png

Rewrite Rules

Rewrite rules are one-directional equalities (and equivalences) that can be used to simplify formulas (the goal or a single hypothesis). A rewrite rule is applied from left to right either in the goal or in one of the selected hypotheses, when its side condition holds.

A rewrite rule is applied either automatically (A) or manually (M):

  • automatically, when post tactics are enabled. These rules are equivalence simplification laws.
  • manually, through an interactive command. These rules gathers non equivalence laws, definition laws, distributivity laws and derived laws.

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 (see Proof Rules) are applied either automatically (A) or manually (M).

Inference rules applied automatically are applied at the end of each proof step. 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 Inference Rules list.

The Proof Control Window

The Proof Control window contains the buttons which you can use to perform an interactive proof.

PControl.png

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

  • (nPP): the new predicate prover.
  • (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 this button. This means that by visually checking this proof, the user is convinced that they can discharge it later but they do not want to do it right now.
  • (p0): the prover PP and ML can be invoked from the drop-down list.
  • (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 robot: 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 the auto-prover within an interactive proof.
  • the post-tactic is executed (see section 6.8),
  • lasoo: load in the Selected Hypotheses window those hidden 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.
  • load the previous undischarged 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 directly took 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.
  • Disable/Enable Post-tactics: allows the user to choose whether post-tactics run after each interactive proof step.

The Smiley

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

The Editing Area

The editing area allows the user to supply parameters to certain proof commands. For example, when the user attempts to add a new hypothesis (by pressing the lemma ah button), the new hypothesis should be written by the user in the editing area.

The Search Hypotheses Window

By typing a string in the editing area of 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.

SearchHyp.png

In the next step, any of these hypotheses can be selected (box checked), and then by pressing the (+) button, they will be moved to the Selected Hypotheses window. Adding these hypotheses to the set of 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 (-) 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. Pressing the (ct) button next to a hypothesis in the Search Hypotheses window achieves proof by contradiction. This has the same effect as selecting (making it part of the Selected Hypothesis window) that hypothesis, and then pressing the (ct) button next to it in the Selected Hypotheses window.

The Cache Hypotheses Window

This window allows the user to keep track of recently manipulated (e.g., used, removed, selected) hypotheses for any PO. For example, when the user applies a rewrite to an hypothesis, a new hypothesis (after the rewriting) is selected, and the original hypothesis is deselected and put in the Cache Hypotheses window.

Similar operations (to that of the Selected Hypotheses and Search Hypotheses windows) such as removing, selecting and proof by contradiction (ct) are also available for the cached hypotheses. Interactive proof steps (e.g., rewriting) can also be carried out from the Cache Hypotheses window as well as the Search Hypotheses window.

Proof Information View

This view displays information that can be used to relate the proof obligation to the model. For example, typical information for an event invariant preservation PO include the event as well as the invariant in question.

PInfo.png

Auto-tactics and Post-tactics

Auto-tactics apply a combination of rewrite, inference and external provers to newly generated proof obligations. However, they can also be called upon by the user by pressing the (robot) button in the Proof Control window.

Post-tactics are applied automatically after each interactive proof step. However, they can also be invoked manually by the user by pressing the (broomstick) button in the Proof Control window.

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.