Comparative Expressiveness of Product Line Calculus of Communicating Systems and 1-Selecting Modal Transition Systems

. Product line calculus of communicating systems (PL-CCSs) is a process calculus proposed to model the behavior of software product lines. Modal transition systems (MTSs) are also used to model variability in behavioral models. MTSs are known to be strictly less expressive than PL-CCS. In this paper, we show that the extension of MTSs with hyper transitions by Fecher and Schmidt, called 1-selecting modal transition systems (1MTSs), closes this expressiveness gap. To this end, we propose a novel notion of reﬁnement for 1MTSs that makes them more suitable for specifying variability for software product lines and prove its various essential properties.


Introduction
Variability modeling is a cornerstone of software product line (SPL) engineering, through which an inventory of commonalities and differences among different products are specified in a structured manner.Efficient analysis of variabilityintensive systems is a major challenge due to the potentially large number of valid products.To this end, many techniques have been adapted, which exploit variability in different types of analysis.A basic building block of many of these techniques is a model for capturing variability at the structural or behavioral level.In this paper, we focus on formal behavioral models that can be used to capture variability; examples of such models include modal transition systems (MTSs) [18], product line calculus of communicating systems (PL-CCS) [14], and featured transition systems (FTSs) [10].
In a previous paper [9], we studied the comparative expressiveness of these formalisms with respect to the set of products (labeled transition systems (LTSs)) they can specify.There, we proved that MTSs are strictly less expressive than PL-CCS (and its underlying semantic model, product line labeled transition systems (PL-LTSs)).A formalism that was not studied in our previous paper [9] is 1-Selecting Modal Transition System (1MTS) [12], which extends modal transition systems with (must/may) hyper transitions.Such hyper transitions bundle a number of possible behavior, of which exactly one will be included in each valid product.Using 1MTSs it is possible to model alternative behaviour (choices with XOR relation) in products, which cannot be modeled using MTSs.Intuitively, this seems the very missing modeling feature in order to fill the expressiveness gap between MTSs and PL-LTSs.
In this paper, we show that this extension is indeed sufficient to close the expressiveness gap between MTS and PL-LTS (see Section 5).Furthermore, we observed that by considering the current refinement relation provided for 1MTSs, some aspects of behavioral variability, such as persistent choices in recursive specifications, cannot be modeled satisfactorily (see Section 3).Hence, we propose a new refinement relation for 1MTSs which addresses these concerns (see Section 4) and also leads to more succinct models, and we show that the new refinement relation enjoys the same intuitive properties as the original one [12].The other direction of comparison (from 1MTSs to PL-LTSs) is left as a future work.However, we conjecture that encoding 1MTSs into PL-LTSs is also possible.

Preliminaries
In this section, we explain some basic concepts regarding software product lines, 1-selecting modal transition systems, and product-line labeled transition systems that are used throughout the rest of the paper.

Software Product Lines
The products in a software product line are developed from a common core.The commonalities and variabilities among products are usually described in terms of features.A feature is a distinctive user-visible aspect or characteristic of the system [15].The products in a product line can be described as sets of features.There are different types of relations between features in a product line.We explain some of these relations using an example of a vending machine product line.The product line includes three mandatory features, namely, Coin, Drink, and Coffee, which means all the products in this product line should include these three features.There are two types of coin, namely, Dollar and Euro which have alternative relation.This means that a product in this product line can either accept dollar or euro coins but not both.The Drink feature has two sub-features as well, namely, Tea and Coffee.The Tea is an optional feature.This means that a product in this product line can offer both tea and coffee or only coffee as drinks (since, Coffee is a mandatory feature).

1-Selecting Modal Transition Systems
Fecher and Schmidt [12] introduced the following definition of 1MTSs.

Definition 1 (1MTS)
. A 1-selecting modal transition system, is a tuple (S, A, → , , s init ), where: -S is a set of states or processes, -A is a set of actions, is the may hyper transition relation, s init ⊆ S, is a non-empty set of initial states.
In each 1MTS, the relation →⊆ holds between the sets of may-and must hyper transitions.This means that must hyper transitions also implicitly represent may hyper transitions.
We use 1MTS, to denote the class of all 1MTSs.
Based on the above definition, there are two types of hyper transitions in a 1MTS, called may-and must hyper transitions.A may hyper transition represents a set of alternative choices which are optional (at most one of the choices can be selected).On the other hand, a must hyper transition represents a set of alternative choices where selecting one of the choices is obligatory.Furthermore, we assume that for each state s, (s ) = {γ | (s, γ) ∈ }.A simple example of a 1MTS is provided in Fig. 1.This 1MTS represents the behavior of products in the vending machine product line.
In order to define how a transition among those in a hyper transition is chosen, the following notion of choice function is used.
Definition 2 (Choice Function).Let A be a set, and B ⊆ 2 A and γ : B → A. Then γ is a choice function if ∀ b∈B : γ(b) ∈ b.The set of all choice functions on B is defined by choice(B) As 1MTSs are abstract models, one can associate with each 1MTS a set of 1MTSs that refine it by allowing for fewer optional choices.The refinement relation on 1MTSs is defined as follows [12].

