3. The Merge-and-Shrink Framework
3.2. Factored Representations
3.2.5. Merge-and-Shrink Algorithm
Armed with factored representations of transition systems, (state) mappings, and transforma- tions, we are now ready to present the merge-and-shrink algorithm in its general form.
Given a factored transition system F , such as a factored transition system induced by a plan- ning task, the goal of the merge-and-shrink algorithm is to compute a heuristic for the product system NF of F . It does so by computing an induced abstraction (for the reachable states) ofNF, which induces a heuristic for NF. This means the algorithm has to compute both the transition system induced by the abstraction and the abstraction function itself, i.e. a state
F F0 F00 NF NF0 NF00 product system product system product system τF=hF0, Σ, λi τF0 =hF00, Σ0, λ0i τ =hNF0, σ, λi τ0=hNF00, σ0, λ0i induced transformation induced transformation τ 0 F◦ τF = hF 00 ,Σ 0◦ Σ ,λ 0 ◦ λi τ 0 ◦ τ = h N F 00 ,σ 0 ◦σ ,λ 0 ◦ λ i
Figure 3.6.: Illustration of the composition of transformations, factored transformations, and the relationship between factored and non-factored (compositions of) transformations. mapping from the given to the abstract transition system. Since transition systems of practi- cal interest are usually too large to be explicitly represented, the merge-and-shrink framework directly operates on the factored representation of all involved components. In particular, it rep- resents the input transition system as a factored transition system and then repeatedly modifies this factored transition system through a sequence of factored transformations until only one factor is left. To represent the state mapping, the algorithm also maintains a set of FMs that jointly represent the mapping from the original factored transition system to the current one.
Algorithm 2 shows pseudocode of the merge-and-shrink framework. During the initializa- tion, the algorithm first copies the input factored transition system F′ for further modifications
(line 2). It then computes the set Σ of projection FMs πΘ′ for each factor Θ′ of F′ (line3), which thus represent the identity state mapping on F′. As a last step of the initialization, the
algorithm also computes the identity mapping λ on the labels L of F′ (line4). Since F′ = F
after the initialization, ⟨F′, Σ, λ⟩ is a (trivial or identity) factored transformation of F into F′
at this point. This is also the invariant of the algorithm: after applying a transformation, it is guaranteed that ⟨F′, Σ, λ⟩ is a factored transformation of F into the current F′.
The algorithm continues with the main loop, where in each iteration, it selects a transformation ⟨F′′, Σ′, λ′⟩ of the current factored transition system F ’ in line6. It “applies the transformation
to F′”, which means to compose it with the current factored transformation ⟨F′, Σ, λ⟩ (lines
7–9), hence ensuring that the invariant is restored. If there is only one factor Θ′ left in F′, and
hence only one FM σΘ′ left in Σ that is defined on F and associated with Θ′, the algorithm returns these two elements. As we will see in the following sections, the merge-and-shrink transformations all satisfy properties such that the final transition system Θ′ is an abstraction
Algorithm 2 Merge-and-shrink algorithm operating on factored representations. Input: Factored transition system F .
Output: Transition system Θ and FM σ mapping from states ofNF to states of Θ.
1: function MERGEANDSHRINK(F )
▷ Copy the input factored transition system.
2: F′ ← F
▷ For each factor Θ′ ofF′, compute the projection FMπΘ′ that projects states ofF′to the component states ofΘ. Σ represents the identity mapping on F′.
3: Σ← {πΘ′ | Θ′ ∈ F′}
▷ Initialize λ as the identity function on labels L of F′.
4: λ← idL
5: while |F′| > 1 do
6: ⟨F′′, Σ′, λ′⟩ ← SELECTTRANSFORMATION(F′, Σ, λ)
▷ Update the current transformation⟨F′, Σ, λ⟩ to be the composition of the current
with the selected transformation⟨F′′, Σ′, λ′⟩.
7: F′← F′′
8: Σ← Σ′◦ Σ
9: λ← λ′◦ λ
10: end while
11: Θ′ ← the single element of F′
12: σΘ′ ← the single element of Σ
13: return ⟨Θ′, σΘ′⟩
merge-and-shrink heuristic for F is the heuristic for hσΘ′
N F induced by
N
F and σΘ′.
There are four types of transformations that the algorithm can choose from in SELECTTRANS- FORMATIONwhich we describe in more detail in the following sections: merge transformations
combine two factors of F′ into one, reducing the size of F′ by 1; shrink transformations ap-
ply abstractions to one of the factors of F′; prune transformations “discard” (a subset of the)
dead states; and label reductions map the common label set of F′to a smaller set. Each of the
transformation types also represents a parameter of the merge-and-shrink framework: a merge strategyspecifies which two factors to merge, and similarly, a shrink strategy, a prune strategy and a label reduction strategy determine how exactly to shrink, prune and reduce labels when- ever such a transformation shall be applied. We will collectively refer to these as transformation strategies.
Furthermore, a concrete instantiation of the algorithm also has to specify which transforma- tion to choose in each iteration, and it may provide further global parameters that influence the behavior of the transformation strategies, such as a global limit on the number of permitted abstract states. In Section3.7, we describe a specific instantiation of the merge-and-shrink algo- rithm in detail and also provide more details on transformation strategies and other parameters of the algorithm.
Before proceeding with the merge-and-shrink transformations in the following sections, we briefly comment on two key aspects of such transformations that we need to consider: firstly, we need to define how each factored transformation works, i.e. what kind of state and label mappings it applies and how the transformed factored transition system is defined. Secondly, we must be able to compose the factored transformation with any previous transformation. To do so efficiently, we need to build upon the state and label mapping of the previous factored transformations. While this is simple for label mappings, which are (non-factored) functions that can just be composed, this can be more involved for composing sets of FMs, as we have discussed before. In particular, for an efficient computation of the merge-and-shrink algorithm, it will be important to not copy all of the FMs each time we compose two sets of FMs that are part of two factored transformations that should be composed.