Rewriting rules for event model decomposition: Difference between revisions
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'' | The purpose of this page is to list and justify the rewriting / simplification rules applied in the event model decomposition, when building the actions of an ''external'' event of a sub-machine from those of an initial event in the non-decomposed machine. | ||
== Equivalence relation == | == Equivalence relation == | ||
It is possible to define an equivalence relation on the Event-B actions, and by | It is possible to define an equivalence relation on the Event-B actions, and by restriction on the Event-B assignments. Two actions are considered as being equivalent if the proof obligations generated for these actions are logically equivalent. | ||
This relation is represented with the <math>\defi</math> symbol. | This relation is represented with the <math>\defi</math> symbol. | ||
Line 40: | Line 40: | ||
Let <math>x_i</math>, <math>y</math> and <math>z</math> be variables, and <math>P</math> and <math>Q</math> be predicates. | Let <math>x_i</math>, <math>y</math> and <math>z</math> be variables, and <math>P</math> and <math>Q</math> be predicates. | ||
* <font id="rule_6">Rule 6</font>: 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. | * <font id="rule_6">Rule 6</font>: 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. | ||
* <font id="rule_7">Rule 7</font>: The <math>(\exists z | * <font id="rule_7">Rule 7</font>: The <math>(\exists z \qdot P(x_1,...,x_n,z) \land Q(y_1,...,y_m))</math> predicate, where <math>z \notin \{x_1,...,x_n,y_1,...,y_m\}</math>, may be rewritten as <math>(\exists z \qdot P(x_1,...,x_n,z)) \land Q(y_1,...,y_m)</math>. | ||
* <font id="rule_8">Rule 8</font>: The <math>\exists z \qdot P(x_1,...,x_n,z)</math> predicate may be deleted in conjunctive predicates where it appears if the <math>y \bcmsuch P(x_1,...,x_n,y')</math> assignment is among the actions of the initial event. It indeed is nothing else but the feasibility (FIS) proof obligation for such an assignment, and a model to be decomposed is assumed to be proved (see the section related to the [[Event_Model_Decomposition#po|proof obligations]] in the event model decomposition). | |||
<font | |||
== Example == | == Example == |
Revision as of 16:33, 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 actions of an external event of a sub-machine from those of an initial event in the non-decomposed machine.
Equivalence relation
It is possible to define an equivalence relation on the Event-B actions, and by restriction on the Event-B assignments. Two actions are considered as being equivalent if the proof obligations generated for these actions are logically equivalent.
This relation is represented with the symbol.
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 ("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 ("becomes equal to") assignment is the deterministic assignment where an expression is given for each assigned identifier.
- The ("becomes member of") assignment is the set-based (non-deterministic) assignment, where a set expression is given for the assigned identifier.
Let and be variables, and and be expressions. In the following table, the left-hand assignments are equivalent () to the right-hand ones (see the B-book):
Rule 1 | ||
Rule 2 | ||
Rule 3 |
Thus, each Event-B assignment can be expressed in a "becomes such that" form, and more precisely as , where is a before-after predicate.
Rewriting rules on Event-B actions
Let and be variables, and be expressions, and and be predicates. The left-hand actions are equivalent () to the right-hand ones:
Rule 4 | ||
Rule 5 |
Simplification rules on Event-B predicates
Let , and be variables, and and be predicates.
- Rule 6: If is equal to , then the predicate is true, and it may be deleted in conjunctive predicates () where it appears.
- Rule 7: The predicate, where , may be rewritten as .
- Rule 8: The predicate may be deleted in conjunctive predicates where it appears if the assignment is among the actions of the initial event. It indeed is nothing else but the feasibility (FIS) proof obligation for such an assignment, and a model to be decomposed is assumed to be proved (see the section related to the proof obligations in the event model decomposition).
Example
Let , and be variables, and and be predicates.