3. The Merge-and-Shrink Framework
3.2. Factored Representations
3.2.4. Factored Transformations
Analogously to how factored transition systems represent their product systems compactly and how FMs represent mappings compactly, we can also use factored transformations to represent transformations between factored transition systems compactly. A factored transformation trans- forms a factored transition system and provides the state mapping through a set of FMs. Hence factored transformations exclusively work on the factored representation of transition systems, without the need to explicitly represent the potentially prohibitively large product system. Definition 3.11 (FM Defined on a Factored Transition System). An FM defined on a factored transition system F is an FM whose variables are the factors of F , and the domain of each variableΘ∈ F is the set of states of Θ.
The most simple FM defined on F is the projection FM, written πΘ, whose table projects a
given state of F , i.e. a set of assignments of the factors of F to their states, to its associated variable Θ. Formally: πΘ is an atomic FM defined on F with variable Θ and a table function
that, for any state s = {Θ 7→ s[Θ] | Θ ∈ F } of F , is defined as πtab
Θ (s) = s[Θ]. Projection
FMs are useful to define identity mappings on factors of a factored transition system: their tables represent the identity function from states of Θ to states of Θ. We use projection FMs for those parts of factored transformations that do not change the factors of a factored transition system.
We further say that an FM σ is associated with a transition system Θ, written σΘ, if it maps to
the states S of Θ, i.e. vals(σΘ) = S. Since vals(πΘ) = Sfor the states S of Θ, the projection
FM πΘis associated with Θ.
In the following, we write Σ for sets of FMs and σ (instead of M as before) for single FMs of such a set Σ of FMs for a clear distinction (both σ and Σ represent state mappings). Using FMs defined on a factored transition system that are associated with the factors of the transformed factored transition system, we can represent the state mappings of factored transformations of F, as the following definition states.
Definition 3.12 (Factored Transformation). A factored transformation of a factored transition systemF with label set L into a factored transition system F′ with label setL′ is a tupleτF =
⟨F′, Σ, λ⟩, where
• F′is called thetransformed factored transition system,
• Σ is an indexed collection (σΘ′)Θ′∈F′ of FMs6called thestate mapping, where each FM σΘ′ is defined onF and associated with Θ′ (i.e.maps to the states ofΘ′), and
• λ : L → L′is called thelabel mapping.
Thetransformation induced by τFis a transformation ofNF intoNF′ which is defined as
τ =⟨NF′, σ, λ⟩, where σ(s) = {Θ′ 7→ σ
Θ′(s)| Θ′∈ F′} for all states s ∈NF . 6That is, it is a collection of FMs, consisting of one FM σ
Θ′for each Θ ′
Factored transformations generalize (non-factored) transformations in a natural way: they consist of the same components (a transformed transition system, a state mapping, and a label mapping), but use factored representations for transition systems and state mappings. In the following, we may refer to factored transformations as transformations where this does not lead to ambiguities.
In a factored transformation of F into F′ with |F | = n and |F′
| = m, the state mapping Σ can be understood as a function with n inputs and m outputs. The m outputs are represented by having a different FM associated with each of the m factors of F′, and the n inputs correspond
to the n (input) variables of each FM (all FMs are defined on F and hence have the factors of F as associated variables). Such n-to-m functions compose naturally, and this composition can also be implemented directly based on the FM representations: if Σ′ is another state mapping
for a factored transformation of F′ into a factored transition system F′′ with |F′′
| = k, then Σ′◦ Σ can be represented as a collection of FMs where each element σ′′
Θ′′ can be constructed from the tree representation of σ′
Θ′′by replacing each leaf associated with factor Θ′with the tree representation of σΘ′. Equipped with this observation, it is easy to formalize the composition of factored transformations.
Proposition 3.1. Let τF = ⟨F′, Σ, λ⟩ be a factored transformation of a factored transition
systemF into a factored transition system F′ withΣ = (σΘ′)Θ′∈F′, and letτF′ = ⟨F′′, Σ′, λ′⟩ be a factored transformation ofF′into a factored transition systemF′′withΣ′ = (σ′
Θ′′)Θ′′∈F′′. ThenτF′′ = ⟨F′′, Σ′′, λ′′⟩ is a factored transformation of F into F′′, where λ′′ = λ′ ◦ λ and
Σ′′ = Σ′◦ Σ with Σ′′(s) = (σΘ′ ′′((σΘ′)Θ′∈F′(s)))Θ′′∈F′′ for all statess ∈ F . We also write τ′
F◦ τFforτ′′ F.
Algorithm1shows pseudocode for the construction of the set Σ′′ = Σ′◦ Σ of FMs of a com-
posed factored transformation, given the two sets Σ, Σ′of FMs used for the two component fac-
tored transformations. The outer function, COMPOSESETSOFFMS, iterates over the elements of
Σ′, i.e. the FMs of the second factored transformation (line3). As stated above, starting from the representation of each such σ′
Θ′′mapping to one factor Θ′′of the transformed factored transition system F′′, the algorithm builds the composed FM σ′′
Θ′′associated with the factor Θ′′and stores it at Σ′′[Θ′′](line 4). Constructing σ′′
Θ′′ is done in the function COMPOSEELEMENT in line8 as follows. If σ′
Θ′′ is a merge, the algorithm recursively “follows the tree” underlying σ′Θ′′ by computing a merge FM consisting of the same components as those of σ′
Θ′′, however composed with Σ, and the same table function as σ′
Θ′′(line9). Otherwise, if σΘ′ ′′ is atomic, the recursion ends and instead of also copying the leaves of σ′
Θ′′, the algorithm uses the relevant outputs of the FMs of Σ: in line12, it copies the FM Σ[var(σ′
Θ′′)]of Σ associated with the variable of σΘ′ ′′, i.e. Σ[var(σ′
Θ′′)]is the FM in Σ that computes a result relevant to the input of σΘ′ ′′, and adapts the table of that copy by applying the table function of σ′
Θ′′to it (line13), i.e. the resulting FM σnewis defined on F and maps to states of Θ′′as desired.
We illustrate the composition just described with the example shown in Figure3.5. There are three variables v1, v2, and v3, each with domain {0, 1}, and hence the original factored transition
system F consists of three factors Θv1, Θv2, Θv3. The transformed factored transition system
of the first transformation, F′, consists of three factors Θ′
1, Θ′2, and Θ′3. As we will see, Θ′1and
Θ′2are the products of two atomic factors, however further abstracted, and Θ′3is a (unmodified) merge of two atomic factors. F′′, the transformed factored transition system of the second
Algorithm 1 Composition of sets of FMs in a composed factored transformation.
Input: Set Σ of FMs defined on F and associated with the factors of F′, and set Σ′ of FMs
defined on F′ and associated with the factors of F′′.
Output: Set Σ′′= Σ′◦ Σ of FMs defined on F and associated with the factors of F′′.
1: function COMPOSESETSOFFMS(Σ, Σ′) 2: Σ′′=∅
3: for σΘ′ ′′ ∈ Σ′do
▷ Build the FM Σ′′[Θ′′] (also written σ′′
Θ′′) by composingσ′Θ′′ (associated with Θ′′∈ F′′) withΣ.
4: Σ′′[Θ′′]← COMPOSEELEMENT(Σ, σΘ′ ′′)
5: end for
6: return Σ′′ 7: end function
8: function COMPOSEELEMENT(Σ, σΘ′ ′′)
9: if σ′Θ′′is a merge with components σLand σRthen
▷ Build the merge FM from the given components and table.
10: return MERGEFM(COMPOSEELEM.(Σ, σL),COMPOSEELEM.(Σ, σR), σΘ′tab′′)
11: else
▷ var(σ′Θ′′) is the associated variable of the atomic FM σ′Θ′′and hence a factor of F .
12: σnew← COPYOF(Σ[var(σ′Θ′′)]) ▷ Apply σ′tabΘ′′ toσnewtab.
13: σnewtab ← COMPOSETABLE(σΘ′tab′′, σnewtab)
14: return σnew
15: end if 16: end function
0 1 0 0 1 1 0 1 σΘ0 1 σΘv1 σΘv3 0 1 0 0 1 1 1 0 σΘ0 2 σΘv2 σΘv3 0 1 0 0 1 1 2 3 σΘ0 3 σΘv1 σΘv2 (a) Σ: set of FMs of the first factored transformation.
0 1 0 0 1 1 2 3 σΘ00 1 σΘ0 1 σΘ02 0 1 2 3 0 0 1 2 2 σΘ002
(b) Σ′: set of FMs of the second factored transformation.
0 1 0 0 1 1 2 3 C(σΘ00 1) 0 1 0 0 1 1 0 1 C(σΘ0 1) 0 1 0 0 1 1 1 0 C(σΘ0 2) C(σΘv1) C(σΘv3) C(σΘv2) C(σΘv3) 0 1 0 0 1 1 2 2 C(σΘ00 2) C(σΘv1) C(σΘv2)
(c) Σ′◦ Σ: set of FMs of the composed factored transformation.
Figure 3.5.: Illustration of the composition of sets of FMs as used in factored transformations. transformation, consists of two factors Θ′′
1 and Θ′′2. As we will see, Θ′′1 is the (unmodified)
product of Θ′
1and Θ′2 and Θ′′2 is an abstraction of Θ′3. Before explaining how the FMs of these
transformations can be composed using Algorithm1, we discuss the two transformations and their FMs in detail.
In part (a) of the figure, we see three FMs forming the set Σ, representing the state mapping of the first factored transformation, i.e. the mapping from states from F to states of F′. We omit
tables of leaves that represent the identity function on the variables of the leaves. The three FMs σΘ′
1, σΘ ′
2, and σΘ ′
3 are defined on F and associated with the factors Θ
′
1, Θ′2, and Θ′3of F′. They
are all merge FMs with two (different) atomic component FMs, where the first two FMs (σΘ′1
and σΘ′
2) represent non-identity mappings on the product of their component factors, and the third FM (σΘ′3) represents the identity mapping on the product of its component factors. Since
the variables of the FMs are not disjoint, this is an example of a non-orthogonal set of FMs. (For this reason, σΘv1, σΘv2, and σΘv3 are not unique but rather should be understood as different copies of the same FMs.)
The FMs of the second transformation, defined on F′ and representing the state mapping
from F′ to F′′, are shown in part (b), again omitting tables of leaves that represent the identity
function on the variables of the leaves: σΘ′′1 is associated with factor Θ
′′
1 and is a merge with
components σΘ′1 and σΘ′2 and hence variables Θ′1 and Θ′2, representing the identity mapping of
on the product of its two component factors. σΘ′′
2 is associated with factor Θ
′′
2and is atomic with
variable Θ′
transformation in isolation here, σΘ′1 and σΘ′2 of Σ′are not the same FMs as those of the same
name in Σ: the two FMs are merges in Σ, mapping from states of F to Θ′
1and Θ′2, whereas the
two FMs are atomic in Σ′, representing identity mappings on the states of Θ′
1 and Θ′2.
We now describe how to compute the composition. Part (c) shows the set Σ′′ of composed
FMs, using C(. . . ) to show that the FMs are copies of the FMs in Σ and Σ′. To compute σ Θ′′
1 of Σ′′, Algorithm1starts with the representation of σΘ′′
1 of Σ
′by calling COMPOSEELEMENT(Σ,
σΘ′′
1). Since σΘ ′′ 1 of Σ
′ is a merge, the algorithm returns in line9, computing the result as the
merge of the components of σΘ′′ 1 of Σ
′, however recursively composed with Σ. Both recursive
calls end recursion in the next layer, where the FMs σΘ′
1 and σΘ′2 of Σ (the FMs in Σ associated with the associated variables Θ′
1 and Θ′2 of σΘ′1 and σΘ′2 of Σ′) are used by copying them and
applying the table function of σΘ′
1 and σΘ′2 of Σ
′ to the copies. Hence the resulting FM σ Θ′′
1 of Σ′′has the same root table as σ
Θ′′ 1 of Σ
′, however its components (since they are atomic and
hence leaves) have been replaced with copies of σΘ′1 and σΘ′2 of Σ. In this example, σΘ′1 and
σΘ′ 2 of Σ
′′ have the same tables as σ Θ′
1 and σΘ′2 of Σ because σΘ′1 and σΘ′2 of Σ
′ have tables
representing the identity function on their variables.
To compute σΘ′′2 of Σ′′, the algorithm calls COMPOSEELEMENT(Σ, σΘ′′2) with σΘ′′2 of Σ′.
Since σΘ′′ 2 of Σ
′ is atomic, the algorithm copies the FM σ Θ′
3 of Σ (which is associated with Θ′3, the associated variable of σΘ′′
2 of Σ
′), and applies the table of σ Θ′′
2 of Σ
′ to that copy. The
resulting FM σΘ′′2 of Σ′′hence is a modified copy of σΘ′3 of Σ: the table of σΘ′′2 of Σ′ has been
applied to the table of σΘ′3 of Σ, which now maps ⟨1, 1⟩ to 2 rather than to 3 as in the first
transformation.
To conclude the example, in both cases, the resulting FMs are the trees that result from re- placing the leaves of the FMs of the second transformation with the correct FMs of the first transformation, namely those that map to states of the factor for which an associated FM should be composed, but with the tables of the copies modified through applying the table function of the FM of the second transformation.
To summarize the concept of factored and non-factored transformations, Figure3.6illustrates the relationship between non-factored and factored transformations, and the compositions of both. It shows factored transformations and their compositions on the left and the induced transformations and their compositions on the right. We conclude that for the final result, it does not matter whether we work on a factored representation or a non-factored representation of a transition system; in the end, we can always obtain a transformation of the originally given transition system (or the product of the originally given factored transition system) into the transformed transition system.