Assert and negate revisited: modal semantics for UML sequence diagrams

David Harel, Shahar MaozSCESM 2006 · DOI

TL;DR

This paper introduces Modal Sequence Diagrams (MSD), a profile for UML 2.0 sequence diagrams that brings the expressive power of Live Sequence Charts (LSC) to the standard. MSD addresses the inadequacy of UML 2.0's semantics for "assert" and "negate" operators by reinterpreting them as modal operators, enabling more robust specification of required and forbidden behaviors.

What Problem Does This Paper Address?

UML 2.0 sequence diagrams, while powerful for visualizing interactions, have struggled to formally capture nuanced behavioral properties like liveness and safety. The standard's "assert" and "negate" operators, intended to specify required and forbidden behaviors, suffer from ambiguous and inadequate semantics. This ambiguity stems from a trace-based definition that doesn't fully support the distinction between universal (mandatory) and existential (possible) behavior, a core concept in the more expressive Live Sequence Charts (LSC). This limitation hinders the effective use of sequence diagrams for formal verification, testing, and synthesis.

Methods

The authors propose Modal Sequence Diagrams (MSD) as a UML 2.0 profile. The core idea is to adopt the modal semantics of LSC, where "assert" and "negate" are not treated as operators but as modalities. MSD introduces a stereotype called modal with an attribute interactionMode that can be either hot (universal) or cold (existential). This modality is applied to interaction fragments, messages, and constraints.

The semantics of MSD are defined using alternating automata, similar to LSC. Universal MSDs (hot) specify properties that must hold for all system runs, while existential MSDs (cold) specify properties that must hold for at least one system run. The paper also details how MSD handles advanced constructs like loop, alt, break, nested, consider, and ignore operators, extending their semantics with modal interpretations.

Datasets

Not discussed in the paper.

Key Insights and Ideas

  • "Assert" and "Negate" as Modalities: The fundamental insight is that UML 2.0's "assert" and "negate" are better understood as modal operators (universal/existential) rather than traditional operators. This shift aligns with LSC's approach and unlocks richer specification capabilities.
  • Bridging LSC and UML: MSD provides a concrete mechanism to integrate the expressive power of LSC into the mainstream UML standard, allowing existing LSC tools and techniques to be applied to UML models.
  • Formalizing Liveness and Safety: By adopting modal semantics, MSD directly addresses the challenge of formally specifying liveness (e.g., something good eventually happens) and safety (e.g., something bad never happens) properties within sequence diagrams.
  • Unified Semantics for Interaction Fragments: The modal stereotype and interactionMode attribute provide a consistent way to imbue various interaction elements with universal or existential meaning, leading to a more coherent and powerful specification language.
  • Handling Complex Scenarios: The extension of operators like consider and ignore with modal semantics allows for more precise and compact specification of complex interaction patterns and constraints.

Key Results

The paper presents the formal definition of the MSD profile and its semantics through alternating automata. It demonstrates how MSD can express properties that were previously problematic or impossible with the standard UML 2.0 semantics for "assert" and "negate." The authors argue that MSD offers a more robust and expressive way to specify interactions, particularly for liveness and safety properties, by leveraging the modal semantics of LSC. While no specific quantitative results are presented, the paper's contribution lies in the formalization and conceptual advancement of UML sequence diagram semantics.

Limitations and Future Work

  • Synchronous Messages and Strict Sequencing: The presented semantics primarily focus on synchronous messages and strict sequencing. The authors acknowledge that extending MSD to asynchronous settings is a topic for future work.
  • Nesting of Hot Fragments in Existential Diagrams: The current definition precludes nesting hot fragments within existential diagrams, deeming it too complex for practical use. However, they suggest that allowing such nesting could lead to a more expressive formalism.
  • Symbolic Messages and Instances: Important LSC features like symbolic messages and instances were not included in this paper's presentation of MSD but are noted as areas for future work, with some progress reported in compiler development.
  • Operational Semantics and Play-Engine Integration: The authors plan to explore the operational semantics of MSD, including play-out execution mechanisms and integration with tools like the Play-Engine, which would involve defining additional modalities like "monitoring" vs. "executing."
  • Formal Specification of UML Standard: The authors acknowledge that the UML standard is not intended to be a fully formal specification. They advocate for the adoption of MSD or similar approaches to address the semantic ambiguities and improve the standard.
  • Integration with UML Testing Profile: The paper suggests that MSD could be effectively used with the UML Testing Profile for specifying test cases, which is a direction for future integration and formalization.

Summary updated

BibTeX
@inproceedings{harel2006assert,
  author = {David Harel and Shahar Maoz},
  title = {{Assert and negate revisited: modal semantics for UML sequence diagrams}},
  booktitle = {SCESM},
  year = {2006},
  doi = {10.1145/1138953.1138958},
}
Figure