Extending the Proof Manager: Difference between revisions

From Event-B
Jump to navigationJump to search
imported>Son
No edit summary
imported>Ladenberger
No edit summary
 
(25 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{TOCright}}
The [[Proof Manager]] is responsible for constructing proofs and maintaining existing proofs associated with proof obligations.
The [[Proof Manager]] is responsible for constructing proofs and maintaining existing proofs associated with proof obligations.


There are two ways for extending the Proof Manager:  
There are two ways for extending the Proof Manager:  


# adding a new [[Reasoners|reasoner]].
# adding a new [http://handbook.cobra.cs.uni-duesseldorf.de/current/html/reasoners.html reasoner].


# adding a new [[Tactics|tactic]].
# adding a new [http://handbook.cobra.cs.uni-duesseldorf.de/current/html/proof_tactics.html tactic].


== Adding a New Reasoner ==
== Adding a New Reasoner ==


A reasoner is added into the Proof Manager using the extension point ''org.eventb.core.seqprover.reasoners''. Below are an example of how to contribute to the extension point.
A reasoner is added into the Proof Manager using the extension point ''org.eventb.core.seqprover.reasoners''. Below is an example of how to contribute to the extension point.


  <extension point="org.eventb.core.seqprover.reasoners">
  <extension point="org.eventb.core.seqprover.reasoners">
Line 26: Line 27:
However, most of the time, the developers only need to sub-class one of the abstract implementation, depending on the type of the reasoner. For the implementation purpose, we categorize our reasoners into the following types.  
However, most of the time, the developers only need to sub-class one of the abstract implementation, depending on the type of the reasoner. For the implementation purpose, we categorize our reasoners into the following types.  


* '''Automatic rewrite'''
* [[Adding Automatic Rewrite Reasoners | Automatic rewrite]] Reasoners of this type apply some rewriting rules automatically to simplify the input sequent.


* Automatic inference
* [[Adding Manual Rewrite Reasoners | Manual rewrite]] Reasoners of this type apply a rewriting rule for a given formula (or sub-formula) in the goal or in one of the hypotheses.


* Manual rewrite
* [[Adding Automatic Inference Reasoners | Automatic inference]] Reasoners of this type apply an inference rule automatically.


* Manual inference
* [[Adding Manual Inference Reasoners | Manual inference]] Reasoner of this type apply an inference rule manually.


* General purpose: Ones that do not fall into the four previous categories.
* [[Adding General Purpose Reasoners |General purpose]] Reasoners that do not fall into the four previous categories.


=== Automatic Rewrite Reasoners ===
''Please also have a look at'' [[How_To_Evolve_Reasoners| How To Evolve Reasoners]].


=== Automatic Inference Reasoners ===
== Adding a New Tactic ==
Adding a reasoner is only a first step in extending the Proof Manager. Reasoners need to be wrapped by Tactics for the Proof Manager to use. Similar to reasoners, there are different types of tactics for implementation purpose.


=== Manual Rewrite Reasoners ===
=== Implementing a Tactic ===


=== Manual Inference Reasoners ===
* [[Adding Automatic Tactics | Automatic Tactics]]: Tactics that can be run automatically either as POM Tactics or Post Tactics.


=== General Purpose Reasoners ===
* [[Adding Manual Tactics | Manual Tactics ]]: Tactics that need to be invoke manually during interactive proofs.






== Adding a New Tactic ==
[[Category:Developer documentation]]
[[Category:Rodin Platform]]
[[Category:Proof]]

Latest revision as of 10:27, 27 October 2011

The Proof Manager is responsible for constructing proofs and maintaining existing proofs associated with proof obligations.

There are two ways for extending the Proof Manager:

  1. adding a new reasoner.
  1. adding a new tactic.

Adding a New Reasoner

A reasoner is added into the Proof Manager using the extension point org.eventb.core.seqprover.reasoners. Below is an example of how to contribute to the extension point.

<extension point="org.eventb.core.seqprover.reasoners">
  <reasoner
    class="org.eventb.contributors.seqprover.reasoners.Hyp"
    id="hyp"
    name="%hypName"/>
</extension>

where the name attribute is internationalized.

The above declaration defines a reasoner with a specific id (which will be automatically prefixed by the project name, e.g. org.eventb.contributors.seqprover).

The class attribute must be a valid Java class name which will be used to create an instance of the reasoner. This class must implements org.eventb.core.seqprover.IReasoner interface.

However, most of the time, the developers only need to sub-class one of the abstract implementation, depending on the type of the reasoner. For the implementation purpose, we categorize our reasoners into the following types.

  • Automatic rewrite Reasoners of this type apply some rewriting rules automatically to simplify the input sequent.
  • Manual rewrite Reasoners of this type apply a rewriting rule for a given formula (or sub-formula) in the goal or in one of the hypotheses.
  • General purpose Reasoners that do not fall into the four previous categories.

Please also have a look at How To Evolve Reasoners.

Adding a New Tactic

Adding a reasoner is only a first step in extending the Proof Manager. Reasoners need to be wrapped by Tactics for the Proof Manager to use. Similar to reasoners, there are different types of tactics for implementation purpose.

Implementing a Tactic

  • Automatic Tactics: Tactics that can be run automatically either as POM Tactics or Post Tactics.
  • Manual Tactics : Tactics that need to be invoke manually during interactive proofs.