Cyber-Physical Specification Mismatches

Luan Viet Nguyen, Khaza Anuarul Hoque, Stanley Bak, Steven Drager, Taylor T. Johnson

TL;DR

This paper introduces Hynger, a tool that uses dynamic analysis to automatically infer specifications for cyber-physical systems (CPS). By analyzing system execution traces, Hynger identifies potential mismatches between what the software assumes about the physical world and what the physical world actually does, helping to prevent failures in safety-critical systems.

What Problem Does This Paper Address?

Modern cyber-physical systems (CPS), like those in cars or industrial control, are incredibly complex, integrating sophisticated software with physical processes. These systems often undergo updates and modifications throughout their lifecycle. A major source of failure in safety-critical CPS arises from "unstated assumptions" – when the software's understanding of the physical environment (or vice-versa) becomes outdated or incorrect due to changes in either the cyber or physical components. This can lead to critical issues, as seen in historical failures like the Ariane 5 rocket launch or Honda vehicle recalls. Existing verification methods often focus on initial design, but this paper tackles the challenge of detecting specification mismatches that emerge during system evolution and reuse.

Methods

The core of the proposed solution is an automated method for identifying "unstated assumptions" in CPS. This is achieved through dynamic analysis, where the system (or its model) is executed, and its behavior is observed. Specifically, the authors developed a tool called Hynger (HYbrid iNvariant GEneratoR). Hynger works by:

  1. Instrumenting Simulink/Stateflow (SLSF) models: Hynger adds special code to SLSF diagrams, which are commonly used for modeling CPS. This instrumentation allows the tool to capture input and output signals from various blocks within the model during simulation.
  2. Generating execution traces: The instrumented SLSF models are then simulated, and the captured data is formatted into trace files.
  3. Inferring candidate invariants with Daikon: These trace files are fed into Daikon, a well-established tool for inferring program invariants (properties that should always hold true). Daikon analyzes the traces to generate potential specifications, or "candidate invariants," for both the cyber and physical aspects of the system.
  4. Detecting specification mismatches: The inferred candidate physical invariants are then compared against the actual physical specifications of the system. Using SMT solvers, the tool checks for discrepancies, flagging potential mismatches where the software's assumptions about the physical world don't align with reality.

Datasets

The paper does not explicitly mention or introduce new datasets for training. Instead, it uses existing benchmarks and case studies for evaluation:

  • DC-to-DC power converter: A common example used to illustrate concepts, including a buck converter.
  • Automotive control system: Specifically, the Abstract Fuel Control (AFC) system benchmarks provided by Toyota.
  • Other benchmarks: Including those from ARCH 2014 CPSWeek workshop and models from Mathworks.

Key Insights and Ideas

  • Dynamic analysis is crucial for evolving systems: While formal methods are powerful, they often rely on static models. For systems that change over time, dynamic analysis offers a practical way to uncover issues that arise from these changes.
  • "Unstated assumptions" are a major failure source: The paper highlights that many critical failures stem not from initial design flaws, but from outdated assumptions about how the cyber and physical components interact after updates or reuse.
  • Bridging the gap between models and reality: Hynger aims to bridge the gap between abstract models (like SLSF diagrams) and the actual behavior of embedded systems, making formal verification more applicable to real-world CPS.
  • Candidate invariants as abstractions: The inferred candidate invariants can serve as simpler, yet formal, representations of system behavior, aiding in verification and understanding.

Key Results

The paper demonstrates Hynger's capability to detect specification mismatches in two primary case studies:

  • Closed-Loop Buck Converter:
    • Hynger successfully identified mismatches when plant parameters (R, L, C values) were changed without updating the controller's assumed tolerance band (Vtol).
  • Mismatches were also detected when the controller was built with an incorrect assumption about the output voltage ripple percentage.
  • Changes in sensor parameters (e.g., samples_length) also led to detectable mismatches.
  • Abstract Fuel Control (AFC) System:
    • The tool detected specification mismatches when engine speed and throttle inputs were varied, affecting the air-fuel ratio.
  • Changes in controller gains (proportional and integral) also revealed mismatches between actual and inferred physical specifications for the air-fuel ratio.

The performance evaluation (Table 1) shows that instrumenting models with Hynger and running Daikon introduces an overhead, typically an order of magnitude increase in runtime compared to pure simulation, which is comparable to other dynamic analysis tools.

Limitations and Future Work

The authors acknowledge several limitations and propose future research directions:

  • Limited invariant classes: Daikon's default capabilities for inferring nonlinear invariants are limited (e.g., squares, but not general polynomials). Future work includes extending invariant templates to capture more complex physical relationships.
  • Temporal logic specifications: Current methods are limited to invariant properties. Future work aims to incorporate temporal logic specifications (like STL, MTL, HyperSTL) to handle real-time requirements more effectively.
  • Performance optimization: The current implementation incurs significant overhead due to file I/O. Future work includes optimizing performance, potentially by using online Daikon modes with direct piping.
  • Runtime assurance: Extending Hynger for runtime assurance tasks, such as detecting security violations and monitoring invariants in real-time, is a promising future direction.
  • Broader applicability: Analyzing more industrial-scale CPS and potentially integrating with other formal verification tools (like SpaceEx) is also planned.

Summary updated

Abstract

Embedded systems use increasingly complex software and are evolving into cyber-physical systems (CPS) with sophisticated interaction and coupling between physical and computational processes. Many CPS operate in safety-critical environments and have stringent certification, reliability, and correctness requirements. These systems undergo changes throughout their lifetimes, where either the software or physical hardware is updated in subsequent design iterations. One source of failure in safety-critical CPS is when there are unstated assumptions in either the physical or cyber parts of the system, and new components do not match those assumptions. In this work, we present an automated method toward identifying unstated assumptions in CPS. Dynamic specifications in the form of candidate invariants of both the software and physical components are identified using dynamic analysis (executing and/or simulating the system implementation or model thereof). A prototype tool called Hynger (for HYbrid iNvariant GEneratoR) was developed that instruments Simulink/Stateflow (SLSF) model diagrams to generate traces in the input format compatible with the Daikon invariant inference tool, which has been extensively applied to software systems. Hynger, in conjunction with Daikon, is able to detect candidate invariants of several CPS case studies. We use the running example of a DC-to-DC power converter and demonstrate that Hynger can detect a specification mismatch where a tolerance assumed by the software is violated due to a plant change. Another case study of an automotive control system is also introduced to illustrate the power of Hynger and Daikon in automatically identifying cyber-physical specification mismatches.
BibTeX
@article{nguyen2018cyber,
  author = {Luan Viet Nguyen and Khaza Anuarul Hoque and Stanley Bak and Steven Drager and Taylor T. Johnson},
  title = {{Cyber-Physical Specification Mismatches}},
  journal = {ACM Trans. Cyber Phys. Syst.},
  year = {2018},
  url = {https://openreview.net/forum?id=BZc1qTREtT1},
}
Figure