NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Enhancing active model learning with equivalence checking using simulation relations

Natasha Yogananda Jeppu, Tom Melham, Daniel KroeningFormal Methods Syst. Des 2022

Abstract

Reverse-engineering complex software into accurate system abstractions is a critical task for debugging, safety verification, and legacy system maintenance. This paper introduces a novel "grey-box" active learning algorithm that combines trace-based learning with formal verification techniques. By leveraging simulation relations to extract local completeness conditions, the approach ensures that the resulting model is a guaranteed overapproximation of the original system's behavior. Evaluation on industry-standard Simulink Stateflow benchmarks demonstrates significant improvements in reliability and efficiency compared to existing state-of-the-art active learning tools.

Introduction

Modern engineering frequently relies on "black-box" or legacy systems where internal logic is undocumented or opaque. To perform rigorous safety checks or simulations, engineers require clear, formal models of these systems. Traditional model learning falls into two categories: passive learning, which relies on existing execution logs and often misses edge cases, and active learning, which queries the system but often struggles with the "query complexity" of symbolic data.

The core challenge addressed here is the "completeness gap": how to efficiently learn a model that captures all possible system behaviors without requiring an exhaustive number of queries.

The Grey-Box Learning Framework

The authors propose a hybrid "grey-box" approach that iteratively refines a candidate abstraction. Unlike purely black-box methods, this algorithm utilizes the internal structure of the learned model to guide further exploration.

The iterative grey-box learning algorithm combining trace-based learning, SAT checking, and model checking.

The process follows a five-step loop:

  1. Candidate Generation: An initial abstraction is built from execution traces using tools like Trace2Model.
  2. Completeness Hypothesis: The algorithm extracts local conditions based on simulation relations. It examines each state and transition to identify logical gaps where the actual system might exhibit unmodeled behavior.
  3. SAT Checking: A SAT solver evaluates these conditions. If a condition is falsified, a potential missing behavior (counterexample) is identified.
  4. Spuriousness Analysis: To ensure the counterexample is real and not an artifact of the abstraction, the algorithm uses Bounded Model Checking (CBMC) against the source code.
  5. Refinement: Real counterexamples are converted into new traces, which are added to the training set for the next iteration.

Symbolic Abstractions and Simulation Relations

A key innovation is the shift from explicit value-based learning to symbolic predicates. By using predicates (e.g., temp > T_thresh), the tool can represent systems with infinite input spaces.

An example of a learned abstraction for a Home Climate-Control Cooler System, showing symbolic transitions.

The use of simulation relations allows the algorithm to decompose the global problem of model completeness into manageable local checks. This "bottom-up" approach effectively "grows" the model until it is broad enough to safely overapproximate the target system.

Experimental Evaluation

The framework was evaluated using 45 benchmarks derived from Simulink Stateflow models, converted to C code via MATLAB’s Embedded Coder.

Key Results

  • Reliability: The algorithm successfully generated equivalent models for 98% of the benchmarks.
  • Performance: Most models were completed in under 12 minutes.
  • Comparative Advantage: In a complex "Automatic Transmission" benchmark, the proposed tool finished in 12 minutes, while the state-of-the-art tool RALib failed to produce a complete model after 10 hours.
  • Necessity of Active Learning: Passive learning via random sampling failed to achieve completeness in 29% of cases, highlighting the importance of the guided "gap-finding" logic.

Conclusion and Future Directions

This grey-box approach effectively bridges the gap between passive trace analysis and formal verification. While highly successful on auto-generated code, future work will explore its application to hand-written C code and more complex data structures like arrays. Additionally, extending the framework to handle Recursive State Machines could broaden its applicability to a wider range of software architectures.

Summary updated

BibTeX
@article{jeppu2022enhancing,
  author = {Natasha Yogananda Jeppu and Tom Melham and Daniel Kroening},
  title = {{Enhancing active model learning with equivalence checking using simulation relations}},
  journal = {Formal Methods Syst. Des.},
  year = {2022},
  doi = {10.1007/s10703-023-00433-y},
}
Figure