---
title: 'Temporal Behavior Trees: Temporal Control'
url: https://www.emergentmind.com/topics/temporal-behavior-trees-tbt
type: topic
---

# Temporal Behavior Trees: Temporal Control

Temporal Behavior Trees (TBTs) are formalisms that make behavior trees temporally explicit. In the literature, the term covers several closely related constructions: continuous-time BT controllers modeled as discontinuous dynamical systems, BT executors compiled from temporal plans and Simple Temporal Networks (STNs), and BT-structured temporal specifications whose leaves are Signal Temporal Logic (STL) formulas and whose semantics support monitoring, repair, learning, and control synthesis [2109.01575], [2406.17379], [2509.08610], [2604.12092]. Across these variants, the common objective is to preserve the modular and hierarchical control-flow structure of BTs while making time, ordering, concurrency, and partial progress first-class formal objects.

## 1. Scope of the term and its main research lines

The literature does not use *Temporal Behavior Trees* for a single universally fixed syntax. Instead, it uses BT structure to organize temporal control or temporal specification in at least three technically distinct ways.

| Research line | Core formal object | Primary role |
|---|---|---|
| Continuous-time BTs | $\dot x = u_i(x),\ x \in \Omega_i$ | Controller analysis and convergence |
| STN-derived temporal BTs | BT compiled from an STN over snap actions | Temporal-plan execution |
| STL-based TBTs | BT operators over STL leaves | Specification, repair, and synthesis |

In the continuous-time line, a BT is interpreted as a hierarchical switching controller whose active vector field depends on the current state [2109.01575]. In the STN-based line, the BT is a runtime executor that respects causal and temporal constraints extracted from a PDDL 2.1 temporal plan, including required concurrency [2406.17379]. In the STL-based line, BT composition operators such as sequence, fallback, and parallel are lifted into a formal language over finite traces, enabling Boolean and robust semantics, trace segmentation, repair, and optimization-based synthesis [2509.08610], [2604.12092].

A common misconception is to equate TBTs with ordinary BTs plus timers. The published formalisms are more structured than that. They either introduce explicit state-space partitions and discontinuous flows, explicit STN-derived guards such as `WaitTime` and `CheckTime`, or compositional semantics over traces in which split points, suffixes, and quantitative robustness are part of the definition of satisfaction.

## 2. Continuous-time BTs as discontinuous dynamical systems

A continuous-time BT can be written as the closed-loop system
\[
\dot x = u_i(x), \quad x \in \Omega_i,
\]
where $x \in \mathbb{R}^n$ is the state, $u_i(x)$ is the local control law associated with node $T_i$, and $\Omega_i$ is the operating region in which that node is active [2109.01575]. This formalization treats BT execution as continuous in time rather than as a difference equation with step $\Delta t$.

The BT acts as a nested switching controller. For the root node, the state space is partitioned by child operating regions. A representative construction is
\[
\Omega_0 = \mathbb{R}^n = \Omega_1 \cup \Omega_2 = \Omega_1 \cup \Omega_3 \cup \Omega_4,
\]
with $\{\Omega_1,\Omega_3,\Omega_4\}$ pairwise disjoint, and the root controller given by
\[
u_0(x) =
\begin{cases}
u_1(x) & \text{if } x \in \Omega_1,\\
u_3(x) & \text{if } x \in \Omega_3,\\
u_4(x) & \text{if } x \in \Omega_4.
\end{cases}
\]
Each node further carries a region of relevance or operating region $R_i$, a success region $S_i$, and a failure region $F_i$, with $\{R_i,S_i,F_i\}$ pairwise disjoint for a single BT node.

This induces piecewise-defined continuous-time evolution: trajectories flow under one vector field within a region and switch when the state enters a region that activates a different child. The resulting object is a discontinuous dynamical system and therefore a subclass of hybrid dynamical systems. The analysis explicitly invokes discontinuous-system theory, including Filippov solutions, and uses existence and uniqueness results as preliminaries for a general convergence theorem with sufficient conditions for convergence to a desired equilibrium point or desired region of the state space [2109.01575].

The significance of this formulation is methodological. Earlier BT analyses had already compared BTs and hybrid systems, but only informally and only in discrete time. The continuous-time formulation allows BT controllers to be analyzed with continuous-time control tools, nonsmooth dynamics, and convergence arguments that are not naturally available in purely sampled BT semantics. The same framework can also absorb open-loop or time-dependent policies by augmenting the state with time,
\[
y=(x,t), \qquad \dot y = (\dot x,\dot t) = (f(x,u(x,t),t),1),
\]
thereby recasting time-dependent execution as augmented state feedback.

## 3. Temporal-plan execution via STNs and BT compilation

