{'fraction_non_alphanumeric': 0.028555416868329214, 'fraction_numerical': 0.0064956568255343, 'mean_word_length': 4.764757709251102, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 2, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Industrial Experiences with a Formal DSL Semantics to Check the Correctness of DSL Artifacts

A domain specific language (DSL) abstracts from implementation details and is aligned with the way domain experts reason about a software component. The development of DSLs is usually centered around a grammar and transformations that generate implementation code or analysis models. The semantics of the language is often defined implicitly and in terms of a transformation to implementation code. In the presence of multiple transformations from the DSL, the correctness of the generated artifacts with respect to the semantics of the DSL is a relevant issue. We show that a formal semantics is essential for checking the correctness of the generated artifacts. We exploit the formal semantics in an industrial project and use formal techniques based on equivalence checking and model-based testing for validating the correctness of the generated artifacts. We report about our experience with this approach in an industrial development project.


Introduction
A domain specific language (DSL) [8] abstracts from implementation details and is aligned with the way domain experts reason about a software component. By focusing on the essential concepts in a problem domain, DSLs facilitate the involvement of domain experts in the development of DSL specifications.
Tool support for the development of DSLs is improving constantly. Language workbenches such as Xtext enable language designers to define their languages and develop transformations that generate various artifacts from DSL models. This has boosted the popularity of DSL approaches in industry, as witnessed by reports like [16,21].
The development of DSLs is usually centered around a grammar and transformations that generate implementation code or analysis models from DSL specifications. In such a setting, the main focus is on the transformation to implementation code which is very valuable in industrial practice. Generating analysis models is particularly interesting for safety-critical components and facilitates analyzing DSL models using a combination of formal techniques. For example, properties can be verified against verification models or simulation models can be used to explore the modeled behavior interactively.
In DSL approaches, the semantics of the language is often defined implicitly and in terms of the generated implementation. Although DSLs focus on the essential concepts of their respective domains, the semantics of the language constructs are not always obvious. The lack of a formal semantics can give rise to different interpretations and cause inconsistencies between the transformations.
Various authors [1,6] have proposed to use a formal semantics to describe the precise meaning of the language constructs. The formalization also allows them to have a single reference that should be followed by all the transformations. However, having a formal semantics as a reference does not guarantee the correctness of the transformations from a DSL. The developer of a transformation should have a deep understanding of the DSL and the target language and construct a transformation that does not deviate from the semantics of the DSL. In [7] the authors indicate that such tasks are very error-prone and introducing redundant validations is an effective way to reduce the rate of mistakes.
We propose to use the formal semantics of a DSL and introduce redundancy to validate the correctness of the artifacts generated from transformations [12]. We introduce redundant validations using the following formal techniques: • equivalence checking (by transforming models to a formalism that allows checking equivalence of behaviors); • model-based testing (by testing conformance of executable models to a test model).
We report on our experiences with these formal techniques in the context of an industrial DSL. This DSL is used in a development project to write specifications for an existing implementation of an industrial software component and to develop new enhanced specifications for future releases of the software. In this paper, we focus on DSL models that describe the existing implementation. The results obtained in the project show that the redundancy introduced by equivalence checking and model-based testing can effectively detect inconsistencies between the generated artifacts for a DSL. To hide the complexities of these techniques, we have developed a push-button technology that allows industrial users to automatically perform these checks for the generated artifacts.
Instead of validating the correctness of the generated artifacts, some authors [9] propose to formally prove the correctness of transformations. For a realistic DSL, this can be very costly in terms of time and the required expertise [14]. Thus, proving transformations should only be considered for well-established languages and transformations. Moreover, for a young DSL, transformations are improved regularly, and hence proving their correctness may not be effective. The industrial context of our work also calls for a pragmatic approach where there is no time for time-consuming proofs.
Overview. We discuss the mCRL2 process algebra in Section 2. In Section 3 we describe an industrial control component and informally introduce a DSL for describing its behavior; the semantics of the language is formalized in Section 4 using mCRL2. In Section 5 we use model-based testing to assess the quality of an implementation of the industrial component. The correctness of the used models is validated in Section 6. In Section 7 we discuss about our experiences with different types of model transformations. In Section 8 we discuss related work. Section 9 contains conclusions and directions for future research.

Preliminaries
In this section we give an overview of the micro Common Representation Language 2 (mCRL2) [11]. mCRL2 is a process algebra that extends the Algebra of Communicating Processes (ACP) [5] with data and time. The mCRL2 language and its supporting toolset [15] can be used to specify and analyze the behavior of distributed systems and protocols.
In this short overview, we focus on the language constructs that we need throughout the paper. The interested reader can refer to [11] for more details. We explain the way data types are defined and used in mCRL2 (Section 2.1) and describe behavioral specifications in the language (Section 2.2).

Data Specification
mCRL2 offers ways to specify data types (also known as sorts) and use their elements in specifications. Standard data types such as natural numbers (N) and booleans (B) are predefined in the language. Common operations on these data types are also available, e.g., ≈ denotes equality.
The user can define new data types in a specification. A new sort can be declared by explicitly characterizing its elements in a structured data type. For instance, we can define Color with elements Red, Green, and Blue: sort It is also possible to declare structured types that depend on other sorts. For instance, a data type called Message that contains pairs of natural numbers can be defined as follows: sort Message = struct Pair(fst:N, snd:N); A Message has the shape Pair(n 1 , n 2 ) where n 1 , n 2 ∈ N. The declaration of Message provides two projection functions, fst and snd, that extract the elements of Pair(n 1 , n 2 ): fst(Pair(n 1 , n 2 )) = n 1 snd(Pair(n 1 , n 2 )) = n 2 Functions can also be declared and used in the mCRL2 language. Given two sorts A and B, the notation A → B denotes the sort of functions from A to B. mCRL2 includes an operator called function update for unary functions. For f ∈ A → B this operation is denoted by f [a → b] and represents a function that maps a to b and maps all the other elements of A like f does.
We can declare the sort of functions from N to N as follows: sort NatFunc = N → N; We consider two examples of this sort: • succ: given n ∈ N returns n + 1; • condsqr: given n ∈ N returns n 2 if n > 10; otherwise, it returns n.
We declare these functions using the map keyword: map succ, condsqr : NatFunc; To define succ and condsqr, it is necessary to specify the calculations performed in these functions. This is realized by introducing equations using the keyword eqn. Variables used in the equations are declared by the keyword var. var n : N; eqn succ(n) = n + 1; condsqr(n) = if (n > 10, n 2 , n); The conditional operation has the shape if (c,t, u).

Process Specification
mCRL2 allows us to specify behavior using a small set of primitives and operators. We use a simple example to describe some basic constructs of mCRL2. The example is a modulo 3 counter that starts counting from 0 and resets itself when it reaches 3. In mCRL2, behavior is described in terms of processes. Actions are elementary processes and represent observable atomic events. Actions can also carry data parameters. In our example, count and reset can be considered as actions performed by the counter. The action count carries a data parameter to indicate the current number. These actions are declared as follows: act count : N; reset; Actions can be combined using different operators to form processes that specify more complex behaviors. For instance, the non-deterministic choice between process p and q is denoted by p + q and the sequential composition of p and q is denoted by p.q. Data values can also influence the course of actions. Suppose c is a boolean expression. The process c → p q behaves as p if c holds and otherwise it behaves as q. The "else" part of the conditional operator can be omitted. If c does not hold in c → p, deadlock will occur.
The following process specifies the modulo 3 counter. The process Counter carries a data parameter to keep track of the current number. The initial behavior is specified by init, i.e., counting starts from 0. proc Counter(n:N) = (n < 3) → count(n).Counter(n + 1) + (n ≈ 3) → reset.Counter(0); init Counter(0); For any n ≤ 3 exactly one of the conditions n < 3 and n ≈ 3 will evaluate to true. The process performs action count(n) when n < 3 and then behaves as Counter(n + 1). If n ≈ 3, the process performs reset and starts counting from 0. Fig. 1 depicts the labeled transition system of the counter.

Industrial Application: a Clinical X-ray Generator
In this section we introduce an industrial control component that we use for reporting our experiences (Section 3.1). We also informally describe a DSL for specifying the behavior of the component (Section 3.2).

Platform
Philips Healthcare produces interventional X-ray systems ( Fig. 2(a)) which are used to perform minimallyinvasive medical procedures. During a procedure, the surgeon uses the images on the monitors as guidance. Images are constructed for two projections. The X-ray system consists of two planes: frontal (top-down) and lateral (left-right). These planes can be used separately or together (biplane).
The surgeon sends X-ray requests using the pedals. The interventional system of Fig. 2(a) includes a component called Pedal Handling that makes decisions about the amount of X-ray that should be   Fig. 2(b)). From each plane the following types of X-ray can be generated: • Fluoroscopy: low dose X-ray, for obtaining real-time images; • SingleShot: high dose X-ray, for capturing a single image; • Series: high dose X-ray, for recording a series of images.
Pedal Handling also takes into account conditions that should interrupt the X-ray, or that should prevent the X-ray from starting. Condition Evaluators continuously evaluate these conditions and notify Pedal Handling when changes occur.

