Causality-Based Game Solving

Christel Baier, Norine Coenen, Bernd Finkbeiner, Florian Funke, Simon Jantsch, Julian Siber

Abstract

Solving infinite-state two-player reachability games is a fundamental challenge in formal verification and program synthesis. Traditional state-unrolling techniques often fail when winning strategies require long sequences of actions or when the state space is vast. This paper introduces a novel algorithm that identifies "subgoals"—necessary causal milestones—to solve these games. By employing Craig interpolation to discover logical bottlenecks, the algorithm recursively decomposes the game into simpler "slices." Our implementation, CabPy, demonstrates superior performance and scalability compared to existing tools across various benchmarks, including the Game of Nim and complex museum-thief scenarios.

Introduction

In formal verification, we often model the interaction between a system and its environment as a two-player game. One player, REACH, attempts to drive the system into a target state, while the opponent, SAFE, tries to prevent this. While finite-state games are well-understood, many modern applications—such as software synthesis and the control of cyber-physical systems—operate over infinite state spaces.

Solving these infinite-state games is notoriously difficult and often undecidable. Existing approaches typically rely on bounded unrolling or the search for inductive invariants. However, these methods scale poorly when the winning strategy involves many steps or when the state space is high-dimensional. This paper proposes a shift from state-centric exploration to a causality-based approach, focusing on the essential milestones required for a win.

Methodology: Subgoals and Recursive Slicing

The core of our approach is the identification of subgoals. A subgoal is defined as a set of transitions that any winning path for the REACH player must traverse. These act as mandatory checkpoints in the game's logic.

Craig Interpolation for Discovery

To automatically identify these subgoals in an infinite state space, we utilize Craig interpolation. When the REACH player cannot win within a certain number of steps, the solver generates a logical formula (an interpolant) that separates the reachable states from the goal. This interpolant identifies a "bottleneck"—a necessary condition that must be satisfied for the REACH player to progress.

Recursive Slicing

Once a necessary subgoal is identified, the algorithm "slices" the original game into two parts:

  1. The Pre-game: The challenge of reaching the subgoal from the initial state.
  2. The Post-game: The challenge of reaching the final goal from the subgoal.

The algorithm proceeds recursively. If the REACH player has a guaranteed strategy to reach a subgoal, and a strategy to win from that subgoal, the subgoal is deemed sufficient. Conversely, if the SAFE player can prevent the REACH player from ever hitting a necessary subgoal, the SAFE player wins. This method produces symbolic strategies—logical rules for play—rather than explicit state lists, making the results more generalizable and explainable.

Experimental Evaluation

We implemented this algorithm in a tool called CabPy, built using Python and the PySMT library, utilizing MathSAT5 and Z3 as underlying solvers. We compared CabPy against SimSynth, a state-of-the-art tool for linear arithmetic reachability games.

Artifact Evaluation Badges

Benchmarks

The tools were tested on several challenging scenarios:

  • Game of Nim: A classic heap-based strategy game.
  • Corridor Game: A navigation task where the opponent can block paths.
  • Mona Lisa: A complex "museum thief" scenario where a thief must navigate a room while a guard periodically resets alarms.
  • Program Synthesis: Real-world tasks including thermostat control and bakery algorithm scheduling.

Results and Discussion

CabPy exhibited dramatic performance improvements over SimSynth, particularly in its ability to handle large state spaces.

  • Scalability in Nim: In a Nim game with heaps of (30, 31), CabPy found a solution in approximately 404 seconds. In contrast, SimSynth timed out at 600 seconds for heap sizes as small as (6, 6).
  • Linear Scaling: In the Corridor benchmark, CabPy's runtime scaled linearly with the number of rooms, solving a 100-room instance in 26 seconds. SimSynth failed to solve instances beyond 40 rooms.
  • Dimensional Independence: In the "Mona Lisa" game, CabPy remained efficient regardless of the physical dimensions of the room, whereas SimSynth's performance degraded rapidly as room size increased.

These results highlight the power of causality-based solving. By focusing on "what must happen" rather than "what state is next," CabPy effectively bypasses the irrelevant complexity of the state space.

Conclusion

This work demonstrates that causality-based decomposition is a potent technique for solving infinite-state games. By leveraging Craig interpolation to discover subgoals, we can solve complex problems that are intractable for traditional unrolling methods. Future work will focus on optimizing the quality of interpolants and extending the framework to generate deterministic strategies automatically.

Summary updated

BibTeX
@inproceedings{baier2021causality,
  author = {Christel Baier and Norine Coenen and Bernd Finkbeiner and Florian Funke and Simon Jantsch and Julian Siber},
  title = {{Causality-Based Game Solving}},
  booktitle = {CAV},
  year = {2021},
  doi = {10.1007/978-3-030-81685-8\_42},
}
Figure