A second TBT line addresses the execution of temporal plans in uncertain robotic environments. The motivating setting is a PDDL 2.1 temporal plan
\[
T = \{(t_1,a_1,d_1), \dots, (t_n,a_n,d_n)\},
\]
where each tuple is a time-triggered durative action occurrence, with start time $t_i \in \mathbb{R}^+$, durative action $a_i \in DA$, and actual duration $d_i \in [\omega_{\min}(a_i), d_{\max}(a_i)]$ [2406.17379]. A durative action $a$ is described by start and end snap actions $a^{-}$ and $a^{+}$, an overall condition $\mathrm{overall}(a)$, and duration bounds $\omega_{\min}(a)$ and $\omega_{\max}(a)$.

The plan is first transformed into an induced simple plan over instantaneous snap actions at the happening time points
\[
H(TT) = \{t \mid (t,a,d)\in TT\} \cup \{t+d \mid (t,a,d)\in TT\}.
\]
An STN is then built as a directed weighted graph $G=(V,E)$ whose edges encode difference constraints
\[
T_Y - T_X \le d_{xy}.
\]
A pair of opposite bounds yields an interval, so that if $X \to Y$ has weight $10$ and $Y \to X$ has weight $-6$, then $6 \le T_Y - T_X \le 10$ [2406.17379].

The STN construction algorithm operates over snap-action nodes rather than whole actions. Each node contains fields such as the action start time, action expression, duration, snap-action type in $\{\mathrm{START},\mathrm{END}\}$, grounded conditions, grounded effects, and incoming and outgoing links. The resulting STN includes satisfying links, threat avoidance links, and temporal links. `GETSATISFY` searches backward for actions whose effects make a condition become true, while `GETTHREAT` detects actions that invalidate preconditions or effects and enforces PDDL 2.1’s no moving targets rule. After graph construction, Floyd–Warshall APSP is applied to propagate all-pairs temporal bounds.

The second stage compiles the STN into a BT. Each STN node becomes a BT template. Start-action templates include `CheckAtStart`, `CheckOverall`, `CheckTime`, `ExecuteAction`, and `ApplyAtStart`; end-action templates include `CheckAtEnd`, `WaitAction`, `WaitTime`, `ApplyAtEnd`, and `CheckAction` [2406.17379]. The tree is generated by depth-first search with the explicit restriction that each STN node may appear only once in the BT, so every node in the BT has at most one parent. Revisited dependencies are encoded by waiting or checking nodes rather than subtree duplication. If a node has multiple outgoing links, the construction inserts `PARSTART(|n.Y|, t+1)` and `PARFINISH(t+1)`, enabling runtime concurrency.

The essential temporal mechanism is therefore not merely time stamping, but the embedding of event-based and time-based constraints into executable control flow. `WaitTime(t)` delays execution until a prescribed time, `CheckTime(t)` fails if the time window has been missed, `WaitAction(a)` blocks until a predecessor action completes, and `CheckAction(a)` fails if a required predecessor has not completed when needed. This permits required concurrency, including cases in which one action must execute strictly between the start and end of another. In the reported PlanSys2 implementation, the improved `STNBTBuilder` preserved concurrency and reduced mean execution time relative to the previous `SimpleBTBuilder` in a real Tiago robot laboratory task: mean \(220.57\) s versus \(200.20\) s over 10 runs, with the other reported statistics following the same trend [2406.17379].

## 4. TBTs as hierarchical temporal specifications over traces

A third and increasingly prominent formulation treats TBTs as a specification language over finite traces. The syntax combines BT composition operators with STL leaves:
\[
T ::= Fback([T,\dots,T]) \mid Par_M([T,\dots,T]),\ M \in \mathbb{N} \mid Seq([T,T]) \mid Leaf(\varphi),
\]
where $\varphi$ is an STL formula [2509.08610], [2604.04225]. The intended meanings are standard BT-style control flow lifted to trace semantics: `Fallback` succeeds if at least one child succeeds, `Parallel_M` succeeds if at least $M$ distinct children succeed, `Sequence` requires that the trace can be split into a prefix satisfying the first child and a suffix satisfying the second, and `Leaf(\varphi)` reduces to STL satisfaction.

The Boolean semantics is defined directly over finite traces. In particular, fallback introduces existential choice over both child index and suffix, parallel requires a sufficiently large subset of children to hold over the same trace segment, and sequence introduces an existential split point [2509.08610]. This turns BT composition from an operational control idiom into a compositional specification language.