DSL for Pedal Handling
To describe the behavior of Pedal Handling, domain experts mainly focus on the external interfaces of the component. Starting from the initial state, they think about the input actions received from Pedals and Condition Evaluators. Based on the received input, the component might change its current state; it also makes a decision about the output X-ray and sends a request to the tubes. This process continues by receiving the next input. Thus, from the domain expert's point of view the behavior of Pedal Handling can be described with alternating sequences of input and output actions.
To specify the behavior of Pedal Handling, we use a DSL that fits this way of reasoning. Fig. 3 depicts a specification in the DSL. For confidentiality reasons, we do not provide a realistic model. This language is designed in collaboration with domain experts from Philips Healthcare. Although we use Fig. 3 as a running example to illustrate our approach, the results reported in the paper are based on realistic DSL models and implementations that are executable on the physical hardware.
A DSL model starts with declaring the input actions that can be received by the Pedal Handling component (InActions). Afterwards, it declares variables that keep track of the current state of the component (Boolean variables and Plane variables) and their initial values (Init). Two notexplicitly-declared variables, OutputType and OutputPlane, determine the output of Pedal Handling.
The internal logic of the component is described in terms of Rules. Each rule refers to an input action and consists of a guard and a do clause. The guard describes when the input action is enabled and the do clause determines how the action influences the state of the component and the output. A DSL model specifies exactly one rule for each input action. Multiple rules for an action are not supported.
Rules of the DSL use simple constructs for describing behavior. However, the precise meaning of some constructs is not obvious. For instance, it is not obvious whether evaluating the do clause of an action can be interrupted by receiving a new input action. Since a do clause may contain multiple assignments to a variable, it is also relevant to determine when a variable assignment takes effect.
In Section 4 we give a formalization of the DSL which clearly specifies the semantics of the language. For instance, our semantics enforces that do clauses should be interpreted in an atomic way and each assignment to a variable immediately changes its value such that the previous value is overwritten.