Definition 3 (Refinement for 1MTSs
).A refinement relation between two 1MTSs such as M = (S, L, →, , s init ) and M = ( S, L, →, ¯, sinit ), is defined as a relation M is said to refine M , written as M M , when there exists a refinement relation R 1MTS relating each of the initial states of M to one of the initial states of M .
As a simple example in Fig. 2(1), a 1MTS is shown which refines the 1MTS in Fig. 1.In this 1MTS, the may hyper transitions are not present.
We define the concrete implementations of a 1MTS as labeled transition systems, defined below.Definition 4 (LTS).An LTS is a tuple (S, A, →, s init ), where S is a set of states, A is a set of actions, →: S × A × S is the transition relation, and s init is the initial state.We denote the class of LTSs by LTS.(We follow the definition given for LTSs as implementations of 1MTSs with single initial states in [12]) As a simple example in Fig. 2(2), an LTS is shown which refines the 1MTSs in Fig. 1 and 2(1).In this LTS, the may hyper transitions are not present and the alternative choice among the insert_euro and insert_dollar is resolved by choosing the former.

Product Line Process Algebras
Milner's Calculus of Communicating Systems (CCS) [20] is extended by Gruler et al. [14] into PL-CCS by introducing a new operator, called binary variant, to represent the alternative behavior.The introduced binary variant operator ⊕ i is different from the ordinary alternative composition operator + in CCS in that the binary variant choice is made once and for all.As an example, consider the process terms s = a.(b.s + c.s) and t = a.(b.t ⊕ 1 c.t); recursive process s keeps making choices between b and c in each recursion, while process t makes a choice between b and c in the first recursion after performing a, and the choice is recorded and respected in all the following iterations.This means that process t behaves deterministically after the first iteration with respect to the choice between b and c.To simplify the formal development of the theory, Gruler et.al. assume that in every PL-CCS term, there is at most one appearance of the operator ⊕ i for each and every index i.We use the same assumption throughout the rest of the paper, as well.
The semantics of a PL-CCS term is defined based on PL-LTSs [14], using a structural operational semantics, which is explained informally next.The states of a product line labeled transition system are pairs of ordinary states, i.e., process terms, and configuration vectors.The transitions of a PL-LTS are also labeled with configuration vectors.These vectors are of type {L, R, ?}I with I being an index set, L and R, respectively, denoting that the choice has been made in favor of the left-or right-hand-side term and ?denoting that the choice has not been made yet.
Definition 5 (PL-LTS).Let {L, R, ?}I denote the set of all total functions from an index set I to the set {L, R, ?}.A product line labeled transition system is a 5-tuple (P × {L, R, ?}I , A, I, →, p init ) consisting of a set of states P×{L, R, ?}I , a set of actions A, and a transition relation →⊆ (P×{L, R, ?}I )× (A × {L, R, ?}I ) × (P × {L, R, ?}I ), and an initial state p init ∈ P × {L, R, ?}I , satisfying the following restrictions: In Definition 5, the conditions follow from the operational rules given by Gruler et al. [14].The first condition indicates that the change in the configuration is identically reflected in the label and the target.The second condition indicates that a decision made on a choice is recorded as L or R in the configuration vector and would not change in the future.The third condition reflects that the configuration at index i can be resolved in at most one state; this follows immediately from the uniqueness of indices in PL-CCS terms.
In order to compare the expressiveness of 1MTS with PL-LTS, we define product derivation relation for a PL-LTS as follows [9].Definition 7 (Refinement for PL-LTSs).Let (P × {L, R, ?}I , A, →, p init ) be a PL-LTS and let (S, A, →, s init ) be an LTS.A binary relation R θ ⊆ S × (P × {L, R, ?}I ) (parameterized by every product configuration θ ∈ {L, R} I ) is a product-derivation relation if and only if the following transfer properties are satisfied: (a) ∀ P,Q,a,ν,ν ,s s R θ (P, ν) ∧ (P, ν) A state s ∈ S in an LTS is (the initial state of ) a product of a PL-LTS (P, ν) with respect to a configuration vector θ, denoted by (P, ν) θ s, if ν θ and there exists an R θ product-derivation relation such that s R θ (P, ν).
We say an LTS T = (S, A, →, s init ) is a valid implementation of a PL-LTS P = (P × {L, R, ?}I , A, I, →, p init ), denoted by T ≺ P if and only if there exists a configuration θ ∈ {L, R, ?}I such that p init θ s init .

