Compositional Thinking in Cyber-Physical Systems Theory

Georgios Bakirtzis, Eswaran Subrahmanian, Cody Harrison Fleming · DOI

Abstract

Engineering safe and secure cyber-physical systems (CPS) requires system engineers to develop and maintain a number of model views, both dynamic and static, which can be seen as algebras. We posit that verifying the composition of requirement, behavioral, and architectural models using category theory gives rise to a strictly compositional interpretation of cyber-physical systems theory, which can assist in the modeling and analysis of safety-critical cyber-physical systems.

Introduction: The Complexity of Modern CPS

Modern cyber-physical systems, such as autonomous drones, smart grids, and medical devices, are characterized by an intricate interplay between software logic and physical dynamics. Engineering these systems is a monumental task because it necessitates "multi-view" modeling. A single system might require control theory for its dynamics, software engineering diagrams for its logic, and safety contracts to define its requirements.

The complex landscape of Cyber-Physical Systems (CPS) engineering, illustrating the diverse domains and requirements that must be integrated.

The primary challenge lies in the fact that these views often exist in silos. Without a formal mathematical "glue," ensuring that a change in control logic does not violate a safety requirement or that high-level behaviors map correctly to hardware becomes an ad-hoc process. This lack of formal integration often leads to "integration hell," where vulnerabilities and errors are only discovered late in the development cycle.

A Categorical Framework for Composition

To address these challenges, this research proposes the use of Applied Category Theory (ACT) as a unifying mathematical framework. By treating requirements, behaviors, and architectures as formal "algebras," engineers can leverage "compositional thinking" to ensure system-wide consistency.

Key techniques within this framework include:

  • Functorial Semantics: Separating the "syntax" (wiring diagrams) from the "semantics" (mathematical behaviors). Functors map abstract architectural boxes to specific behaviors, such as differential equations.
  • Monoidal Categories: Modeling parallel processes, allowing for "horizontal composition" where components are connected side-by-side.
  • Slice Categories: Facilitating "vertical composition" or refinement. This allows a high-level block (e.g., a generic "Controller") to be refined into a specific hardware implementation while maintaining a formal trace.
  • Natural Transformations: Formally relating different types of algebras, such as mapping a behavioral model to a contract-based requirement model to ensure they are mutually consistent.

Case Study: UAV Refinement

The power of this approach is demonstrated through a case study of an Unmanned Aerial Vehicle (UAV). The framework allows for the formal refinement of a high-level "sensor-controller-dynamics" loop into a detailed hardware architecture.

UAV case study: Refining a high-level sensor-controller-dynamics loop (left) into a more compact, formally defined architecture (right).

By using slice categories, the authors show that "splitting" a morphism in a wiring diagram provides a formal trace. This ensures that the detailed hardware architecture remains a valid refinement of the initial high-level behavioral concept. Furthermore, the use of "pullbacks" allows for the derivation of a composite safety contract for the entire system based on the individual contracts of its subsystems.

Conclusion and Future Directions

Category theory serves as "organizing math" that doesn't replace existing engineering tools but rather structures them so that insights can be translated across domains without loss of meaning. While the mathematical foundation is robust, several hurdles remain for widespread adoption. Current categorical modeling tools are still in their infancy, and further work is needed to make these methods accessible to practitioners without specialized mathematical training. Future research will focus on scaling these methods for industrial projects and ensuring "behavioral bisimilarity" across the entire system lifecycle.

Summary updated

Abstract

Engineering safe and secure cyber-physical systems requires system engineers to develop and maintain a number of model views, both dynamic and static, which can be seen as algebras. We posit that verifying the composition of requirement, behavioral, and architectural models using category theory gives rise to a strictly compositional interpretation of cyber-physical systems theory, which can assist in the modeling and analysis of safety-critical cyber-physical systems.
BibTeX
@inproceedings{bakirtzis2021compositional,
  author = {Georgios Bakirtzis and Eswaran Subrahmanian and Cody Harrison Fleming},
  title = {{Compositional Thinking in Cyber-Physical Systems Theory}},
  booktitle = {Computer},
  year = {2021},
  url = {https://openreview.net/forum?id=VsH74amHRI0},
}
Figure