Formalizing the DSL Semantics
In Section 3.2 we informally introduced a DSL and motivated the need for a formal semantics. In this section, we give a formalization of the DSL semantics by introducing a transformation from the DSL to mCRL2. Similar to the Pedal Handling DSL, a compact representation/language for describing behavior in terms of labeled transition systems is very common in many application domains. Hence, our approach for formalizing the semantics of the DSL can be applied to other DSLs.
We describe our general transformation scheme by transforming the model of Fig. 3 to mCRL2. Our choice of mCRL2 is motivated by the expressiveness of the language, the availability of a toolset [15] that supports analysis of behavior, and our previous experience with the language and toolset. We first discuss the required data specifications (Section 4.1). Then we use process expressions to describe the behavior of DSL models (Section 4.2). Finally, we discuss the types of analysis that we perform on DSL models (Section 4.3).

Data Specification
Plane, X-Ray Type. As mentioned in Section 3.1, X-ray can be generated from three planes (frontal, lateral, and biplane). We define the data types Plane and XRay to describe the planes and the type of X-ray generated from them.
The combination of None and Standby describes a situation in which no X-ray is generated from the planes.
State. A DSL model declares a set of boolean and plane variables. The valuation of these variables and the two special variables OutputType and OutputPlane determine the state of the transition system described by the DSL model. To describe the notion of state in mCRL2, we create two structured data types B (for boolean variables) and P (for plane variables). The structure of these sorts corresponds to the variable declarations of the DSL model. For the model of Fig. 3, B and P are defined as follows: To specify the valuations of boolean and plane variables, we declare the following data types: Finally, the notion of state can be formalized as follows: sort PSt = struct St(bs:BVals, ps:PVals, outType:XRay, outPlane:Plane); The projection functions outType and outPlane extract the values of OutputType and OutputPlane from states. In a DSL model, the initial values of the boolean and plane variables are specified by Init. We declare bs 0 ∈ BVals and ps 0 ∈ PVals to specify the initial values in mCRL2. We also declare s 0 ∈ PSt to describe the initial state. The initial values of OutputType and OutputPlane cannot be specified by Init in the DSL. It is assumed that initially no X-ray is generated from the planes. Hence, we specify s 0 such that: Guard, Do Clause. A DSL model specifies one rule for each input action. The rule of an action consists of a guard and a do clause. From Fig. 3 one can see that a guard is a function from states to booleans. A do clause consists of a sequence of assignments/conditionals that given the current state can change the values of the variables and produce a new state. We describe guards and do clauses as follows: For the DSL model of Fig. 3 with 4 rules, we declare the guards and do clauses g i , d i for 1 ≤ i ≤ 4: The calculations of each guard can be described in terms of an equation. For instance, the guard of the first rule of Fig. 3 can be defined as follows: var b : BVals; p : PVals; xr : XRay; pl : Plane; eqn g 1 (St(b, p, xr, pl)) = (b(FRFluoReq) ≈ false); To describe do clauses, we specify assignments and conditionals in terms of equations. To explain this, we consider the do clause of the first rule from Fig. 3. This do clause contains four assignments and one conditional.
We describe each assignment as a function that updates one of the components of a state argument St(b, p, xr, pl). We denote the assignments of the first rule by a 1 , a 2 , a 3  , St(b, p, xr, pl)); In this equation, Eval is a function that evaluates a sequence of assignments or conditionals and condthen is the "then" part of the conditional (see below).
A do clause is described as a sequence of assignments/conditionals. For example, we describe the do clause of the first rule (d 1 ) as a sequence of the assignments a 1 , a 2 and the conditional cond. The "then" part of a conditional is also specified as a sequence of its components. The "then" part of the conditional in the first rule (condthen) is a sequence of a 3 , a 4 : map condthen : List(PSt → PSt); eqn d 1 = [a 1 , a 2 , cond]; condthen = [a 3 , a 4 ]; Having sequences of assignments and conditionals, it is also essential to define a function that applies a sequence of statements to a state and returns the resulting state. The following mCRL2 description defines Eval for this purpose:

