---
title: Boolean-Based Control Barrier Functions
url: https://www.emergentmind.com/topics/boolean-based-control-barrier-functions
type: topic
---

# Boolean-Based Control Barrier Functions

Boolean-based control barrier functions are control barrier function (CBF) constructions in which complex safety specifications are encoded as Boolean compositions of primitive state constraints. In this setting, each primitive safe set is typically written as \(C_i=\{x:h_i(x)\ge 0\}\), conjunctions are represented by intersections or pointwise minima, disjunctions by unions or pointwise maxima, and negation by sign reversal. The resulting composite safe set may be enforced through a single scalar barrier, a collection of simultaneous barrier inequalities, a piecewise-defined nonsmooth barrier, a mixed-integer formulation, or a matrix inequality. Across the literature, the principal technical issue is that exact Boolean composition is natural at the level of sets but often introduces nonsmoothness, feasibility problems, switching, or combinatorial growth in the online safety filter [2309.06647][2309.06494][2508.11795][2509.10716].

## 1. Logical encoding of safety sets

In the standard continuous-time control-affine setting,
\[
\dot x = f(x)+g(x)u,
\]
a safe set is represented as
\[
C=\{x\in\mathbb R^n:h(x)\ge 0\}.
\]
For multiple primitive sets \(C_i=\{x:h_i(x)\ge 0\}\), Boolean set operations are encoded directly at the barrier level. Identity can be represented by \(\gamma_i\circ h_i\) for any class-\(\mathcal K\) \(\gamma_i\); negation is represented by \(-h_i\); union is represented by \(\max_i h_i(x)\); and intersection is represented by \(\min_i h_i(x)\). Arbitrary Boolean safety specifications can therefore be built from repeated applications of negation, \(\max\), \(\min\), and optional scaling by class-\(\mathcal K\) functions [2309.06647].

The same semantic correspondence appears in discrete-time and logic-driven formulations. In discrete time, the safe set is again written as \(\mathcal S=\{x:h(x)\ge 0\}\), but Boolean operators are encoded in mixed-integer form: negation by \(-h_i(x)\ge 0\), conjunction by requiring \(h_i(x)\ge 0\) for all \(i\), disjunction by binary variables, slack variables, and SOS-1 constraints, and implication or if-then-else rules by reducing them to disjunctions. This framework was used to represent piecewise barrier functions and switched-mode safety conditions [2004.01858].

The logic-to-barrier correspondence also underlies temporal-logic control. In a barrier-based treatment of a restricted fragment \(LTL_{robotic}\), each atomic proposition \(\pi\) is assigned a barrier function \(h_\pi\) with
\[
\llbracket \pi\rrbracket = \{x\in\mathcal X\mid h_\pi(x)\ge 0\},
\]
while negation is represented by \(h_{\overline\pi}(x)=-h_\pi(x)\). Conjunction and disjunction of propositions then become intersections and unions of barrier-defined sets, and the temporal operators \(\Box,\Diamond,\Box\Diamond,\Diamond\Box\) are reduced to invariance, finite-time reachability, recurrence, and persistence subproblems solved through barrier-constrained quadratic programs [1908.04903].

This logical encoding is the conceptual core of Boolean-based CBFs: safety specifications are written as formulas over primitive predicates, then realized as barrier superlevel sets that can be inserted into optimization-based controllers.

## 2. Exact Boolean composition and nonsmooth barriers

Exact Boolean composition is set-theoretically natural, but it produces nonsmooth composite barriers. For example,
\[
h(x)=\min_{i=1,\dots,p} h_i(x)
\]
is locally Lipschitz but not differentiable at points where multiple constraints tie for the minimum. At such points, the classical Lie derivative \( \nabla h(x)f(x)\) is undefined, so the standard smooth CBF condition cannot be applied directly. A deterministic nonsmooth formulation addresses this by using the Clarke generalized gradient
\[
\partial h(x)=\operatorname{Co}\Big\{v:\exists x_i\to x,\ \nabla h(x_i)\to v\Big\},
\]
and the nonsmooth CBF condition
\[
\sup_{u\in \mathbb R^m}\inf_{\zeta\in\partial h(x)} \Big(\zeta\,(f(x)+G(x)u)+\alpha(h(x))\Big)\ge 0.
\]
For a minimum of smooth functions, Clarke’s result yields
\[
\partial h(x)\subseteq \operatorname{Co}\{\nabla h_i(x): i\in \mathcal A(x)\},
\]
where \(\mathcal A(x)=\{i:h_i(x)=h(x)\}\) is the active set. The same work emphasizes that selecting one Clarke vertex gives a valid nonsmooth directional derivative but is not by itself enough to guarantee forward invariance at corners; the counterexample \(h(x)=\min\{x_1,x_2\}\) at \((0,0)\) shows that enforcing only one active constraint can leave another boundary unconstrained [2606.25333].

