Difference between pages "TextEditor EBNF" and "Template:Icon"

From Event-B
(Difference between pages)
Jump to navigationJump to search
imported>Fabian
 
imported>Mathieu
m (Robot: Changing Category:Typesetting template)
 
Line 1: Line 1:
{| align="right"
+
<noinclude>
| __TOC__
+
Template use to specify an icon:
|}
+
== Usage ==
This page describes the text syntax for Event-B models in the TextEditor. It shows an EBNF and explains some details and design decisions.
+
<nowiki>{{icon|iconname}}</nowiki>
 
+
or
See the [[Text_Editor]] page for details of the editor and the usage of the text syntax.
+
<nowiki>{{icon|iconname|alternative text}}</nowiki>
 
+
== Example ==
 
+
Click {{icon|newprj_wiz}} and the create a component.
===EBNF for the TextEditor's syntax ===
+
You can also find {{icon|newprj_wiz|Create new project}} in the project explorer.
 
+
[[Category:Typesetting templates]]
parse_unit =
+
== Template ==
    'machine' identifier_literal comment*
+
</noinclude><!--
    ('refines' identifier_literal (',' identifier_literal)*)?
+
--><div class="typeset-icon" style="display:inline;"><table style="border:1px solid #aaaaaa;  display:inline; " ><tr><td style="vertical-align:sub;height:24px;">[[Image:{{{1}}}.gif|16x16px|{{{2| }}}]]</td></tr></table></div>
    ('sees' identifier_literal (',' identifier_literal)*)?
 
    ('variables' identifier_list)?
 
    ('invariants' labeled_predicate_with_theorem+)?
 
    ('variant' variant)?
 
    ('events' event+)?
 
    end |
 
   
 
    'context' identifier_literal comment*
 
    ('extends' identifier_literal (',' identifier_literal)*)?
 
    ('sets' identifier_list)?
 
    ('constants' identifier_list)?
 
    ('axioms' labeled_predicate_with_theorem+)?
 
    end ;
 
 
variant = expression comment*;
 
 
event =
 
    convergence? 'event' identifier_literal comment*
 
    event_refinement?
 
    ('any' identifier_list)?
 
    ('where' labeled_predicate+)?
 
    ('with' labeled_predicate+)?
 
    ('then' labeled_action+)? ;
 
 
convergence = 'ordinary' | 'convergent' | 'anticipated' ;
 
 
event_refinement =
 
    'refines' identifier_literal (',' identifier_literal)* |
 
    'extends' identifier_literal ;
 
 
labeled_action = '@' identifier_literal action comment*;
 
 
labeled_predicate = '@' identifier_literal predicate comment*;
 
 
labeled_predicate_with_theorem =
 
    '@' identifier_literal predicate comment*|
 
    'theorem' '@' identifier_literal predicate comment*;
 
 
identifier = identifier_literal comment*;
 
 
identifier_list = identifier identifier* ;
 
 
comment =
 
    '//' string-to-next-linebreak |
 
    '/*' string '*/' ;
 
 
 
 
 
===Explanation ===
 
====Formulas ====
 
As you might notice the grammar only describes the structure of machines and contexts. For the terminals ''predicate'', ''expression'' and ''action'' you can use the syntax for formulas which you already know from editing models with the graphical Event-B editor. You can use the ASCII representation of mathematical symbols or their unicode. See the Rodin help for details about the mathematical symbols and their ASCII counterparts.
 
 
 
====Comments ====
 
Also note that the rather strict position for comments is necessary. In the RodinDB most elements can be commented. That means if you comment an element this comment is attached to the element. To reflect this in a text syntax we need to exactly specify to which textual element a comment belongs. Therefore we decided to always associate a comment to the previous element.
 
Additionally database only allows one comment per element. The grammar allows multiple comments, but to reflect the database restriction to one internally multiple comments are concatenated to one with linebreaks between the separate comments.
 
 
 
 
 
===Examples ===
 
''Feel free to add own examples!''
 
 
 
 
 
=====Machine 'm0' from example project 'maximum' =====
 
 
 
See the [[TextEditor_Screenshots#Machine_.27m0.27_from_example_.27maximum.27|screenshot]] of this example or download the [http://deploy-eprints.ecs.soton.ac.uk/56/4/maximum.zip project].
 
 
 
machine m0 sees array
 
 
variables i
 
 
invariants
 
  @inv1 i ∈ ℕ
 
 
events
 
  event INITIALISATION
 
    then
 
      @act1 i :∈ ℕ
 
  end
 
 
  event find_max
 
    any j
 
    where
 
      @grd1 j ∈ 1‥n
 
      @grd2 ∀k·k∈1‥n ⇒ a(k) ≤ a(j)
 
    then
 
      @act1 i ≔ j
 
  end
 
end
 

Revision as of 20:29, 10 September 2008

Template use to specify an icon:

Usage

{{icon|iconname}} or {{icon|iconname|alternative text}}

Example

Click

Newprj wiz.gif

and the create a component. You can also find

Create new project

in the project explorer.

Template

[[Image:{{{1}}}.gif|16x16px| ]]