Process Specification
The Pedal Handling component performs two types of actions: input and output. A DSL model explicitly declares a set of input actions (from Pedals and Condition Evaluators) by InActions. Pedal Handling also performs actions output(xr, p) to send requests for xr ∈ XRay to p ∈ Plane. This action is not explicitly declared in the DSL. Corresponding to the input actions and the output action we declare actions in mCRL2. For Fig. 3 we declare: act FRFluoOn, FRFluoOff , StartCond, ResetStartCond; output : XRay × Plane; In Section 3.2, we mentioned that domain experts describe the behavior of Pedal Handling with alternating sequences of input and output actions. The semantics of the DSL is aligned with this intuition. We specify the semantics of the DSL model of Fig. 3 in terms of the following processes: proc P In (s:PSt) = g 1 (s) → (FRFluoOn.P Out (Eval(d 1 , s))) + g 2 (s) → (FRFluoOff .P Out (Eval(d 2 , s))) + g 3 (s) → (StartCond.P Out (Eval(d 3 , s))) + g 4 (s) → (ResetStartCond.P Out (Eval(d 4 , s))); P Out (s:PSt) = output(outType(s), outPlane(s)).P In (s); init P In (s 0 ); The process P In describes the behavior of Pedal Handling when the component is ready to receive an input. It carries a data parameter that indicates the current state. The process P In uses a combination of choices and conditionals for case distinction. The guards are used as conditions in the conditional operators to determine enabled actions. Performing an input action updates the state based on the corresponding do clause. The process P Out describes the behavior of Pedal Handling when the component is ready to produce an output. In this situation, output is performed and it carries the X-ray type and plane extracted from the state. Performing the output action does not influence the state.
The processes P In and P Out enforce alternating execution of the input and output actions. Do clauses are evaluated by Eval. Thus, new actions cannot be performed before a do clause is completely evaluated. Moreover, assignments have an immediate effect.

