---
title: 'ADAPT: AADL AST-to-GSPN Transformation'
url: https://www.emergentmind.com/topics/adapt-aadl-ast-to-gspn
type: topic
---

# ADAPT: AADL AST-to-GSPN Transformation

ADAPT is a toolset that realizes a principled transformation from AADL (Architecture Analysis and Design Language) architectural models, specifically those annotated with Error Model Annex dependability details, to Generalized Stochastic Petri Nets (GSPNs) suitable for quantitative dependability evaluation. The process is grounded in model-driven engineering, leveraging metamodel-driven AST manipulations, modular subnet construction, explicit formal mapping rules, and integration with established tooling ecosystems such as OSATE and SURF-2 [0809.4108].

## 1. AADL and Error Model Representation in the AST

ADAPT operates directly on the in-memory Abstract Syntax Tree (AST) maintained by the OSATE (Open Source AADL Tool Environment) platform. Each AADL component instance in this AST is modeled with zero or one attached error model, utilizing the Ecore-based metamodel for AADL (SAE-AS5506/1) and the Error Model Annex (SAE-AS5506/1 Annex E). The error model describes a labeled automaton with:

- States $S = \{s_1, \ldots, s_n\}$
- Events $E = \{e_1, \ldots, e_m\}$ and propagations $P = \{p_1, \ldots, p_k\}$, each with an Occurrence property $\mathsf{Occ}(e)$ (either a fixed probability or Poisson rate $\lambda$)
- Transitions $T \subseteq S \times (E \cup P) \times S$
- Optional guard annotations (Guard_In, Guard_Out, Guard_Event) for filtering or masking propagations

All dependability annotations, including Occurrence and Guards, are attached as attributes to the corresponding error-model nodes within the AST [0809.4108].

## 2. Transformation Pipeline and Tooling Architecture

ADAPT is architected as three Eclipse/OSATE plug-ins, implemented in Java atop the Eclipse Modeling Framework (EMF):

1. **gspnModel plug-in**: An EMF-generated Ecore metamodel for GSPNs defines the classes Place, Transition, Arc, and PetriNet. It provides factory functions for constructing GSPN instances and a corresponding XMI serialization schema.

2. **dependency plug-in**: Supplies routines for traversing the AADL AST to discover dependency pairs, i.e., collecting matching in-propagations for each out-propagation via OSATE’s architectural bindings, connections, and bus accesses.

3. **aadl2gspn plug-in**: Orchestrates the transformation, utilizing OSATE APIs, invoking dependency matching, and assembling subnets via the gspnModel factories.

The workflow is initiated within OSATE when the user selects a system instance and invokes “Generate GSPN.” The aadl2gspn plug-in systematically traverses components, applies transformation rules, and produces the target GSPN in both generic XML/XMI and SURF-2-specific formats [0809.4108].

## 3. Formal Mapping Rules: Component and Dependency Subnets

The translation of error models to GSPN is modular and rule-based.

- **Component Subnets**: For each AADL component $C$ with error model $EM$:
    - For every state $s \in EM.S$, instantiate a GSPN place $p_s$ (with initial marking $1$ iff $s$ is initial).
    - For each transition $\tau = (s_1, evt, s_2) \in EM.T$ (with $evt \in E \cup P$), construct a GSPN transition $t_\tau$ with firing parameter $\lambda = \mathsf{Occ}(evt)$. Connect with arcs $p_{s_1} \to t_\tau$ and $t_\tau \to p_{s_2}$, each of weight $1$.

- **Dependency Subnets**: For every matched (out-propagation $\mathsf{pr}$, in-propagation $\mathsf{pi}$) pair (across components $C_1$, $C_2$):
    - Introduce a transition $t_{dep}$ in the GSPN with rate given by $\mathsf{Occ}(\mathsf{pr})$.
    - Link the source state place $p_{src}$ in $C_1$’s subnet to $t_{dep}$, and $t_{dep}$ to destination state $p_{dst}$ in $C_2$’s subnet, via weight-$1$ arcs.
    - Guards, if present, are encoded as inhibitor arcs or precondition places in the Petri net formalism.

