3.3.1 Introduction
In the following section, we use sans serif letters like
,
,
,
, …as placeholders for arbitrary expressions instead of
,
,
,
which represent Event-B identifiers. For example, the
and
in
could be a placeholder for
and
.
We use the
to state that an expression, predicate or assignment
can be equivalently rewritten as
if
’s well-definedness condition is fulfilled. We have tried to find a balance between having a precise and concise description for all Event-B’s mathematical components and having a text that is still easily readable. Many of the operators can be expressed using other, simpler constructs. Other, like equality (
) or universal quantification (
) are simply described with natural language.
When we introduce new identifiers while expressing an operator (e.g. by using a set comprehension), we assume that the new identifier does not occur free in the rewritten expressions (see Section 3.3.1.3 for more information on free identifiers).
For a concise summary of the Event-B mathematical toolkit, download the four-page Event-B Cheat Sheet. We would like to thank Ken Robinson for making it available.
3.3.1.1 Data types
In Event-B we have 3 kinds of basic data types:
is the set of all integers.
is the set of Booleans. It has two elements
.
Users can define carrier sets. These are defined in the Sets section of a context. Carrier sets are never empty. There is no other assumption made about carrier sets unless it is stated explicitly as an axiom.
From all data types
, two other kinds of data types can be constructed:
Expressions that are constructed by the rules above are called type expressions.
3.3.1.1.1 A note about the notation
We use the Greek letters
,
,
, …to represent arbitrary data types. For an expression
, we write
to state that
is of type
. In the following descriptions of Event-B’s mathematical constructs, we will describe the types of all constructs and their components.
For example, we will describe the maplet
whose type is defined by
with
and
. We do not restrict the types of
and
.
For predicates, we simply describe the data types of their components. The predicate itself does not have a type. For example, consider the components’ types for the equality of two expressions
:
and
. By stating that
and
are both of type
, we express that both expressions must have the same type but do not make any further assumptions about their types.
3.3.1.2 Well-definedness
A predicate which describes the condition under which an expression or predicate in Event-B can be safely evaluated is the well-definedness condition. An example with integer division makes this clear: The expression
only makes sense when
.
Well-definedness conditions are usually used for well-definedness proof obligations (3.2.5).
In Rodin, the
-operator defines which well-defined condition a predicate or expression has. When applied to the above example, integer division can be formatted as follows:
.
In the following sections, we state for each mathematical construct what the well-definedness conditions are. In many cases, this is just the conjunction of the well-definedness conditions for the different syntactical parts of a construct.
The
-operator cannot be expressed in Event-B itself. It is only used to describe Event-B’s concept of well-definedness and how the well-definedness proof obligations are generated.
3.3.1.3 Free identifiers
Free identifiers in predicates and expressions are those identifiers which are used but not introduced by quantifiers. More formally, we define the set of free identifiers
of an expression or predicate
recursively as follows:
Expression / Predicate |
Free identifiers |
Identifier |
|
Integer |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
 |
3.3.1.4 Structure of the subsections
The following reference subsections will have the form the form:
math. Symbol |
ASCII representation |
Name of the operator |
… |
… |
… |
- Description
A short description of what the operator does
- Definition
A formal definition of what the operator does
- Types
A description of the types of all arguments and, if the operation is an expression, the expression’s type
- WD
A description of the well-definedness conditions using the
operator
- Feasibility
Non-deterministic assignments may have feasibility conditions. These are used in the proof obligations of an event (3.2.4.4.6).
- Example
For some constructs, an example is provided to clarify their use.