Analyzing DSL Models
For a safety critical component, it is desired to use DSL models as a single source to automatically obtain models that enable analysis using various formal techniques, e.g., verification, simulation.
To enable verification, we have automated the transformation from the DSL to mCRL2. We have used the mCRL2 toolset to generate the state spaces of DSL models and to verify properties expressed in a variant of the modal µ-calculus. A realistic DSL model declares 25 input actions and their effects in terms of rules. The corresponding state space consists of approximately 45000 states and 350000 transitions. We have verified some safety properties against this model, e.g., "deadlock-freedom", "no X-ray is generated from the planes when there is no request from the user". The interested reader can refer to Appendix A of [13] for a modal µ-calculus formalization of some safety properties for the DSL model of Fig. 3.
The mCRL2 formalization can also be used as a reference to implement transformations to other formalisms. Having a formalized semantics helps to avoid arbitrary choices in the transformations that would give a different semantics to the constructs of the DSL.
To enable simulation, we have implemented an automated transformation from the DSL to POOSL [19,17]. POOSL is a modeling language with a semantics expressed in terms of timed probabilistic  Figure 4: Generated Artifacts for Pedal Handling and their Validation labeled transition systems. The tools available for POOSL allow us to simulate the modeled behavior and discuss our observations with domain experts. Due to space restrictions, we do not discuss this transformation; the interested reader can refer to [13] for a detailed description of the transformation. Using the mCRL2 formalization as guidance for implementing a transformation to POOSL does not give a robust connection between the generated mCRL2 and POOSL models. In Section 6, we formally validate the correctness of POOSL models with respect to the mCRL2 formalization. A proposed implementation for Pedal Handling is available. Thus, at the moment we do not generate code from the DSL. Fig. 4 depicts the transformations from the DSL; test models are discussed in Section 5. In Section 6 we also discuss an approach for validating simulation models against test models.

Validating the Industrial Implementation
We introduce model-based testing as a way to assess the correctness of an implementation with respect to a DSL description (Section 5.1). We also discuss about interpreting the results obtained from modelbased testing (Section 5.2).

Validating the Implementation by Model-based Testing
In industry, the implementation is considered to be the most valuable artifact that is produced for a component. When behavioral models of a component are also available, it is relevant to check whether the implementation complies to the modeled behavior. Validating the compliance of implementations to DSL models adds a level of redundancy that can reveal discrepancies between the developed DSL models and implementations.
We use model-based testing to validate the correctness of an implementation with respect to a DSL model. Model-based testing uses a model that describes the behavior of a system under test and enables both automatic generation and execution of test cases on the implementation.
The semantics of the Pedal Handling DSL is described in terms of labeled transition systems and hence we create a test environment based on the theory of input-output conformance (ioco) testing for labeled transition systems [20] to automatically derive test cases from the behavior described in the DSL and execute them on the implementation.
In the ioco theory, correctness of implementations with respect to specifications is expressed in terms of the binary relation of ioco. The ioco theory provides an algorithm that derives a set of test cases from a given specification such that executing this set of test cases on an implementation determines whether the specification and implementation are related by the conformance relation.
The model-based testing tool of Axini [3] is based on the ioco theory. In this tool, specifications are described in the Axini Modeling Language (AML). We have developed an automated transformation from the DSL to AML (Fig. 4). The generated AML model for a DSL specification is used for modelbased testing against the implementation; see [13] for details about the transformation to AML.

Interpreting the Results of Model-based Testing
Validating the compliance of an implementation to a DSL model by model-based testing requires special attention to interpret the results correctly. A failed test case shows a discrepancy between the test model and the implementation. This can have three different reasons: • a mistake in the transformation from the DSL to the test models; • a failure in the implementation; • a modeling mistake in the DSL model, which is cascaded to the test model.
The transformation from the DSL to test models should preserve the semantics of the DSL. A mistake in realizing the semantics may result in failed test cases. In Section 6 we introduce an approach to gain confidence in the correctness of the generated models in Fig. 4. When there is sufficient confidence in the correctness of test models, a failed test case may indicate a failure of the implementation.
The last item mentioned above is particularly relevant if implementations are not generated from the DSL. In such cases, failed test cases could also indicate a mistake in DSL models; the intended behavior is not correctly described in the DSL (and the same modeling mistakes are cascaded to the test model) but the implementation has correctly realized the behavior.
Results. For our model-based testing experiments, we used a real but not-yet-released implementation of Pedal Handling. Independently of our experiments with the DSL, the developers have constructed an extensive suite of unit tests for validating the implementation. However, in model-based testing the focus is on assessing the observable behavior of the component based on a model by providing stimuli at its external interfaces. This revealed a number of issues in the implementation that are out of the scope of the unit tests. For example, one of the requirements of Pedal Handling indicates that high-dose X-ray requests have priority over low-dose X-ray requests. A design mistake in realizing this requirement led to a failed test case. The failed test was part of an unlikely trace where three different pedals must be pressed at the same time.
Model-based testing revealed that certain modeling choices taken in our DSL models are implemented differently in the implementation. Unlike stopping Fluo (modeled by FRFluoOff in the example of Fig. 3), stopping Series requires performing two actions in a specific order. The output specified for the first step of stopping Series was different from the output produced by the implementation. This observation led to minor changes in our DSL models.