The formal mapping is succinctly represented as follows. Let $EM = (S, E, P, T, \mathsf{Occ})$ for component $C$, yielding $GSPN = (P, T_n, A, M_0)$ where:

- $\forall s \in S$: create $p_s \in P$, $M_0(p_s) = 1$ if $s$ is initial, else $0$.
- $\forall \tau = (s_1, e, s_2) \in T$: create $t_\tau \in T_n$, $\mathrm{rate}(t_\tau) = \mathsf{Occ}(e)$, $A$ includes $(p_{s_1}, t_\tau, 1)$ and $(t_\tau, p_{s_2}, 1)$.
- Dependency events are handled analogously, linking source and destination subnets appropriately [0809.4108].

## 4. Traversal Algorithm and Execution Semantics

The core transformation is performed via a two-phase, AST-driven pipeline. In pseudocode:

```plaintext
function transformSystem(sysInstance):
  initialize empty GSPN net N
  // Component subnets
  for each component C in sysInstance.instances:
    if C.hasErrorModel():
      EM = C.getErrorModel()
      subnet = buildComponentSubnet(EM)
      N.addSubnet(subnet)
  // Dependency subnets
  for each component C in sysInstance.instances:
    for each outProp PR in C.errorModel.outPropagations:
      receivers = dependencyLib.findReceivers(C, PR)
      for each (D, inProp PI) in receivers:
        sub = buildDependencySubnet(C,PR, D,PI)
        N.addSubnet(sub)
  return N
```

Subnets are constructed per the formal rules described above. The modularity of component and dependency subnets enables scalable transformation of large AADL architectures, subject to the granularity of error-model partitioning selected by the model engineer [0809.4108].

## 5. Example: Sensor Component Transformation

The following table illustrates a direct mapping from a simple AADL error model to the corresponding GSPN elements.

| AADL Error Model | GSPN Place         | GSPN Transition        |
|------------------|--------------------|------------------------|
| State: Idle      | Sensor_Idle (1)    | Sensor_fail ($\lambda_{fail}$) |
| State: Failed    | Sensor_Failed (0)  | Sensor_repair ($\mu_{repair}$) |

- Transitions: Idle —[fail]→ Failed ($\lambda_{fail}$); Failed —[repair]→ Idle ($\mu_{repair}$)
- XML/XMI serialization is directly produced in the gspnModel schema, enabling further processing by tools such as SURF-2 [0809.4108].

## 6. Assumptions, Limitations, and Extensibility

ADAPT enforces that all error events and propagations must specify Occurrence properties; defaults are immediate transitions of weight $1$ if not otherwise stated. The implementation currently assumes mode-independent error-model behavior—activate/deactivate transitions and derived error-model rules are unimplemented in the prototype. Composition for extended scenarios such as resource-sharing (e.g., common repairman) or concurrency is achieved via appropriately structured AADL propagations and error-model patterns; ADAPT will propagate such user-specified dependency structures directly into GSPN dependency subnets [0809.4108].

The modular decomposition (component and dependency subnets) is rigid; adjustment of granularity is achievable solely through error-model definitions in the AADL source model. The resulting GSPN is always a closed network by standard GSPN semantics; initial markings and reward structures may be tailored at a later stage within tools such as SURF-2. Extensibility is facilitated via additional transformation rules in the aadl2gspn plug-in, following the established component and dependency subnet pattern.

## 7. Technology Stack and Interoperability

Transformation is achieved through a hand-coded Java implementation utilizing the EMF APIs and OSATE plug-in interfaces; the approach is **not** based on model transformation DSLs such as ATL or QVT. The source metamodels are the SAE AS5506/1 AADL standard (Annex C) and its Error Model Annex (Annex E), while the target is an Ecore-based GSPN metamodel auto-generated by EMF. Users interact with the tool via the Eclipse/OSATE UI, seamlessly generating GSPN representations for processing by analysis environments such as SURF-2 or through XML/XMI gateways allowing adaptation to other GSPN-based evaluation frameworks [0809.4108].

Source: https://www.emergentmind.com/topics/adapt-aadl-ast-to-gspn