A stochastic formulation reaches the same nonsmoothness issue from a different direction. There the safe set is written as
\[
\mathcal C = \{x\in\mathcal X \mid h(x)\ge 0\},
\]
but \(h\) may be a nested composition of \(\min\) and \(\max\). Conjunctions correspond to intersections and minima; disjunctions correspond to unions and maxima. A representative example is
\[
(\mu_o \ge 0)\ \land\ \bigl(\mu_{n_1}\ge 0 \ \lor\ \mu_{n_2}\ge 0\bigr),
\qquad
h(x) = \min\!\bigl(\mu_o(x),\ \max(\mu_{n_1}(x),\mu_{n_2}(x))\bigr).
\]
To handle the nonsmooth switching surfaces, the state space is partitioned into finitely many regions \(\{\Phi_i\}_{i=1}^N\), with \(h(x)=h_i(x)\) on each region and \(h_i=h_j\) on shared boundaries. Under non-degenerate diffusion, the process almost surely does not remain on a partition boundary over a finite interval, so the analysis can proceed regionwise without generalized gradients. This yields partition-wise stochastic barrier conditions and an almost-sure forward invariance result for the full nonsmooth Boolean safe set [2309.06494].

These exact nonsmooth formulations preserve the intended logical safe set. The technical cost is the need for Clarke-subgradient arguments, partition-wise reasoning, or simultaneous enforcement of multiple active branches.

## 3. Smooth Boolean composition

A different design choice is to smooth the Boolean composition itself and recover a continuously differentiable barrier that can be used in standard single-constraint CBF-QPs. For unions, one smooth approximation is
\[
h(x)=\frac{1}{\kappa}\ln\!\left(\sum_{i\in I}e^{\kappa h_i(x)}\right),
\qquad \kappa>0,
\]
which over-approximates \(\max_i h_i(x)\) and satisfies
\[
\max_i h_i(x)\le h(x)\le \max_i h_i(x)+\frac{\ln N}{\kappa}.
\]
For intersections, the corresponding approximation is
\[
h(x)=-\frac{1}{\kappa}\ln\!\left(\sum_{i\in I}e^{-\kappa h_i(x)}\right),
\]
which under-approximates \(\min_i h_i(x)\) and satisfies
\[
\min_i h_i(x)-\frac{\ln N}{\kappa}\le h(x)\le \min_i h_i(x).
\]
These constructions extend recursively to nested Boolean formulas through exponentiated quantities \(H_i^\ell\), and the resulting composed \(h\) can be shifted by a buffer \(b\) so that the smooth safe set lies inside or contains the exact Boolean set. As \(\kappa\to\infty\), the approximation converges to the exact \(\max/\min\) composition [2309.06647].

The same paper derives closed-form recursive derivatives for the composed function and uses the resulting single smooth \(h\) in a standard safety filter,
\[
k(x)=\arg\min_u \|u-u_{\text{des}}(x)\|^2
\quad \text{s.t.}\quad
\dot h(x,u)\ge -\alpha(h(x)).
\]
This converts a nested Boolean safety specification into one continuously differentiable barrier and one CBF inequality, rather than a set of potentially incompatible pointwise constraints [2309.06647].

Under noisy inputs, smoothing has also been used in stochastic multi-agent control. There, a Boolean-composed ensemble barrier \(h_\Sigma\) is replaced by a piecewise polynomial smoothing \(\hat h_\Sigma\) obtained from a polynomial approximation \(\hat\phi\) of the discontinuous switching function \(\phi\). The resulting controller is synthesized through a stochastic quadratic program or stochastic model-predictive control problem with a chance-constrained CBF inequality. The same study contrasts the polynomial approximation with log-sum-exp smoothing, stating that the polynomial smoothing is “more conservative but safer,” “less sensitive” to the smoothing parameter, and gives “more conservative control actions.” For the chosen polynomial smoothing with \(k=2\), it reports
\[
\mathbb E\left[\|\hat e\|_{L^1[a,b]}\right] \le \frac{15^2}{8},
\]
and the proposed method maintained safety in all 100 simulation runs [2311.03284].

Smooth Boolean composition therefore trades exactness at the barrier level for differentiability and conventional optimization. The literature treats that trade-off explicitly: smoothing can enable continuous control laws, but it can also enlarge, shrink, or otherwise distort the exact logical safe set.

## 4. Feasibility, compatibility, and safety-filter design

