Automata with Timers

Véronique Bruyère, Guillermo A. Pérez, Gaëtan Staquet, Frits W. Vaandrager

Introduction

Since the 1990s, Timed Automata (TA) have served as the standard formal model for real-time systems, such as network protocols and medical devices. In TA, "clocks" increment at a constant rate, and transitions are governed by logical guards (e.g., $x > 5$). However, TA face two significant challenges: they are difficult to learn from black-box observations due to complex guards, and they do not align well with physical hardware, which typically utilizes countdown timers rather than infinite clocks.

This paper introduces Automata with Timers (AT), a model designed to bridge this gap. By using countdown timers that trigger transitions upon reaching zero, AT provides a more physically realistic framework that is potentially more amenable to automated learning.

The Automata with Timers Model

In the AT model, each state is associated with a set of active timers. Transitions are triggered either by external inputs or by the expiration of a timer. A key constraint in this model is that each transition can start or restart at most one timer, making it more restricted—and thus more learnable—than general TA.

An example of an Automaton with Timers (AT) with states $q_0$ through $q_3$ and timers $x_1, x_2$.

As shown in Figure 1, transitions are labeled with inputs (like $i$ or $to[x]$) and timer operations. For instance, a transition might be triggered by the timeout of $x_1$ ($to[x_1]$) and subsequently set a new value for $x_1$ or $x_2$.

Analyzing Races and the "Wiggling" Technique

A central challenge in multi-timer systems is the occurrence of races, where multiple timers expire simultaneously. Races introduce non-determinism, complicating verification and learning. To address this, the authors propose a novel "wiggling" characterization.

The technique involves grouping sequences of actions into "blocks"—typically an input followed by the timeouts it triggers. By slightly adjusting (or "wiggling") the delays between inputs, one can determine if a race is inherent to the system's logic or merely a coincidental timing event.

Illustration of wiggling. Timed run $\rho$ contains a race, while timed run $\sigma$ is a "wiggled" version that separates the events.

A run is considered race-avoiding if it can be wiggled to separate all simultaneous timeouts without altering the sequence of events. The authors demonstrate that an automaton is race-avoiding if and only if the "Block Graph" of every possible run is acyclic.

Complexity and Key Results

The paper establishes several critical theoretical bounds for AT:

  • Reachability: Determining if a specific state (such as an error state) is reachable is PSPACE-complete, matching the complexity of standard Timed Automata.
  • Race-Avoidance: Deciding if an automaton is race-avoiding is PSPACE-hard and falls within 3EXP. However, for a fixed number of timers and inputs—a common scenario in practice—the complexity reduces to PSPACE.
  • Formal Characterization: The authors provide a logic-based description of "unwigglable" runs using Monadic Second-Order logic, facilitating the development of automated verification tools.

Conclusion and Future Directions

While Automata with Timers are not merely "clocks in reverse," their constraints offer unique advantages for system modeling and inference. The "wiggling" characterization provides a robust mathematical foundation for handling concurrency in timed systems.

The ultimate goal of this research is to enable active learning for multi-timer systems. By leveraging these results, future work aims to develop algorithms that can observe a black-box system's timed behavior and automatically synthesize a corresponding AT model, a significant hurdle in current formal methods research.

Summary updated

BibTeX
@inproceedings{bruyere2023automata,
  author = {Véronique Bruyère and Guillermo A. Pérez and Gaëtan Staquet and Frits W. Vaandrager},
  title = {{Automata with Timers}},
  booktitle = {FORMATS},
  year = {2023},
  doi = {10.1007/978-3-031-42626-1\_3},
}
Figure