Introduction
Modern embedded systems are characterized by a complex interplay between architecture and control logic. To design these systems effectively, engineers must manage three distinct facets: structure (how components connect), behavior (how the system reacts over time), and variability (how different product variants differ). Traditionally, this has required "heavyweight" modeling languages like SysML or AADL, which force engineers to juggle multiple disparate notations and diagram types. This compartmentalization increases cognitive load and often leads to inconsistencies between models.
The authors propose Clafer, a minimalistic modeling language designed to unify these three facets into a single, human-readable syntax. By providing a unified framework, Clafer aims to reduce the "ballast" of traditional modeling and provide a more cohesive view of complex systems.
Unifying Structure and Variability
At its core, Clafer is a structural modeling language. However, its design allows it to naturally represent variability. Instead of using separate feature models and class diagrams, Clafer uses a single primitive—the "clafer"—to represent both.
Structural Modeling
In Clafer, structure is defined through nested hierarchies and constraints. This approach mirrors the information found in UML class diagrams but in a more concise, textual format.
As shown in the figure above, Clafer can represent components, ports, and commands with clear cardinalities, effectively replacing the need for visual UML diagrams while maintaining the same level of structural detail.
Modeling Variability
Variability is integrated directly into the structural core. Feature models, often represented using FODA (Feature-Oriented Domain Analysis) notation, are mapped directly to Clafer hierarchies.
This integration allows for "presence conditions," where the existence of a structural component can be tied directly to a feature selection. For example, a "Pinch Protection" component can be constrained to exist only if the "Express Up" feature is selected in the variability model.
Behavioral Modeling via LTL
The key innovation presented in this work is the extension of Clafer to handle behavior without introducing complex new entities like "States" or "Transitions." Instead, the authors extend Clafer’s constraint language with Linear Temporal Logic (LTL) operators such as next, always, and until.
A Clafer model is interpreted through trace-based semantics, where the system's evolution is viewed as a sequence of snapshots. Behavior is defined as a set of constraints on how these snapshots can change over time. To maintain readability, the authors use modeling patterns and "syntactic sugar" (e.g., --> for transitions) to represent state machines and common behavioral properties.
Evaluation: The Power Window Case Study
The language was evaluated using a realistic automotive subsystem: the Power Window. The authors compared Clafer against established standards like SysML, AADL, and Temporal OCL.
Key results from this qualitative evaluation include:
- Conciseness: Clafer models are significantly more terse. While SysML might require six different models to capture variants and behavior, Clafer can express them in one unified model.
- Expressiveness: Clafer directly captures complex interactions, such as "alphabet variability" (where features enable or disable specific events) and "transition variability" (where features alter state transitions).
- Tooling: A compiler was developed to "desugar" high-level Clafer patterns into LTL, which are then analyzed using the Alloy Analyzer for trace generation and bounded constraint checking.
Conclusion and Future Work
Clafer demonstrates that a minimalistic approach can be more powerful than complex, multi-notation standards. By treating behavior as constraints on structural snapshots and integrating variability into the core syntax, Clafer provides a unified perspective on system design.
While the constraint-based approach can sometimes hide relationships in logic rather than making them visually explicit, the benefits in conciseness and consistency are substantial. Future work includes expanding support for sequence diagrams, exploring Petri-net-like models for concurrent states, and generating properties for real-time monitoring.
Summary updated