Reusing Model Transformations While Preserving Properties

Ethan K. Jackson, Wolfram Schulte, Daniel Balasubramanian, Gabor KarsaiFASE 2010

Abstract

In model-based development (MBD), verifying model transformations is a critical but computationally expensive task. When Domain-Specific Languages (DSLs) evolve or are composed, existing proofs of correctness are often invalidated, necessitating costly re-verification from scratch. This paper introduces a formal framework to determine if a reused transformation preserves the properties of the original without full re-verification. By defining a concept called lifting equivalence and utilizing a novel class of rewrites known as collapsing morphisms, the authors provide a method to automatically "lift" verified properties to new contexts. The approach is implemented in the FORMULA logic-based modeling framework and demonstrated to be computationally efficient.

Introduction

Model transformations serve as the essential compilers and translators between different Domain-Specific Languages (DSLs) in modern software engineering. Ensuring these transformations behave correctly—for instance, guaranteeing that every valid input produces a valid output—is paramount. However, the static nature of traditional formal verification clashes with the dynamic reality of software evolution. When a DSL's syntax changes or when multiple DSLs are composed, the original verification proofs typically fail, creating a significant bottleneck in the development lifecycle.

Methodology: Lifting Equivalence and Collapsing Morphisms

The core contribution of this research is a mathematical bridge between an original, verified transformation ($\tau$) and its evolved or reused version ($\tau'$). This bridge is built on two primary concepts:

1. Lifting Equivalence

The authors define a condition where $\tau'$ "lifts" $\tau$ if there exists a set of rewriting procedures ($\Lambda$ for inputs and $\Gamma$ for outputs) such that the transformation process commutes. As shown in the diagram below, applying the new transformation should be behaviorally equivalent to rewriting the new input into the old format, applying the original transformation, and then rewriting the result back into the new format.

Commuting diagram illustrating the lifting equivalence between an original transformation $\tau$ and a reused transformation $\tau'$.

2. Collapsing Morphisms

To make this theoretical framework practical, the authors focus on algebraic data types represented as ordered trees. They introduce "collapsing morphisms," which preserve the parts of a model common to both the old and new DSLs while "collapsing" new, complex structures into simpler values that the original transformation can interpret. This exploits "structural indifference," where many transformations only care about the identity or count of elements rather than their nested complexity.

Implementation and Evaluation

The proposed algorithms were implemented within FORMULA, a logic-based modeling framework. The authors utilized polynomial-time algorithms to automatically calculate these morphisms and verify the validity of the lifting.

The approach was evaluated using:

  • NFA (Non-deterministic Finite Automata) DSLs: A classic example where a simple NFA DSL is evolved into a "Product NFA" DSL with more complex state structures.
  • FORMULA Specifications: The algorithms were tested against internal logic and rule sets to ensure they could handle complex, recursive data types.

Key Insights and Results

  • Property Preservation: If lifting equivalence is established, a broad class of first-order logic statements (compatible universally quantified properties) is guaranteed to hold in the new context without further proof.
  • Decidability and Efficiency: By restricting rewriting to collapsing morphisms, the search for mappings becomes a maximum bipartite matching problem, which is solvable in polynomial time. This makes the verification tool highly efficient for real-world use.
  • Rewrite Elimination: The authors proved that for certain common properties, such as counting functions, the intermediate rewriting steps can be mathematically eliminated, allowing the property to be expressed entirely within the new DSL's context.

Conclusion and Future Work

This framework provides a robust method for maintaining formal guarantees across evolving DSLs. While currently restricted to universally quantified first-order properties, it significantly reduces the manual effort required for re-verification. Future research will explore extending this to existential quantifiers and higher-order logics, as well as applying the technique to larger-scale DSL composition problems where structural changes are more aggressive.

Summary updated

BibTeX
@inproceedings{jackson2010reusing,
  author = {Ethan K. Jackson and Wolfram Schulte and Daniel Balasubramanian and Gabor Karsai},
  title = {{Reusing Model Transformations While Preserving Properties}},
  booktitle = {FASE},
  year = {2010},
  doi = {10.1007/978-3-642-12029-9\_4},
}
Figure