The quantitative extension is robust semantics. Instead of returning only true or false, the semantics returns a real value whose sign indicates satisfaction or violation and whose magnitude indicates the degree of satisfaction or violation. The key algebraic rule is that $\exists$ and $\vee$ are replaced by $\max$, while $\forall$ and $\wedge$ are replaced by $\min$ [2509.08610]. For example, for a finite execution trace $\sigma$,
\[
\rho(\Sequence([\tree_1,\tree_2]),\sigma) =
\max_{u\in[0,|\sigma|-1]}
\min\big(\rho(\tree_1,\sigma[:u]),\rho(\tree_2,\sigma[u+1:])\big),
\]
\[
\rho(\Parallel_M([\tree_1,\dots,\tree_k]),\sigma)=
max_M\big(\rho(\tree_1,\sigma),\dots,\rho(\tree_k,\sigma)\big),
\]
\[
\rho(\Fallback([\tree_1,\dots,\tree_k]),\sigma)=
\max_{j\in[1,k]}\max_{i\in[0,|\sigma|-1]} \rho(\tree_j,\sigma[i:]),
\]
and
\[
\rho(\Leaf(\varphi),\sigma)=\rho(\varphi,\sigma)
\]
[2604.04225].

This specification view makes TBTs structurally close to BTs while preserving the formal expressiveness of STL at the leaves. The literature positions them explicitly between standard BTs and temporal logics: BTs supply modularity, readability, sequence, fallback, parallel composition, and repetition; STL supplies formal temporal predicates over trajectories [2509.08610]. The resulting language is used for task decompositions such as UAV ship landing phases or multi-goal reach-avoid tasks, including specifications like
\[
\Parallel_2(\F \mathit{reachGoal_A},\F \mathit{reachGoal_B},\F \mathit{reachGoal_C}),
\]
which encodes that any two of three goals must eventually be reached [2604.04225].

A useful correction to a common oversimplification is that, in this line of work, TBT leaves are not necessarily actions. They are local temporal properties, and the tree composes those properties rather than directly prescribing a controller implementation.

## 5. Monitoring, trace repair, and learning from imperfect behavior

Once TBTs are given formal trace semantics, they support post hoc analysis and repair. The trace-repair problem is posed as follows: given a system model $M$, a TBT specification $T$, and a violating trace $\sigma$ with $\sigma \not\models T$, compute a repaired trace $\sigma_R$ that satisfies $T$ while changing the original trace as little as possible [2509.08610]. The repair preserves trace length, and if no repaired trace of the same length exists, the output is $\textsf{none}$.

A generic repair formulation is
\[
\arg\min_{\sigma_R} J(\sigma,\sigma_R)
\]
subject to model consistency, TBT satisfaction, and any additional repair constraints [2509.08610]. The reported costs include \(L_1\) distance, Hamming distance, TBT robustness, and a weighted combination of these terms. In a related learning framework, the analogous optimization is written for a violating demonstration trajectory $\tau$ and a repaired trajectory $\tau_R$ of the same length, with
\[
J(\tau,\tau_R)=\sum_{t=0}^{|\tau|-1} d(s_t,s_t^R),
\]
where $d$ is Manhattan distance in grid-world and Euclidean distance in continuous tasks [2604.04225].

The direct optimization is expressed as a mixed-integer linear program. For full TBT repair, the encoding uses segment-indexed binary variables \(z_{[t_1:t_2]}^T\), with representative clauses for `Leaf`, `Fallback`, `Par_M`, and `Seq`, and the paper reports that this requires \((|AP| + |T|)\cdot N^2\) binary variables for a trace of length \(N\) [2509.08610]. That scaling makes monolithic MILP impractical on long traces.

Two practical strategies address this. **Incremental repair** exploits trace segmentation with respect to a TBT, repairing violated local segments first and enlarging scope only when necessary; the procedure is described as sound and terminating [2509.08610]. **Landmark-based repair** handles disjunctive choices by selecting candidate witnesses using robust semantics as a heuristic, replacing many mixed-integer choices with a more efficient linear program when possible. Empirically, the method repaired traces with more than 25,000 entries in under ten minutes while the full MILP ran out of memory, and on the UAV ship-landing benchmark the landmark-based method found a first solution after about 12 seconds and a comparable-quality solution in about 40 seconds [2509.08610].

TBT-guided repair has also been integrated into downstream policy learning. In that setting, demonstrations that violate a TBT are first repaired; the repaired set is then used to extract potential functions over pose space, which shape reinforcement-learning rewards in the standard potential-based form
\[
r'(s_t,s_{t+1}) = r_{\text{env}(s_t,s_{t+1}) + \gamma F(\mathbf{p}_{t+1}) - F(\mathbf{p}_t),
\]
with the explicit claim that this does not alter the set of optimal policies [2604.04225]. The repaired trajectories thus serve simultaneously as logically consistent data, interpretable corrections, and a source of shaping structure. Reported results include repairs under 1 second in a \(10 \times 10\) grid-world, repairs under 3 seconds in a continuous single-agent reach-avoid task, 100% success for both the proposed method and an expert-reward PPO baseline in the single-agent setting, and a 47% lower cost rate than the expert-reward baseline in the multi-agent setting [2604.04225].