Checking the Correctness of Generated Models through Redundancy
Transformations from a DSL to analysis models allow the user to apply various formal techniques and reason about DSL models. Analysis models can also be used to assess the correctness of other artifacts available for a component (Section 5). However, the results obtained from analysis models are only valuable if the corresponding transformations correctly realize the semantics of the DSL.
Developing a transformation from a DSL to a modeling language requires a deep understanding of the semantics of the DSL and the target language. Moreover, the transformation should not deviate from the semantics of the DSL. Introducing redundancy is a very effective way to reduce the rate of mistakes in such error-prone tasks [7].
We introduce redundancy to validate the correctness of the artifacts depicted in Fig. 4 in two ways: equivalence checking (Section 6.1) and model-based testing (Section 6.2). Note that the validation techniques introduced in this section are not bound to the transformations of Fig. 4 and hence manually constructed models can also be validated using equivalence checking and model-based testing.

Checking the Behavioral Equivalence between Artifacts
The verification and simulation models in Fig. 4 have an underlying labeled transition system. To get confidence in the correctness of simulation models with respect to the formalized semantics (transformation to verification models), we can investigate whether the labeled transition systems described by the simulation and verification models are related by an equivalence relation, e.g., strong bisimulation. This may require to develop transformations from analysis models to a formalism that enables state space generation and comparison.
We have used the mCRL2 toolset for state space generation (the lps2lts tool) and comparison (the ltscompare tool). To enable state space generation for simulation models, we have developed a transformation from POOSL to mCRL2. To avoid bridging wide semantic gaps between POOSL and mCRL2, we have restricted our simulation models to a sufficient subset of POOSL (see [13] for more details about the constructs used in simulation models) and developed a transformation to mCRL2 for that specific subset.
When comparing behaviors, the internal steps performed by them are not relevant; we focus on the observable behaviors. Hence, we check whether the state spaces are equivalent modulo branching bisimulation. Fig. 4 depicts equivalence checking between mCRL2 and POOSL models and the automated transformation from POOSL to mCRL2 that enables this check.
Results. For realistic DSL models, the behaviors described in mCRL2 and POOSL were equivalent modulo branching bisimulation. Models generated from three transformations (DSL to mCRL2, DSL to POOSL, and POOSL to mCRL2) are involved in equivalence checking between simulation and verification models. Each transformation is implemented by a different person. This reduces the probability of identical mistakes in the transformations and makes the redundancy introduced by equivalence checking more valuable.

Model-based Testing of Executable Models
In Section 5 we used model-based testing to validate the correctness of an implementation. Executable analysis models can also be treated as black-boxes that interact via their interfaces; we can supply inputs to an executable model and observe its output. Thus, executable models can be tested against the test model generated from a DSL model using model-based testing. Failed test cases reveal mistakes in the transformations. In our case study, we have applied model-based testing to POOSL models; see Fig. 4.
Note that there are also other possibilities for validating the artifacts of Fig. 4 (e.g., model-based testing mCRL2 models against AML models). Adding such validations gives more confidence in the correctness of the artifacts but would require additional effort to create the required environment.
Results. We did not encounter any failed test cases in our model-based testing experiments against POOSL models. Similar to Section 6.1, the transformations to simulation models (POOSL) and test models (AML) are implemented by different people. Absence of failed test cases gives more confidence that the semantics of the DSL is realized correctly in these models.