Design Decisions
In this section, we study the refinement relation provided for 1MTSs by Fecher and Schmidt [12] (see Definition 3) and use some examples to point out a few issues in using this notion of refinement for product derivation.These issues lead us to design decisions for a new notion of refinement, introduced in the next section, that is more suitable for the setting of software product lines.
The first example concerns alternative behavior.Consider the PL-CCS terms s 0 = a.s 1 and s 1 = b.s 2 ⊕ 1 c.s 3 .The corresponding underlying PL-LTS is represented in Fig. 3(1).Then, consider the 1MTS shown in Fig. 3(2).Intuitively, this model may be considered as a solution to represent the same set of products using 1MTSs: it bundles the choice between the b-and c-labeled transitions into a must hyper transition.(Recall from Definition 1 that must hyper transitions intuitively represent mandatory choices.)However, in Fig. 3(3), a valid implementation of this 1MTS based on the refinement relation in Definition 3 is depicted.(The dashed arrows show how the states of the LTS and 1MTS are related using the refinement relation.)In the LTS implementation, both the b-and c-labeled transitions are included.A 1MTS that has the same implementations as the PL-LTS in Fig. 3(1), is given in Fig. 3(4); namely, the choice has been lifted to the initial states.This way, the exclusive behavior can be separated among the two parts of the model initiated in these two states.
The process of lifting choices to the initial states can lead to an exponential blow up in 1MTS representation of product lines.This is already hinted at by the 1MTS given in Fig. 3(4) and can be generalized as follows.Consider the 1MTS shown in Fig. 3(5).This model is similar to the 1MTS given in Fig. 3(2) with k = n/2 independent exclusive choices (modeled by k must hyper transitions).There are 2 k possible combinations of all choices.This model suffers from the same problem as described above, namely, the alternative transitions can be included simultaneously in some LTS implementations.As mentioned above, in order to model alternative behavior the solution is to use a model with several initial states where each part of the model includes one of the possible combinations.Hence, the model should include 2 k separate parts each with a different initial state.This issue severely compromises succinctness in 1MTS representation of product lines.
Another issue in using 1MTSs for modeling product lines concerns persistent choices.Assume that we add the term s 3 = d.s 1 to the aforementioned PL-CCS process term.This will lead to having a new state in the PL-LTS (s 1 , R ) and a transition from (s 3 , R ) to this state.As mentioned in Section 2.3, the decisions made about the exclusive choices are stored in configuration vectors.Hence, when going back again to s 1 , the choice that was made before, which is R, will not change.Using the current notion of refinement for 1MTSs, it is not possible to keep track of the choices that are made in the past.Assume that we want to model the same behavior (as in Fig. 3(1)) using 1MTSs.Assume a transition from state s 3 to state s 1 with label d is added to the 1MTS represented in Fig. 3(2).One of the valid implementations of such 1MTS is an LTS where b is chosen the first time reaching state s 1 and then c is chosen the next time that this state is reached.The solution to solve this problem, is the same as above (using several initial states) in addition to unrolling loops.
To address these 3 issues, namely, alternative behavior, succinct representation of choice, and persistence choice, we introduce a new notion of refinement for 1MTSs in the next section.
In this section, we propose a new refinement relation for 1MTSs to address the issues pointed out in the previous section regarding the original refinement relation [12].Then, we show that our new refinement relation preserves the intuitive properties posed for the original one [12].

New Refinement Relation
We revisit the refinement relation in Definition 3, and provide a new refinement relation for 1MTSs as follows.First, we define an auxiliary function, namely, the choice resolution function.
Definition 8 (Choice Resolution Function).Consider a 1MTS M =(S, L, → , , s init ).A choice resolution function is a total function Γ : S → s∈S choice(s ).We denote the set of all choice resolution functions of the 1MTS M by Γ M .
The purpose of defining the choice resolution function is to assign a choice function to each state of the 1MTS once and for all.Next, we give the refinement relation for 1MTSs as follows.
Definition 9 (New Refinement for 1MTS).Consider two arbitrary 1MTSs M = (S, L, →, , s init ) and M = (S , L, → , , s init ), we say M refines M , denoted by M M , iff there exists a refinement relation In the rest of the paper, we use R f,f 1M T S to denote a 1MTS refinement relation that follows the above definition (that uses choice resolution functions f and f ).In Fig. 4(1), an example of a 1MTS is given.Based on the Definition 3, the 1MTS in Fig. 4(2) is refining this 1MTS.However, based on the Definition 9, this is not a valid refinement for the 1MTS in Fig. 4(1).Hence, the problem with modeling alternative behavior that was mentioned in Section 3 is solved in the new definition.Similarly the problems with modeling the conciseness and the persistent behavior are solved.

