Difference between revisions of "Rewriting rules for event model decomposition"

From Event-B
Jump to navigationJump to search
imported>Pascal
imported>Pascal
Line 1: Line 1:
 
The purpose of this page is to list and justify the rewriting / simplification rules applied in the event model decomposition when building the ''external'' events, and more especially their actions.
 
The purpose of this page is to list and justify the rewriting / simplification rules applied in the event model decomposition when building the ''external'' events, and more especially their actions.
  
== Rewriting rules for the Event-B assignments ==
+
== Rewriting rules on Event-B assignments ==
 
As detailed in [[Actions_(Modelling_Language)|the modelling language]], the Event-B assignments are formed of two parts:  
 
As detailed in [[Actions_(Modelling_Language)|the modelling language]], the Event-B assignments are formed of two parts:  
 
* a left-hand side, which is a list of free identifiers.
 
* a left-hand side, which is a list of free identifiers.
Line 11: Line 11:
 
* The <math>\bcmin</math> ("becomes member of") assignment is the set-based (non-deterministic) assignment, where a set expression is given for the assigned identifier.
 
* The <math>\bcmin</math> ("becomes member of") assignment is the set-based (non-deterministic) assignment, where a set expression is given for the assigned identifier.
  
Let <math>v</math> and <math>w</math> be variables, and <math>E</math> and <math>F</math> be expressions. In the following table, the left-hand assignments are equivalent (<math>\defi</math>) to the right-hand ones:
+
Let <math>v</math> and <math>w</math> be variables, and <math>E</math> and <math>F</math> be expressions. In the following table, the left-hand assignments are equivalent to the right-hand ones:
 
{{SimpleHeader}}
 
{{SimpleHeader}}
 
|-
 
|-
Line 23: Line 23:
 
|}
 
|}
  
Thus, each Event-B assignment can be expressed in a "becomes such that" form.
+
Thus, each Event-B assignment can be expressed in a "becomes such that" form, and more precisely as <math>v_1,...,v_n \bcmsuch P(v_1,...v_n,v_1',...v_n')</math>, where <math>P</math> is a before-after predicate.
  
 
== Simplification rules on Event-B predicates ==
 
== Simplification rules on Event-B predicates ==
* If <math>P(x_1,...,x_n,y)~</math> is equal (<math>\defi</math>) to <math>y = Q(x_1,...,x_n)~</math>, then the <math>\exists y.P(x1,...,x_n,y)</math> predicate is true, and it may be deleted in conjunctive predicates (<math>\land</math>) where it appears.  
+
* If <math>P(x_1,...,x_n,y)~</math> is equal to <math>y = Q(x_1,...,x_n)~</math>, then the <math>\exists y.P(x1,...,x_n,y)</math> predicate is true, and it may be deleted in conjunctive predicates (<math>\land</math>) where it appears.  
 
* The <math>(\exists z.P(x_1,...,x_n,z) \land Q(y_1,...,y_m))</math> predicate, where <math>z \notin \{y_1,...,y_n\}</math>, may be rewritten as <math>(\exists z.P(x_1,...,x_n,z)) \land Q(y_1,...,y_m)</math>.
 
* The <math>(\exists z.P(x_1,...,x_n,z) \land Q(y_1,...,y_m))</math> predicate, where <math>z \notin \{y_1,...,y_n\}</math>, may be rewritten as <math>(\exists z.P(x_1,...,x_n,z)) \land Q(y_1,...,y_m)</math>.
  
== Rewriting rules for the Event-B actions ==
+
== Rewriting rules on Event-B actions ==
Let <math>v</math> and <math>w</math> be variables, and  <math>P</math> and <math>Q</math> be predicates. The following equivalence applies :
+
Let <math>v</math> and <math>w</math> be variables, and  <math>P</math> and <math>Q</math> be predicates. The following equivalence applies:
  
 
{|
 
{|

Revision as of 09:57, 3 July 2009

The purpose of this page is to list and justify the rewriting / simplification rules applied in the event model decomposition when building the external events, and more especially their actions.

Rewriting rules on Event-B assignments

As detailed in the modelling language, the Event-B assignments are formed of two parts:

  • a left-hand side, which is a list of free identifiers.
  • a right-hand side.

There are various kinds of assignments:

  • The \bcmsuch ("becomes such that") assignment is the most general (non-deterministic) assignment, where a predicate is given on the before and after values of assigned identifiers. The after values of the assigned identifiers are denoted by a primed identifier whose prefix is the assigned identifier.
  • The \bcmeq ("becomes equal to") assignment is the deterministic assignment where an expression is given for each assigned identifier.
  • The \bcmin ("becomes member of") assignment is the set-based (non-deterministic) assignment, where a set expression is given for the assigned identifier.

Let v and w be variables, and E and F be expressions. In the following table, the left-hand assignments are equivalent to the right-hand ones:

v \bcmeq E v \bcmsuch v' = E
v,w \bcmeq E,F v \bcmeq E \pprod w \bcmeq F
v(E) \bcmeq F v \bcmeq v \ovl \{E \mapsto F\}
v \bcmin E v \bcmsuch v' \in E

Thus, each Event-B assignment can be expressed in a "becomes such that" form, and more precisely as v_1,...,v_n \bcmsuch P(v_1,...v_n,v_1',...v_n'), where P is a before-after predicate.

Simplification rules on Event-B predicates

  • If P(x_1,...,x_n,y)~ is equal to y = Q(x_1,...,x_n)~, then the \exists y.P(x1,...,x_n,y) predicate is true, and it may be deleted in conjunctive predicates (\land) where it appears.
  • The (\exists z.P(x_1,...,x_n,z) \land Q(y_1,...,y_m)) predicate, where z \notin \{y_1,...,y_n\}, may be rewritten as (\exists z.P(x_1,...,x_n,z)) \land Q(y_1,...,y_m).

Rewriting rules on Event-B actions

Let v and w be variables, and P and Q be predicates. The following equivalence applies:

v~ \bcmsuch P(v,v')
w \bcmsuch Q(w,w')
    \defi\;\; v,w \bcmsuch P(v,v') \land Q(w,w')

Simplification rules based on Event-B proof obligations