## 6. Three-valued and ternary semantics for execution and synthesis

A recurring semantic issue in BTs is that node status is not naturally Boolean. Standard execution distinguishes success, failure, and running. An early formal bridge modeled BT control flow with a three-valued “Active Logic” whose values are \(F\) for failing, \(U\) for running or indeterminate, and \(T\) for complete or success, and mapped sequence and selector to short-circuiting logical operators in C# [2011.03835]. That work also emphasized the distinction between stateless execution, in which composites re-evaluate from the beginning on each tick, and stateful execution, in which progress is remembered between ticks.

This three-valued perspective is carried into recent TBT synthesis work through Kleene’s strong logic \(K_3\), with truth values \(F\), \(U\), and \(T\) explicitly identified with BT statuses Failure, Running, and Success [2604.12092]. The central use of \(U\) is to represent cases where a partial trajectory has neither fully satisfied nor fully violated a temporal specification. The same value is also used to encode uncertainty near predicate thresholds:
\[
\mu(x_t):=
\begin{cases}
T, & f(x_t)\geq\delta,\\
U, & -\delta<f(x_t)<\delta,\\
F, & f(x_t)\leq-\delta,
\end{cases}
\]
for a user-defined uncertainty threshold $\delta > 0$.

Within this framework, TBT syntax extends STL by adding BT-inspired operators
\[
\varphi:=\psi\,\vert\,\seq{(\varphi_1,\dots,\varphi_k)}\,\vert\,\sel{(\varphi_1,\dots,\varphi_k)},
\]
where $\psi$ is an STL formula [2604.12092]. For binary sequence and selector, the semantics is defined by existentially quantifying a split point over the available partial horizon:
\[
x,t_1,t_2 \models \seq{(\varphi_1,\varphi_2)}
\quad\text{iff}\quad
\exists \tau \in [t_1,t_2-1]:
(x,t_1,\tau \models \varphi_1)\wedge(x,\tau+1,t_2 \models \varphi_2),
\]
\[
x,t_1,t_2 \models \sel{(\varphi_1,\varphi_2)}
\quad\text{iff}\quad
\exists \tau \in [t_1,t_2-1]:
(x,t_1,\tau \models \varphi_1)\vee(x,\tau+1,t_2 \models \varphi_2).
\]

The same paper gives mixed-integer encodings for partial-trajectory STL and TBTs. Ternary truth values are mapped to integers by
\[
T \mapsto +1,\qquad U \mapsto 0,\qquad F \mapsto -1,
\]
so each satisfaction variable is \(z_t^\varphi \in \{-1,0,+1\}\) [2604.12092]. Predicate satisfaction is encoded with three binaries and big-\(M\) constraints; negation becomes \(z_t^{\neg\varphi}=-z_t^\varphi\); conjunction and disjunction become min and max over ternary variables. For timed formulas over partial horizons, the encodings distinguish the case where the temporal window is fully contained in the available horizon from the case where it is not, in which case the result can remain \(U\) unless a definite short-circuit value is already available. Sequence and selector are then encoded recursively using conjunctions, disjunctions, and split points.

This enables correct-by-construction control synthesis for linear dynamical systems
\[
x_{t+1}=A_t x_t+B_t u_t,\qquad y_t=C_t x_t+D_t u_t,
\]
with a finite-horizon mixed-integer quadratic program that minimizes quadratic effort while enforcing TBT satisfaction [2604.12092]. The paper reports explicit complexity growth for the sequence operator—\(O((t_2-t_1)^{k-1})\) constraints for \(k\) subformulas and as much as \(O(T^{k+1})\) over the full horizon—highlighting the computational cost of partial-horizon reasoning. The broader implication is that ternary semantics turn TBTs from an offline monitoring and repair formalism into a specification language suitable for synthesis under finite-horizon uncertainty.

Taken together, these strands show that TBTs are best understood as a family of temporal extensions of BTs rather than a single fixed calculus. The unifying principle is the preservation of BT modularity under formal temporal semantics: state-space partitions and switching in continuous-time control, STN-derived guards in temporal-plan execution, and compositional Boolean, robust, or ternary semantics in specification, repair, learning, and synthesis.

Source: https://www.emergentmind.com/topics/temporal-behavior-trees-tbt