Boolean composition is not only a representational issue; it is also a feasibility issue. If multiple barrier inequalities are enforced directly,
\[
\min_u \|u-u_{\text{des}}(x)\|^2
\quad \text{s.t.}\quad
\dot h_i(x,u)\ge -\alpha_i(h_i(x)),\ \forall i,
\]
the quadratic program may be infeasible even if each individual barrier condition is feasible. A necessary and sufficient feasibility condition is
\[
\sum_{i\in I}\lambda_i L_g h_i(x)=0 \implies \sum_{i\in I}\lambda_i\big(L_f h_i(x)+\alpha_i(h_i(x))\big)\ge 0
\quad \forall \lambda_i\ge 0,
\]
and this condition motivates the construction of a single composed CBF rather than a direct multi-constraint formulation [2309.06647].

A separate line of work studies this issue as compatibility. For input-constrained systems
\[
\dot x = f(x) + g(x)u,
\qquad u\in\mathbb U,
\]
with safe set
\[
\mathcal C = \{x\in\mathbb R^n : h_i(x)\ge 0,\; i\in\mathcal I\},
\]
the feasible input set is
\[
K(x)=\left\{u\in\mathbb U:\; L_f h_i(x)+L_g h_i(x)\,u+\alpha_i(h_i(x))\ge 0,\;\forall i\in\mathcal I \right\}.
\]
The CBFs are compatible if \(K(x)\neq\emptyset\) for all \(x\) in the region of interest, and robustly compatible with robustness level \(\eta>0\) if the inequalities hold with a uniform margin \(\eta\). An offline algorithm based on grid sampling and refinement checks compatibility by solving a local margin problem,
\[
\begin{aligned}
c(x)=\max_{u,t}\quad & t\\
\text{s.t.}\quad & A(x)u+b(x)\ge t\mathbf 1_N,\quad u\in\mathbb U,
\end{aligned}
\]
then expanding certified neighborhoods through Lipschitz bounds and refining uncertain cubes. If the algorithm terminates, it gives the correct answer; under robust compatibility and bounded \(\mathbb U\), it terminates in finite steps [2209.02284].

Feasibility can also be improved by altering how multiple logical requirements are enforced. In the temporal-logic framework, multiple reachability requirements are not always imposed as separate finite-time barrier constraints. Instead, a composed finite-time barrier inequality on a weighted sum enlarges the feasible control set relative to the separate-constraint formulation, while zeroing CBFs can be relaxed by weighted slack variables to prioritize safety clauses. The same work is explicit that exact temporal-logic satisfaction is guaranteed only when the QP controller remains feasible; if slack variables become nonzero, the formal satisfaction theorem no longer strictly applies [1908.04903].

Taken together, these results make a recurrent point: Boolean structure can be encoded cleanly at the level of sets, but the online safety filter must still confront actuator bounds, simultaneous barrier satisfaction, and the geometry of the admissible control set.

## 5. Deterministic, matrix-valued, and combinatorial formulations

A deterministic nonsmooth approach based on dual numbers addresses real-time execution directly. For
\[
h(x)=\min_i h_i(x),
\]
the system state and vector field are embedded in the dual-number ring
\[
\mathbb D=\mathbb R[\epsilon]/(\epsilon^2),
\qquad z=a+b\epsilon,\quad \epsilon^2=0.
\]
For a multivariable barrier \(h\) and direction \(v\),
\[
x_{\mathbb D,v}=x+v(x)\epsilon,
\qquad
\tilde h(x_{\mathbb D,v})=h(x)+L_v h(x)\,\epsilon.
\]
One forward pass through the original arithmetic program computing \(h\) then returns both the barrier value and its exact directional derivative. In a composite minimum, floating-point comparison deterministically selects the first minimizer in a fixed left-to-right order,
\[
i_*(x)=\min \mathcal A(x),
\]
and the selected gradient is a valid Clarke subgradient. To guarantee forward invariance, however, the controller still enforces all \(\delta\)-active constraints in a QP. The paper states that if evaluating \(h\) costs \(C_h\) elementary operations, then evaluating \(\tilde h\) costs at most \(4C_h\) real operations, independent of state dimension \(n\), number of constraints \(p\), active-set size, and local geometry of the boundary [2606.25333].

Matrix control barrier functions replace scalar barriers by symmetric matrix functions \(H:\mathbb R^n\to\mathbb S^p\). In the semidefinite case,
\[
C = \{x\in\mathbb R^n \mid H(x)\succeq 0\},
\]
which reduces to conjunction when \(H\) is diagonal. In the indefinite case,
\[
C = \{x\in\mathbb R^n \mid H(x)\not\prec 0\} = \{x\in\mathbb R^n \mid \lambda_p(x)\ge 0\},
\]
which naturally encodes disjunctions. With diagonal entries \(H_{ii}=-h_i\), the safe set becomes
\[
C=\bigcup_{i=1}^p \{x\mid h_i(x)\le 0\},
\]
so Boolean OR is represented directly by a single matrix inequality rather than a soft-max approximation or an active-constraint switch. The associated safety filter is posed as an SDP minimizing deviation from a nominal controller subject to a matrix inequality, and the paper proves continuity of the resulting CBF-SDP on a neighborhood of the safe set [2508.11795].

