Abstract
Active learning of black-box systems is a cornerstone of formal verification and security analysis. While learning untimed systems is well-established, quantitative timing introduces significant complexity due to the infinite state space of real-time values. This paper presents $L^\#_{MMT}$, the first black-box active learning algorithm specifically designed for Mealy Machines with Timers (MMTs). By employing symbolic queries that abstract concrete time values into logical relationships, $L^\#_{MMT}$ efficiently reconstructs timed behavior. We demonstrate its effectiveness on a variety of benchmarks, showing that it handles multiple concurrent timers while maintaining polynomial complexity relative to the state space.
Introduction
Understanding the inner workings of "black-box" systems—where source code is unavailable—remains a major challenge. Active automata learning addresses this by interacting with a system to build a mathematical model from observations. While learning standard Mealy machines is well-understood, adding quantitative timing (e.g., "the system resets if no input is received for 5 seconds") often leads to a combinatorial blow-up in complexity.
Previous research focused on Timed Automata (TAs), but these models struggle with complex clock guards and resets in a black-box setting. This paper shifts focus to Mealy Machines with Timers (MMTs), a subclass of timed systems where behavior is driven by explicit timers that count down to zero and trigger observable "timeout" events. This structure is more amenable to learning because the cause of a timeout is explicitly linked to a prior timer initialization.
The $L^\#_{MMT}$ Algorithm
The core innovation of this work is $L^\#_{MMT}$, an extension of the $L^\#$ algorithm that moves from concrete timing to symbolic semantics. The algorithm relies on several key components:
- Symbolic Queries: Instead of querying specific real-number durations, the learner uses symbolic words. These words record which previous transition initialized a timer and its duration, allowing the learner to reason about the logic of timing rather than specific values.
- Wait Queries ($WQ^s$): This new query type allows the learner to discover active timers in a given state. In a black-box environment, internal timers are invisible; they must be inferred by waiting for potential expirations.
- Observation Tree and Folding: The algorithm constructs an observation tree to map symbolic behaviors to the states of the hidden machine. By identifying when nodes represent distinct states (a property called "apartness"), the tree is eventually "folded" into a concise hypothesis MMT.
Key Insights: Timers vs. Clocks
A fundamental insight of this research is that timers are superior to clocks for active learning. In Timed Automata, clocks increase indefinitely, and behavior depends on complex guards. In MMTs, timers decrease, making the trigger for a timeout easier to identify: if a timeout occurs, it must have been triggered by a specific timer set in the past.
To resolve potential ambiguities, the algorithm uses a "wiggling" technique. For race-avoiding systems, the learner can determine the cause of a timeout by slightly shifting the timing of input events and observing how the timeout's timing responds. This symbolic abstraction avoids the infinite state space of raw time values.
Experimental Evaluation
The algorithm was implemented in Rust and evaluated against several established benchmarks and new models, including:
- Protocol Models: AKM and TCP (Transmission Control Protocol).
- Standard Timed Benchmarks: Critical Section (CAS), Light, and Train controllers.
- Complex Models: An FDDI (Fiber Distributed Data Interface) station and synthetic MMTs.
In experimental trials, $L^\#_{MMT}$ learned most benchmark models (ranging from 3 to 12 states) in under 10 seconds. While the complexity is factorial relative to the number of concurrent timers ($|X|!$), it remains polynomial relative to the number of states ($|Q|$), making it viable for realistic systems with limited concurrent timing processes.
Conclusion and Future Work
$L^\#_{MMT}$ represents the first algorithm capable of learning MMTs with multiple timers in a purely black-box context. It successfully bridges the gap between symbolic reasoning and concrete timed observations. Future work will address "race conditions" where multiple timers expire simultaneously, explore models that allow multiple concurrent timer starts per transition, and investigate methods for automatically inferring integer timer durations when they are not known a priori.
Summary updated