Experiences with Different Kinds of Model Transformations
The approach of Fig. 4 deploys model transformations to enable the use of multiple formal techniques and to introduce redundant mechanisms for assessing the correctness of different artifacts with respect to the formalized semantics. This approach relies on two types of transformation: transformations from the DSL to a general-purpose modeling language (from the DSL to mCRL2, POOSL, and AML), and transformations between general-purpose modeling languages (from POOSL to mCRL2). In this section we report on our experiences with these two types of transformations.
General-purpose modeling languages originate from different disciplines and are applicable to a wide range of problems. For instance, POOSL is designed to be applicable for simulation and performance analysis, whereas mCRL2 is focused on formal verification. In our experience, making transformations between two general-purpose formalisms is not a trivial task. There are usually language constructs from the source language that are difficult or even impossible to translate to the target language.
For example, the data layer of POOSL is object-oriented. Each data class describes its variables and methods. Moreover, instances of certain data structures (e.g., strings, lists) are accessed using pointers. On the other hand, mCRL2 is not object-oriented and does not support pointers. Hence, transforming data classes or pointers from POOSL would require complex mechanisms in mCRL2 models.
Similarities between the source and target languages may suggest a direct mapping between certain constructs. However, similar constructs in two formalisms may have subtly different semantics. For instance, one would expect the conditional statement if c then p else q fi of POOSL to be trace equivalent to c → p q in mCRL2. Based on the formal semantics of POOSL, if c then p else q fi first performs an internal step (τ transition) to evaluate the condition. Then it behaves as p if c holds and otherwise it behaves as q. However, in mCRL2 no internal action is performed for evaluating c and hence the two conditional statements are not trace equivalent. This observation reiterates the importance of formal semantics in transformations between languages.
In the literature, some authors have reported similar experiences about transformations between general-purpose modeling languages. A partial transformation from the hybrid modeling formalism Chi 2.0 [4] to mCRL2 is proposed in [10]. The intention is to enable formal verification on models in Chi 2.0. Semantic differences between Chi 2.0 and mCRL2 makes the transformation complex and hard to maintain. The generated models are also complex and sometimes difficult to analyze by tools.
In our experience, restricting the scope of a transformation (e.g., using predefined data types in POOSL specifications instead of representing POOSL data classes in mCRL2) and studying the semantics of the relevant constructs from the source and target languages are effective ways to overcome the challenges faced in implementing transformations between general-purpose languages.
The Pedal Handling DSL is defined for a narrow domain and its semantics is less elaborate compared with POOSL, mCRL2, and AML. Thus, it requires less effort to construct the transformations from the DSL to different analysis models.

Related Work
In [1] the authors prototype the semantics of a DSL called SLCO in terms of a transformation to an intermediate language called CS. Afterwards, CS models are transformed to labeled transition systems and are inspected manually or analyzed by existing tools. The authors have also implemented a number of transformations from SLCO to SLCO models with equivalent behaviors and suggested that the prototype semantics can be used to compare the underlying labeled transition systems of the source and target models.
The B method has been used in [6] to develop process schedulers based on specifications in a DSL. The information given by a DSL model is taken into account at several refinement steps in B machines. The authors also introduce a decidable logic for expressing proof obligations of the refinement steps. This allows them to automatically prove the refinements.
The mentioned studies validate refinement steps, whereas we offer various formal techniques to assess the semantic correctness of different types of artifacts in an automated way.
In [18] a combination of model-based techniques is used to develop a software bus in a two-phase process. In the first phase, an mCRL2 model of the component is created and validated through simulation. After developing the component, the mCRL2 model is used for model-based testing of the implementation. In the second phase, different properties are verified against the mCRL2 model. The model is improved based on the results and is used for model-based testing against a second implementation. In comparison, our approach is centered around domain-specific models and artifacts generated from them.

Conclusions
A DSL allows us to use models that are naturally aligned with the way domain experts reason about a software component. Existing tools enable language designers to define DSLs and to construct transformations to implementation code and analysis models. However, the semantic correctness of the generated artifacts is usually overlooked.
To resolve conflicting interpretations of a DSL, we use a formal semantics of the language. We also propose to have additional mechanisms to validate the correctness of the generated artifacts with respect to the semantics of the DSL.
We have experimented with this approach as preparation for the redesign of a clinical X-ray generator. In this paper, we reported on our experiences with DSL models for an existing implementation of the industrial component. At the moment, the DSL and the transformation to simulation models are frequently used for discussions on potential enhancements in the behavior of the component.
We plan to extend our approach by other forms of redundancy to increase the reliability of the artifacts. To this end, we consider using model learning. Model learning techniques extract an automaton model for an implementation by systematically performing tests on it and observing its behavior [2]. A learned model can give insight in the implemented behavior, and can be compared with the labeled transition system described by a DSL model.
Our approach for validating the generated artifacts for a single DSL model can be extended to validate the transformations themselves based on a set that consists of several DSL models. Various criteria can also be defined for the considered sets to obtain DSL models that examine different aspects of the transformations.