A further generalization treats Boolean and combinatorial specifications through order statistics. Given primitive barriers \(h_1,\dots,h_p\), the \(p\)-choose-\(r\) safe set is encoded by the pivot
\[
h(x)=\max^r\{h_k(x)\}_{k=1}^p = \min^{p-r+1}\{h_k(x)\}_{k=1}^p,
\]
so that \(r=p\) recovers AND and \(r=1\) recovers OR. The combinatorial CBF condition is imposed on every primitive barrier,
\[
\dot h_k(x,u) > -\alpha\big(h(x)+|h_k(x)-h(x)|\big), \qquad \forall k\in[p].
\]
The corresponding CBF-QP uses exactly \(p\) barrier inequalities rather than enumerating all valid Boolean combinations. In a multi-agent patrolling example, the paper reports that the exact logical condition was enforced using \(p=132\) primitive constraints, whereas naive Boolean enumeration would require 5448 combinations [2509.10716].

These formulations all preserve exact logical safe sets, but they do so in different ways: deterministic arithmetic over dual numbers, matrix inequalities over eigenvalues, or order-statistic pivots over primitive barriers.

## 6. Applications, adjacent methods, and recurring limitations

Boolean-based CBFs have been used in a wide range of applications. In discrete time, mixed-integer formulations were applied to lane keeping and obstacle avoidance. Lane-keeping uses a partially control-affine vehicle model and a piecewise discrete-time barrier, while obstacle avoidance is written as an OR between left and right lane-following modes,
\[
(h_{LK,l}\ge 0)\ \vee\ (h_{LK,r}\ge 0),
\]
yielding an MIQP that effectively decides whether the car passes the obstacle on the left or the right [2004.01858].

In stochastic continuous time, a single agent has been studied under the Boolean specification
\[
(\mu_o\ge 0)\land (\mu_{n_1}\ge 0 \lor \mu_{n_2}\ge 0),
\]
and a multi-agent example enforces
\[
\bigwedge_{i<j}\|x_i-x_j\|_2 \ge 2r
\]
through a global minimum-distance barrier. The reported simulations show that the non-smooth stochastic CBF controller keeps all trajectories safe almost surely and that an almost-active set with \(\varepsilon>0\) significantly reduces chattering in the control signals [2309.06494].

Under noisy inputs, Boolean-composed barriers have been embedded into stochastic MPC for collective control of single-integrator agents with inter-agent collision avoidance and obstacle avoidance. The reported comparison is against an LSE-smoothed controller and a naive state-feedback controller without safety filtering; the proposed polynomial-smoothed Boolean-CBF plus stochastic QP controller successfully drives agents to goals while avoiding obstacles and collisions [2311.03284].

Two adjacent areas broaden the scope of Boolean-based CBF analysis. One concerns systems with multiple control inputs and higher relative degree. Although not formulated as Boolean-based CBFs directly, the introduction of a “relative degree set,” the integral HOCBF construction, and the constraint-transformation method are explicitly described as useful building blocks for Boolean-Based Control Barrier Function formulations, especially when different logical clauses correspond to different geometry or actuation pathways [2203.07978]. The other concerns formal verification and synthesis for polynomial systems. There, CBF validity is reduced to the non-existence of solutions to polynomial equations and then certified by Positivstellensatz and sum-of-squares constraints; the framework also treats multiple CBF constraints through intersections and notes a natural connection to Boolean-style safety reasoning via unions and intersections of certified invariant sets [2104.14001].

Several recurring limitations are explicit in the literature. Exact \(\min/\max\) composition creates nonsmooth boundaries where standard Lie derivatives fail [2606.25333]. Smoothing restores differentiability but can conservatively alter the safe set [2309.06647][2311.03284]. Direct multi-CBF QPs may be infeasible even when individual barrier conditions are feasible [2309.06647][2209.02284]. Temporal-logic guarantees depend on QP feasibility, and slack-based prioritization can improve feasibility only by allowing safety propositions to be violated when the slack is nonzero [1908.04903]. A plausible implication is that Boolean-based CBF design is governed less by a single preferred formalism than by a choice among exactness, continuity, scalability, and certifiability, each emphasized by a different branch of the literature.

Source: https://www.emergentmind.com/topics/boolean-based-control-barrier-functions