cs.SEApr 9, 2026

Towards Counterfactual Explanation and Assertion Inference for CPS Debugging

Authors: Zaid Ghazal, Hadiza Yusuf, Khouloud Gaaloul

Organizations: University of Michigan-Dearborn, Dearborn, MI, USA

Abstract

Verification and validation of cyber-physical systems (CPS) via large-scale simulation often surface failures that are hard to interpret, especially when triggered by interactions between continuous and discrete behaviors at specific events or times. Existing debugging techniques can localize anomalies to specific model components, but they provide little insight into the input-signal values and timing conditions that trigger violations, or the minimal, precisely timed changes that could have prevented the failure. In this article, we introduce DeCaF, a counterfactual-guided explanation and assertion-based characterization framework for CPS debugging. Given a failing test input, DeCaF generates counterfactual changes to the input signals that transform the test from failing to passing. These changes are designed to be minimal, necessary, and sufficient to precisely restore correctness. Then, it infers assertions as logical predicates over inputs that generalize recovery conditions in an interpretable form engineers can reason about, without requiring access to internal model details. Our approach combines three counterfactual generators with two causal models, and infers success assertions. Across three CPS case studies, DeCaF achieves its best success rate with KD-Tree Nearest Neighbors combined with M5 model tree, while Genetic Algorithm combined with Random Forest provides the strongest balance between success and causal precision.

Figures & tables

Explore similar work

CardsList
  1. Explaining Failures of Cyber-Physical Systems with Actual Causality

    Jun 23, 2026Khen Elimelech, Tom Yaacov, David A. Kelly +2Agent Failure AnalysisCyber-Physical Systems

  2. Causal Analysis of Failures of Cyber-Physical Systems with Continuous Inputs

    Oct 22, 2026Tom Yaacov, David A. Kelly, Khen Elimelech +1Causal ExplanationActual Causality

  3. Large Language Models as Falsifiers for Cyber-Physical Systems

    Sep 17, 2026Ali ArjomandBigdeli, Jiawei Zhou, Stanley BakCyber-Physical SystemsLarge Language Model-Guided Optimization