arXiv:2412.08654cs.PLcs.AI2024-12被引 1

将行为树思想融入函数式编程,提升自主智能体的模块化与反应能力。

A Behavior Tree-inspired programming language for autonomous agents

  • 基于行为树设计可模块化、强反应性的函数式语言
  • 解决数据传递与安全监控等核心难题,实现复杂程序简洁表达
  • 适合机器人控制与自主系统开发人员快速上手

本文提出一种受行为树(Behavior Trees, BTs)启发的函数式编程语言设计,旨在克服传统行为树在功能扩展上的局限性。随着应用场景日益复杂,现有行为树模型难以满足模块化、反应性及数据交互的需求。本文识别出三大关键挑战:实现‘反应式’选择、‘监控’安全关键条件、以及动作间的数据传递。通过多个小型示例展示当前方法在保持模块性方面的不足,并提出一组简洁、可复用的编程原语来解决这些问题。文中给出完整语言规范,并以 Haskell 实现原型。最后,将一个大型复杂行为树成功转换为结构清晰、语义明确的程序,验证了该语言的有效性与实用性。

原文摘要 · Abstract (English)

We propose a design for a functional programming language for autonomous agents, built off the ideas and motivations of Behavior Trees (BTs). BTs are a popular model for designing agents behavior in robotics and AI. However, as their growth has increased dramatically, the simple model of BTs has come to be limiting. There is a growing push to increase the functionality of BTs, with the end goal of BTs evolving into a programming language in their own right, centred around the defining BT properties of modularity and reactiveness. In this paper, we examine how the BT model must be extended in order to grow into such a language. We identify some fundamental problems which must be solved: implementing `reactive' selection, 'monitoring' safety-critical conditions, and passing data between actions. We provide a variety of small examples which demonstrate that these problems are complex, and that current BT approaches do not handle them in a manner consistent with modularity. We instead provide a simple set of modular programming primitives for handling these use cases, and show how they can be combined to build complex programs. We present a full specification for our BT-inspired language, and give an implementation in the functional programming language Haskell. Finally, we demonstrate our language by translating a large and complex BT into a simple, unambiguous program.

行为树函数式编程自主代理模块化

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。