Formalizing Stateful Behavior Trees

Serena Serafina Serbinowska, Preston Robinette, Gabor Karsai, Taylor T. Johnson · OpenReview

TL;DR

This paper introduces "Stateful Behavior Trees" (SBTs), a formalization of Behavior Trees that includes auxiliary variables and environmental interaction, making them Turing-complete. They also present a new Domain Specific Language (DSL) and an enhanced verification tool, BehaVerify, which significantly outperforms existing tools in scalability.

What Problem Does This Paper Address?

Behavior Trees (BTs) are increasingly used for complex planning tasks, especially in safety-critical domains like robotics. However, their informal nature makes formal verification challenging. Existing BT formalizations often lack support for crucial features like persistent memory (blackboards) and dynamic environments, which are common in real-world applications. This paper addresses the need for a formal model of BTs that can handle these complexities, enabling robust verification of safety and liveness properties.

Methods

The core contribution is the formalization of Stateful Behavior Trees (SBTs). SBTs extend traditional BTs by incorporating:

  • Auxiliary Variables: These are stored in a persistent shared memory, often called a "blackboard," allowing BTs to maintain state across execution steps.
  • Environmental Interaction: SBTs can operate within an environment that can change over time, and these changes can be nondeterministic.

The authors demonstrate that SBTs with unbounded integer variables on their blackboard are computationally equivalent to Turing Machines. Conversely, when auxiliary variables are restricted to finite types, SBTs are equivalent to Finite State Automata.

To support this formalization, they introduce a Domain Specific Language (DSL) for writing SBTs. This DSL is integrated into an existing verification tool, BehaVerify, which has been significantly reworked. The new BehaVerify can generate nuXmv models for formal verification, as well as Haskell code and Python implementations of the SBTs.

Datasets

Not discussed in the paper. The paper focuses on formalization and verification of a specific type of computational model (SBTs) rather than training on empirical data.

Key Insights and Ideas

  • Turing Completeness of BTs with State: The formalization proves that BTs, when equipped with a blackboard capable of storing unbounded integers, possess the full computational power of Turing Machines. This is a significant theoretical result, highlighting the expressive power of these hierarchical control structures.
  • Bridging Theory and Practice: By formalizing SBTs and integrating them into BehaVerify with a user-friendly DSL, the paper bridges the gap between theoretical computer science concepts (Turing Machines, FSMs) and practical robotics applications.
  • Scalability is Crucial for Verification: The paper strongly emphasizes the importance of scalability in verification tools. Their reworked BehaVerify demonstrates a dramatic improvement over existing tools, handling trees orders of magnitude larger.
  • Fastforwarding Execution: The paper highlights the effectiveness of "fastforwarding" execution in BehaVerify. This technique allows for the entire execution of a tick to be represented in a single state, drastically reducing the state space and improving verification performance compared to stepping through each node individually.

Key Results

  • Computational Equivalence: SBTs are shown to be equivalent to Turing Machines (with unbounded blackboard) and Finite State Automata (with finite blackboard).
  • BehaVerify Performance: The reworked BehaVerify tool, using the new SBT DSL, significantly outperforms MoVe4BT. In one experiment, BehaVerify handled trees with 20,000 nodes in the time MoVe4BT took for 200 nodes, a 100x improvement in scalability.
  • Verification of Complex Properties: BehaVerify successfully verifies temporal logic specifications (LTL, CTL) on SBTs, including those involving complex interactions and nondeterminism.

Limitations and Future Work

  • Limitations:
    • The current implementation of BehaVerify does not support true parallelism in parallel nodes, instead executing them sequentially.
  • While the DSL allows for various types, the underlying nuXmv model generation might have limitations with certain complex types or very large numbers of states.
  • Future Work:
    • Improving the encoding of array variables.
  • Developing a graphical user interface for SBT creation.
  • Visualizing counterexamples generated by nuXmv.
  • Expanding support for unbounded variable types in nuXmv for bounded model checking (BMC).
  • General performance improvements.

Summary updated

BibTeX
@inproceedings{serbinowska2024formalizing,
  author = {Serena Serafina Serbinowska and Preston Robinette and Gabor Karsai and Taylor T. Johnson},
  title = {{Formalizing Stateful Behavior Trees}},
  booktitle = {FMAS@iFM},
  year = {2024},
  url = {https://openreview.net/forum?id=vd8mrsb0RY},
}
Figure