Refinement Relation Properties
We prove a set of properties for the new refinement relation as follows.This is the same set of properties proven for the original 1MTS refinement relation by Fecher and Schmidt in [12].(Due to space limitation, the proofs are omitted and we will include them in an extended version of the paper.)First, we show that the new refinement relation is a preorder.Next, we show that all the LTS implementations of a 1MTS also implement the 1MTSs that are refined by this 1MTS.Proposition 3. Consider two arbitrary LTSs lts 1 and lts 2 such that lts 1 ∼ lts 2 , where ∼ denotes strong bisimilarity; it follows that lts 1 lts 2 .

Encoding PL-LTSs into 1MTSs
In order to compare the expressiveness of PL-LTSs with 1MTSs, following the approach provided by Beohar et al. in [9], we define an encoding from PL-LTSs into 1MTSs.The main idea of giving an encoding is to define a transformation from one class of models into the other class of models that is semantic preserving.First, we give the following auxiliary definitions taken from [9].
Definition 10 (Product Line Structure).A product line structure is a tuple M = (M, ), where M is the class of the intended product line models (in this paper 1MTSs and PL-LTSs) and : M → LTS is the semantic function mapping a product formalism to a set of product LTSs that can be derived from each product line model.
Next, we give the formal definition of an encoding.

Definition 11 (Encoding). An encoding from a product line structure
), is defined as a function E : M → M satisfying the following correctness criterion: = • E. We say a product line structure M is at least as expressive as M if and only if there exists an encoding E : M → M .
Before elaborating on the proposed encoding, we give two auxiliary definitions which are used for encoding the transitions of a PL-LTS into must/may hyper transitions of a 1MTS.As (hyper) transitions in a 1MTS are transitions with multiple targets (see Definition 1), we need to group some of the transitions in a PL-LTS, which correspond to resolving the same alternative choice, and encode them as a (may/must) hyper transition.To this end, we consider the type of changes that is made by a transition to the configuration vector of a PL-LTS.A transition for which the configuration vectors in the source and target states are not identical, is corresponding to resolving a choice (making a decision about one of the variant operators).We formally define the hyper must closed set and hyper may closed set as follows.
Definition 12 (Hyper Must Closed Set).Consider a state (P, ν) of a PL-LTS such as (P×{L, R, ?}I ,A,I,→, p init ); we assume that Out (P,ν) denotes the set of all outgoing transitions from state (P, ν) and Out (P,ν) δ denotes the set of outgoing transitions form (P, ν) that make a change in at least one of the elements of the configuration vector of the source state, i.e., for each (P, ν) , there exists an i ∈ I s.t.ν(i) =? ∧ ν (i) =?.A set T ⊆→ of transitions is hyper must-closed for (P, ν) when it is a maximal subset of Out (P,ν) δ such that: -For each (P, ν) a0,ν0 − −− → (Q 0 , ν 0 ) ∈ T , and each i ∈ I s.t.ν(i) = ν 0 (i) there exists a (P, ν) ) and for all j = i, ν 0 (j) ν 1 (j).
-For each two different transitions (P, ν) a0,ν0 We denote the set of all such maximal subsets for a state (P, ν), by T (P,ν) → .Definition 13 (Hyper May Closed Set).The hyper may closed set for a state (P, ν), denoted by T (P,ν) , is defined the same as the hyper must closed set as given in Definition 12, with the only difference that the first condition is replaced with the following condition.
Next, we formalise the encoding of a PL-LTS into a 1MTS.Definition 14 (PL-LTS to 1MTS Encoding).Let (P, A, I, →, p init ) be a PL-LTS.We construct a 1MTS M = (S, A, →, , s init ) as an encoding of such a PL-LTS as follows.
-The set S of states is defined as P, i.e., the set of states in the PL-LTS, p init = s init , A is the same set of actions, -We construct the → and , which, respectively, denote the must and may hyper transition relations for each state of the the encoding 1MTSs as follows.Given Definition 12 and Definition 13, we define the following transition rules: Given the above encoding, we prove that the class of 1MTSs is at least as expressive as the class of PL-LTSs.(Due to space limitation, the proofs are omitted and we will include them in an extended version of the paper.) Theorem 1.The class of 1MTSs is at least as expressive as the class of PL-LTSs.

