Rodin Keyboard User Guide: Difference between revisions
imported>Pascal |
imported>Laurent →Extending the Keyboard: Updated example and text |
||
(22 intermediate revisions by 2 users not shown) | |||
Line 7: | Line 7: | ||
== Getting Started == | == Getting Started == | ||
=== Overview === | === Overview === | ||
The Rodin Keyboard plug-in creates a view (namely " | The Rodin Keyboard plug-in creates a view (namely "Rodin Keyboard") under Event-B category. | ||
You can open " | You can open "Rodin Keyboard" view now: | ||
# Go to Window/Show View/Other. | # Go to Window/Show View/Other. | ||
# Choose the " | # Choose the "Rodin Keyboard" view from the Event-B category. | ||
The view contains a text area which takes an ASCII input and translate it into the mathematical language (defined by extensions). | The view contains a text area which takes an ASCII input and translate it into the mathematical language (defined by extensions). | ||
Line 18: | Line 18: | ||
=== Special Combos === | === Special Combos === | ||
Below are the special combos (set of ASCII characters) and their translations into the Event-B mathematical language. | Below are the special combos (set of ASCII characters) and their translations into the Event-B mathematical language. | ||
{| | {| border="1" cellspacing="0" | ||
| | ! ASCII !! LaTeX !! Math !! Meaning !! Unicode | ||
|- | |||
|align="center" | <code>NAT</code> || align="center" | \nat || align="center" | <math>\nat</math> || The set of natural numbers || U+2115 | |||
|- | |- | ||
|<code> | |align="center" | <code>NAT1</code> || align="center" | \natn || align="center" | <math>\natn</math> || The set of positive natural numbers || U+2115 U+0031 | ||
|- | |- | ||
|<code> | |align="center" | <code>INT</code> || align="center" | \intg || align="center" | <math>\intg</math> || The set of integer numbers || U+2124 | ||
|- | |- | ||
|<code> | |align="center" | <code>POW</code> || align="center" | \pow || align="center" | <math>\pow</math> || The set of all subsets (power set) || U+2119 | ||
|- | |- | ||
|<code> | |align="center" | <code>POW1</code> || align="center" | \pown || align="center" | <math>\pown</math> || The set of all non-empty subsets || U+2119 U+0031 | ||
|- | |- | ||
| | |colspan="5" | | ||
|- | |- | ||
|align="center" | <code>(</code> || align="center" | ( || align="center" | ( || Left parenthesis || U+0028 | |||
|- | |- | ||
|<code> | |align="center" | <code>)</code> || align="center" | ) || align="center" | ) || Right parenthesis || U+0029 | ||
|- | |- | ||
|<code> | |align="center" | <code><=></code> || align="center" | \leqv || align="center" | <math>\leqv</math> || Logical equivalence || U+21D4 | ||
|- | |- | ||
|<code> | |align="center" | <code>=></code> || align="center" | \limp || align="center" | <math>\limp</math> || Logical implication || U+21D2 | ||
|- | |- | ||
|<code> | |align="center" | <code>&</code> || align="center" | \land || align="center" | <math>\land</math> || Logical conjunction || U+2227 | ||
|- | |- | ||
|<code> | |align="center" | <code>or</code> || align="center" | \lor || align="center" | <math>\lor</math> || Logical disjunction || U+2228 | ||
|- | |- | ||
|<code> | |align="center" | <code>not</code> || align="center" | \lnot || align="center" | <math>\lnot</math> || Not sign || U+00AC | ||
|- | |- | ||
|<code> | |align="center" | <code>true</code> || align="center" | \btrue || align="center" | <math>\btrue</math> || True predicate || U+22A4 | ||
|- | |- | ||
|<code> | |align="center" | <code>false</code> || align="center" | \bfalse || align="center" | <math>\bfalse</math> || False predicate || U+22A5 | ||
|- | |- | ||
|<code> | |align="center" | <code>!</code> || align="center" | \forall || align="center" | <math>\forall</math> || For all || U+2200 | ||
|- | |- | ||
|<code> | |align="center" | <code>#</code> || align="center" | \exists || align="center" | <math>\exists</math> || There exists || U+2203 | ||
|- | |- | ||
|<code> | |align="center" | <code>,</code> || align="center" | , || align="center" | , || Comma || U+002C | ||
|- | |- | ||
|<code> | |align="center" | <code>.</code> || align="center" | \qdot || align="center" | <math>\qdot</math> || Middle dot || U+00B7 | ||
|- | |- | ||
| | |colspan="5" | | ||
|- | |- | ||
|align="center" | <code>=</code> || align="center" | = || align="center" | = || Equal to || U+003D | |||
|- | |- | ||
|<code>=</code> || = || = || | |align="center" | <code>/=</code> || align="center" | \neq || align="center" | <math>\neq</math> || Not equal to || U+2260 | ||
|- | |- | ||
|<code> | |align="center" | <code><</code> || align="center" | < || align="center" | < || Less than || U+003C | ||
|- | |- | ||
|<code><</code> || | |align="center" | <code><=</code> || align="center" | \leq || align="center" | <math>\leq</math> || Less than or equal to || U+2264 | ||
|- | |- | ||
|<code>& | |align="center" | <code>></code> || align="center" | > || align="center" | > || Greater than || U+003E | ||
|- | |- | ||
|<code>></code> || | |align="center" | <code>>=</code> || align="center" | \geq || align="center" | <math>\geq</math> || Greater than or equal to || U+2265 | ||
|- | |- | ||
|<code> | |align="center" | <code>:</code> || align="center" | \in || align="center" | <math>\in</math> || Element of || U+2208 | ||
|- | |- | ||
|<code>:</code> || \ | |align="center" | <code>/:</code> || align="center" | \notin || align="center" | <math>\notin</math> || Not an element of || U+2209 | ||
|- | |- | ||
|<code> | |align="center" | <code><<:</code> || align="center" | \subset || align="center" | <math>\subset</math> || (Proper) Subset of || U+2282 | ||
|- | |- | ||
|<code><<:</code> || \ | |align="center" | <code>/<<:</code> || align="center" | \notsubset || align="center" | <math>\not\subset</math> || Not a (proper) subset of || U+2284 | ||
|- | |- | ||
|<code> | |align="center" | <code><:</code> || align="center" | \subseteq || align="center" | <math>\subseteq</math> || Subset of or equal to || U+2286 | ||
|- | |- | ||
|<code><:</code> || \ | |align="center" | <code>/<:</code> || align="center" | \notsubseteq || align="center" | <math>\not\subseteq</math> || Neither a subset of nor equal to || U+2288 | ||
|- | |- | ||
| | |colspan="5" | | ||
|- | |- | ||
|align="center" | <code><-></code> || align="center" | \rel || align="center" | <math>\rel</math> || Relation || U+2194 | |||
|- | |- | ||
|<code><-></code> || \ | |align="center" | <code><<-></code> || align="center" | \trel || align="center" | <math>\trel</math> || Total relation || U+E100 | ||
|- | |- | ||
|<code> | |align="center" | <code><->></code> || align="center" | \srel || align="center" | <math>\srel</math> || Surjective relation || U+E101 | ||
|- | |- | ||
|<code><->></code> || \ | |align="center" | <code><<->></code> || align="center" | \strel || align="center" | <math>\strel</math> || Total surjective relation || U+E102 | ||
|- | |- | ||
|<code> | |align="center" | <code>+-></code> || align="center" | \pfun || align="center" | <math>\pfun</math> || Partial function || U+21F8 | ||
|- | |- | ||
|<code> | |align="center" | <code>--></code> || align="center" | \tfun || align="center" | <math>\tfun</math> || Total function || U+2192 | ||
|- | |- | ||
|<code> | |align="center" | <code>>+></code> || align="center" | \pinj || align="center" | <math>\pinj</math> || Partial injection || U+2914 | ||
|- | |- | ||
|<code>> | |align="center" | <code>>-></code> || align="center" | \tinj || align="center" | <math>\tinj</math> || Total injection || U+21A3 | ||
|- | |- | ||
|<code>> | |align="center" | <code>+>></code> || align="center" | \psur || align="center" | <math>\psur</math> || Partial surjection || U+2900 | ||
|- | |- | ||
|<code> | |align="center" | <code>->></code> || align="center" | \tsur || align="center" | <math>\tsur</math> || Total surjection || U+21A0 | ||
|- | |- | ||
|<code>->></code> || \ | |align="center" | <code>>->></code> || align="center" | \tbij || align="center" | <math>\tbij</math> || Bijection || U+2916 | ||
|- | |- | ||
| | |colspan="5" | | ||
|- | |- | ||
|align="center" | <code>{</code> || align="center" | { || align="center" | { || Left curly bracket || U+007B | |||
|- | |- | ||
|<code> | |align="center" | <code>}</code> || align="center" | } || align="center" | } || Right curly bracket || U+007D | ||
|- | |- | ||
|<code> | |align="center" | <code>|-></code> || align="center" rowspan="2" | \mapsto || align="center" rowspan="2" | <math>\mapsto</math> || align="center" rowspan="2" | Maplet || rowspan="2" | U+21A6 | ||
|- | |- | ||
|<code> | |align="center" | <code>,,</code> | ||
|- | |- | ||
|<code> | |align="center" | <code>{}</code> || align="center" | \emptyset || align="center" | <math>\emptyset</math> || Empty set || U+2205 | ||
|- | |- | ||
|<code> | |align="center" | <code>/\</code> || align="center" | \binter || align="center" | <math>\binter</math> || Intersection || U+2229 | ||
|- | |- | ||
|<code>/ | |align="center" | <code>\/</code> || align="center" | \bunion || align="center" | <math>\bunion</math> || Union || U+222A | ||
|- | |- | ||
|<code>\ | |align="center" | <code>\</code> || align="center" | \setminus || align="center" | <math>\setminus</math> || Set minus || U+2216 | ||
|- | |- | ||
|<code> | |align="center" | <code>**</code> || align="center" | \cprod || align="center" | <math>\cprod</math> || Cartesian product || U+00D7 | ||
|- | |- | ||
| | |colspan="5" | | ||
|- | |- | ||
|align="center" | <code>[</code> || align="center" | [ || align="center" | [ || Left square bracket || U+005B | |||
|- | |- | ||
|<code> | |align="center" | <code>]</code> || align="center" | ] || align="center" | ] || Right square bracket || U+005D | ||
|- | |- | ||
|<code> | |align="center" | <code><+</code> || align="center" | \ovl || align="center" | <math>\ovl</math> || Relation overriding || U+E103 | ||
|- | |- | ||
|<code> | |align="center" | <code>circ</code> || align="center" | \bcomp || align="center" | <math>\bcomp</math> || Backward composition || U+2218 | ||
|- | |- | ||
|<code> | |align="center" | <code>;</code> || align="center" | \fcomp || align="center" | <math>\fcomp</math> || Forward composition || U+003B | ||
|- | |- | ||
|<code> | |align="center" | <code>><</code> || align="center" | \dprod || align="center" | <math>\dprod</math> || Direct product || U+2297 | ||
|- | |- | ||
|<code>><</code> || \ | |align="center" | <code>|</code><code>|</code> || align="center" | \pprod || align="center" | <math>\pprod</math> || Parallel product || U+2225 | ||
|- | |- | ||
|<code> | |align="center" | <code>~</code> || align="center" | \conv || align="center" | ~ || Tilde operator || U+223C | ||
|- | |- | ||
|<code> | |align="center" | <code><|</code> || align="center" | \domres || align="center" | <math>\domres</math> || Domain restriction || U+25C1 | ||
|- | |- | ||
|<code><|</code> || \ | |align="center" | <code><<|</code> || align="center" | \domsub || align="center" | <math>\domsub</math> || Domain subtraction || U+2A64 | ||
|- | |- | ||
|<code> | |align="center" | <code>|></code> || align="center" | \ranres || align="center" | <math>\ranres</math> || Range restriction || U+25B7 | ||
|- | |- | ||
|<code>|></code> || \ | |align="center" | <code>|>></code> || align="center" | \ransub || align="center" | <math>\ransub</math> || Range subtraction || U+2A65 | ||
|- | |- | ||
| | |colspan="5" | | ||
|- | |- | ||
|align="center" | <code>%</code> || align="center" | \lambda || align="center" | <math>\lambda</math> || Lambda || U+03BB | |||
|- | |- | ||
|<code> | |align="center" | <code>INTER</code> || align="center" | \Inter || align="center" | <math>\Inter</math> || N-ary intersection || U+22C2 | ||
|- | |- | ||
|<code> | |align="center" | <code>UNION</code> || align="center" | \Union || align="center" | <math>\Union</math> || N-ary union || U+22C3 | ||
|- | |- | ||
|<code> | |align="center" | <code>|</code> || align="center" | \mid || align="center" | <math>\mid</math> || Such that || U+2223 | ||
|- | |- | ||
| | |colspan="5" | | ||
|- | |- | ||
|align="center" | <code>..</code> || align="center" | \upto || align="center" | <math>\upto</math> || Upto sign || U+2025 | |||
|- | |- | ||
|<code> | |align="center" | <code>+</code> || align="center" | + || align="center" | + || Addition sign || U+002B | ||
|- | |- | ||
|<code> | |align="center" | <code>-</code> || align="center" | - || align="center" | - || Subtraction sign || U+2212 | ||
|- | |- | ||
|<code> | |align="center" | <code>*</code> || align="center" | * || align="center" | * || Multiplication sign || U+2217 | ||
|- | |- | ||
|<code> | |align="center" | <code>/</code> || align="center" | \div || align="center" | <math>\div</math> || Division sign || U+00F7 | ||
|- | |- | ||
|<code> | |align="center" | <code>^</code> || align="center" | \expn || align="center" | <math>\expn</math> || Exponentiation sign || U+005E | ||
|- | |- | ||
| | |colspan="5" | | ||
|- | |- | ||
|align="center" | <code>oftype</code> || align="center" | \oftype || align="center" | [[Image:oftype.png]] || Typing operator || U+2982 | |||
|- | |- | ||
| | |colspan="5" | | ||
|- | |- | ||
|align="center" | <code>:=</code> || align="center" | \bcmeq || align="center" | <math>\bcmeq</math> || Becomes equal to || U+2254 | |||
|- | |- | ||
|<code>: | |align="center" | <code>::</code> || align="center" | \bcmin || align="center" | <math>\bcmin</math> || Becomes an element of || U+003A U+2208 | ||
|- | |- | ||
|<code>: | |align="center" | <code>:|</code> || align="center" | \bcmsuch || align="center" | <math>\bcmsuch</math> || Becomes such that || U+003A U+2223 | ||
|} | |} | ||
== Concepts == | |||
=== Rodin Keyboard View === | |||
The view contains a text area where ASCII input can be typed in. The text will be translated into the mathematical language (which is extensible) when there is a modification of the text. The translation is done for the whole text spanned over multiple lines. | |||
Below is an example of the view which is attached to the bottom area of the workbench. | |||
<center> | |||
[[Image:RODIN_keyboard_view.png]] | |||
</center> | |||
== Tasks == | |||
=== Entering a Mathematical Formula === | |||
A formula in the mathematical language of Event-B can be typed in the text area of the Rodin Keyboard view. The view will translate the formula from ASCII into the mathematical language as specified [[#Special_Combos | here]]. The formula can be copied as normal (Unicode) text. | |||
=== Changing the Font === | |||
In order to display the Unicode characters for the mathematical language, there is a special font associated with the text area. This font can be changed in the Preferences page associated with the Colors and Fonts. It can be opened from the category "General/Appearance/Colors And Fonts". Any font can be chosen, but mathematical language formulas can be displayed correctly only if the chosen font contains the Unicode characters for the mathematical language. From the Preferences page, you can choose the font, the style and the size for the text area. | |||
More information about the Preferences page can be found [[#Preferences | here]]. | |||
=== Extending the Keyboard === | |||
There is an extension point to extend the keyboard namely <tt>org.rodinp.keyboard.symbols</tt>. An example of using this extension point is shown below. | |||
<extension | |||
point="org.rodinp.keyboard.symbols"> | |||
<symbol | |||
combo="not" | |||
id="neg" | |||
name="%negName" | |||
translation="¬" /> | |||
<symbolProvider | |||
class="my.package.name.MyClassProvidingSymbols" /> | |||
</extension> | |||
The first extension contributes a symbol with all the details for translating an ASCII combination into a symbol. The second extension contributes a class. This class will be instantiated by the Rodin Keyboard plug-in to fetch additional symbol definitions. This allows for contributing new symbols dynamically. | |||
== Reference == | |||
=== Release Notes === | |||
See the [http://wiki.event-b.org/index.php/Keyboard_Release_History Keyboard Release History]. | |||
=== Preferences === | |||
The Preferences page is used to change the font of the text area in the Rodin Keyboard view. You can access it from the "General/Appearance/Colors and Fonts" page. | |||
A sample of this preferences page is shown below. | |||
[[Image:Keyboard_preferences.jpg]] | |||
The button "Change Font" is used to choose a new font. A pop-up dialog will be open and you can choose from the set of system fonts. The button "Reset" is used to set the font to the default Brave Sans Mono font. | |||
There are four other buttons at the bottom of the page: | |||
* Restore Default: Restore the default fonts. It does not affect the Keyboard view. | |||
* Apply: Apply the current chosen font for the Keyboard view. | |||
* OK: Store the preference values to the preference store and close the page. It also applies the current chosen font for the Keyboard view. | |||
* Cancel: Close the page immediately without saving the preference values. Obviously, this does not affect the Keyboard view. | |||
== Samples == | |||
=== Expression === | |||
{{TODO}} | |||
=== Jumping === | |||
{{TODO}} | |||
[[Category:User documentation]] | [[Category:User documentation]] | ||
[[Category:Work in progress]] | [[Category:Work in progress]] |
Latest revision as of 12:58, 21 July 2010
Introduction
This short help page provides necessary information on the Rodin Keyboard plug-in and also on how to extend the plug-in.
Getting Started
Overview
The Rodin Keyboard plug-in creates a view (namely "Rodin Keyboard") under Event-B category.
You can open "Rodin Keyboard" view now:
- Go to Window/Show View/Other.
- Choose the "Rodin Keyboard" view from the Event-B category.
The view contains a text area which takes an ASCII input and translate it into the mathematical language (defined by extensions).
Special Combos
Below are the special combos (set of ASCII characters) and their translations into the Event-B mathematical language.
Concepts
Rodin Keyboard View
The view contains a text area where ASCII input can be typed in. The text will be translated into the mathematical language (which is extensible) when there is a modification of the text. The translation is done for the whole text spanned over multiple lines.
Below is an example of the view which is attached to the bottom area of the workbench.
Tasks
Entering a Mathematical Formula
A formula in the mathematical language of Event-B can be typed in the text area of the Rodin Keyboard view. The view will translate the formula from ASCII into the mathematical language as specified here. The formula can be copied as normal (Unicode) text.
Changing the Font
In order to display the Unicode characters for the mathematical language, there is a special font associated with the text area. This font can be changed in the Preferences page associated with the Colors and Fonts. It can be opened from the category "General/Appearance/Colors And Fonts". Any font can be chosen, but mathematical language formulas can be displayed correctly only if the chosen font contains the Unicode characters for the mathematical language. From the Preferences page, you can choose the font, the style and the size for the text area.
More information about the Preferences page can be found here.
Extending the Keyboard
There is an extension point to extend the keyboard namely org.rodinp.keyboard.symbols. An example of using this extension point is shown below.
<extension point="org.rodinp.keyboard.symbols"> <symbol combo="not" id="neg" name="%negName" translation="¬" /> <symbolProvider class="my.package.name.MyClassProvidingSymbols" /> </extension>
The first extension contributes a symbol with all the details for translating an ASCII combination into a symbol. The second extension contributes a class. This class will be instantiated by the Rodin Keyboard plug-in to fetch additional symbol definitions. This allows for contributing new symbols dynamically.
Reference
Release Notes
See the Keyboard Release History.
Preferences
The Preferences page is used to change the font of the text area in the Rodin Keyboard view. You can access it from the "General/Appearance/Colors and Fonts" page.
A sample of this preferences page is shown below.
The button "Change Font" is used to choose a new font. A pop-up dialog will be open and you can choose from the set of system fonts. The button "Reset" is used to set the font to the default Brave Sans Mono font.
There are four other buttons at the bottom of the page:
- Restore Default: Restore the default fonts. It does not affect the Keyboard view.
- Apply: Apply the current chosen font for the Keyboard view.
- OK: Store the preference values to the preference store and close the page. It also applies the current chosen font for the Keyboard view.
- Cancel: Close the page immediately without saving the preference values. Obviously, this does not affect the Keyboard view.
Samples
Expression
TODO
Jumping
TODO