# Union Models for Model Families: Efficient Reasoning over Space and Time
## 2 Motivation
Such asynchronous evolution sometimes requires that older versions of models (which represent legacy models) need to be maintained, as they may remain in use even after being superseded by newer versions. This is an issue over the time dimension, and can be witnessed in the space dimension as well (i.e., along configurations). In this scenario, legacy models and new models need to co-exist together in one model in order to be analyzed together. Similar challenges exist in the software engineering field, particularly in the Software Product Line (SPL) domain, where products vary over the space dimension and may evolve over time as well. By nature, an SPL encodes a set of related product variants; thus, dealing with the evolution of multiple products over time means that developers should  
Figure 2: Goal model family of regulations with variability in space and time. consider an additional dimension of variability by reasoning about sets of products. This combination of variation and evolution is not well supported by existing SPL engineering techniques, and only a few recent approaches in the literature have tried to address this issue. For example, [PERSON] et al. [14] and [PERSON] et al. [15] considered variation of SPLs in space and time and proposed a so-called 175% modeling formalism to allow for the development and documentation of evolving product lines. In their paper, they urged the community to extend annotative variability modeling to tackle evolution and variation by the same means. [PERSON] et al. [16] proposed an approach for combining SPLs with partial models to represent design-time uncertainty. The resulting artifact, called Software Product Lines with Design Choices (SPLDCs), integrates variability and design-time uncertainty in a common formalism to help developers differentiate between the kinds of decisions that are relevant during the design and configuration stages of the SPL lifecycle. The above-mentioned three challenges (especially the first one) and the gaps identified in the literature motivate the need to find a way to represent model families other than using separate individual models. This paper proposes _union models_ (\(M_{U}\)) as a generic modeling artifact to capture all model elements in all members of a model family _MF_, aggregated in a compact and exact way such that analysis of a group of models is faster than for individual models and where members of a family can be extracted and analyzed. Generally speaking, a union model \(M_{U}\) of any potential model family would be the union of all elements \(e\) in all individual models \(M_{i}\) of the family _MF_; that is,  
\[M_{U}=(\bigcup_{i=1}^{|M_{i}|}\bigcup_{j=1}^{|M_{i}|}e_{i,j}) \tag{1}\]  
In addition, the elements of the resulting union model need to be annotated in a way that enables the identification of variants. For illustration purposes, an \(M_{U}\) that captures the model family shown in Figure 1 is represented in Figure 3, with all elements (i.e., goal and links) of the union model included and annotated with space information (TYPES in this example) to distinguish which element belongs to which model variant. Note that each member of the model family is embedded in the union model, i.e., for each \(M_{i}\in MF\) there exists an embedding \(i:M_{i}\to M_{U}\) defined by \(i(e)=e\). Moreover, we can retract any model \(M_{i}\) in the family from the union model by the partial mapping \(r_{i}:M_{U}\to M_{i}\), where \(r_{i}(e)=e\) if \(e\) is annotated with \(M_{i}\) and is undefined otherwise. Hence, the union model is complete in the sense that it includes all information available in any member of the modeling family, and is complete in the sense that we can reconstruct each member of modeling family from it.