Related Work
In this section, we discuss related work regarding formalisms used for modeling product lines and the comparison of their expressiveness.We limit our consideration to the models which have LTSs as the semantic domain.
Considering the comparison of the expressiveness of the formalisms used for modeling variability, Beohar et al. in [9] provide a comparison between the expressiveness of three fundamental models, namely, MTSs, PL-CCSs, and Feature Transition Systems (FTSs).(FTSs [11] are extensions of LTSs with propositional formulas called feature expressions.)A novel notion of encoding, based on the set of implementing LTSs, from one class of models to the other is provided.The existence of mutual encodings between two classes of models is described as having the same expressiveness.As a result a hierarchy of formalisms based on their expressiveness is provided.Furthermore, Benduhn et al. in [7], provide a survey on formalisms focusing on the suitability of these models in applying different analysis techniques.
Considering the formalisms proposed for modeling product lines; In [13], Fischbein et al. for the first time argued that MTSs are adequate for modeling variability.In several works, MTSs have been used for modeling variability in the behavior of product lines [2,1,3,19,16].As shown in [9], MTSs are the least expressive in the provided hierarchy.In order to tackle the limited expressiveness of MTSs, several extensions of such models have been proposed.In a set of works, MTSs are used with variability constraints [6], which are constraints expressed in Modal-Hennessy-Milner-Logic (MHML) [2,1,3].In [17], an extension of MTSs, namely, Disjunctive Modal Transition Systems (DTMSs) are introduced which provides the possibility to model an or relation between choices in the behavior using hyper transitions.Fecher and Schmidt in [12], introduce 1MTSs, which (as mentioned in Section 2) can be used for modeling alternative choices.Furthermore, in this work, a comparison between the expressiveness of these two models is provided, which shows that the two classes of models have the same expressiveness concerning the sets of implementing LTSs.Benes et al. in [8], introduce an extension of MTSs, namely, parametric modal transition systems in which the concept of obligation functions is used.The obligation functions are defined upon atomic propositions of states, the transitions, and a set of parameters, which can be used for representing features.By setting the valuation of parameters the presence or absence of states and transitions in a specific product model can be specified.Moreover, an extension of contract automata with modality [5] is introduced by Basile et al. in [4].In this extension of the model, permitted and necessary requests are distinguished using feature constraints.There have been other approaches introduced that use some interface theories principles to indicate the set of derivable variants from an MTS as the ones that are compatible under parallel composition with regards to a given environmental specification [16,19].
As mentioned in Section 2, PL-CCS [14], introduced by Gruler et al. [14], is an extension of Milner's CCS [20] by means of an alternative choice operator called "binary variant".This operator provides the possibility of modeling persistent choices in the behavior.The validity of variants can be further restricted using the multi-valued modal mu-calculus [21].
To the best of our knowledge, the provided encoding from PL-LTSs into 1MTSs, the results regarding the expressiveness, and the provided refinement relation for 1MTSs that addresses the limitations of such models in modeling variability in the behavior in this paper are novel.

Conclusion
In this paper, we compared the expressiveness of PL-LTSs and 1MTSs.To this end, we defined the set of products for specifications in both formalisms, of which the behaviors are commonly specified in the domain of LTSs.We then showed that 1MTSs can capture all products that can be specified by the product line calculus of communicating systems.Furthermore, we provided a set of observations regarding the limitations in modeling variability in the behavior which are enforced by the refinement relation given for 1MTSs.We proposed a new refinement relation for 1MTSs to tackle these limitations and proved a set of properties for the new refinement relation.
An immediate question to ask is whether the two formalism have the same expressive power or not.We conjecture that the answer is positive and leave this for immediate future work.We also would like to combine the results of this paper with our earlier results in [9] and present a comprehensive lattice of expressive power among all fundamental behavioral models for software product lines.As another part of our future work, we plan to provide a stronger relation between PL-LTSs and PL-CCS terms by introducing a set of conditions (on the configuration vectors of states) in a PL-LTS which guarantee that the PL-LTS is induced from a PL-CCS term.

Proposition 2 .
Consider two 1MTSs M and M such that M M .Then ∀lts ∈ LTS • lts M ⇒ lts M .Next, we prove that the bisimulation relation satisfies the properties of the refinement relation in Definition 9.