Gates should return margins, not booleans (STL robustness)
Parent: gate-theory Sited by: site-audits-where-checking-is-cheap — returning a margin is that criterion applied: same cost, same determinism, strictly more information. One instance of reshaping the check so it stays cheap while getting tighter.
A hard gate returns a binary verdict: pass or fail. Softened, a gate returns a margin — a real number ρ that measures how far the system is from violating the gate's constraint. This is the key move of Signal Temporal Logic (STL) robustness: temporal/modal logic's truth values relax from {0,1} to the real line.
The softening: STL robustness
Signal Temporal Logic gives every formula a robustness degree ρ instead of true/false:
ρ > 0: satisfied, with|ρ|units of room to spareρ < 0: violated, by|ρ|units of undershootρ = 0: on the knife edge
This is standard machinery in cyber-physical systems runtime monitoring. Truth values {0,1} → the real line: the relaxation move applied to modal-logic's temporal cousin.
Payoff 1: trends before violations
A boolean gate alarms only after a violation occurs. A margin gate shows ρ shrinking monotonically before the violation:
time →
boolean: ✓ ✓ ✓ ✓ ✓ ✗ ← alarm (too late)
margin: 1.2 0.8 0.4 0.1 -0.3 ← trend visible; alarm at ρ ≈ 0.2
This is gate-deviation-is-observable-delta's "read the size and trend" formalized: the margin is the distance to the tube wall (from gates-are-neighborhoods), measured continuously, not just its sign.
Payoff 2: margins are the residual that k̂ needs
The contraction monitor $\hat{k} = r_{n+1}/r_n$ (operationalizing-tolerances) needs a real-valued residual — a quantity that shrinks or grows. Boolean gates cannot measure how much a repair round helped; margin gates can. No margins, no measured contraction, no proof of convergence.
Payoff 3: margins compose
STL semantics are compositional:
- Conjunction (AND) of gates: margin =
$\min(\rho_1, \rho_2, \ldots)$ - Disjunction (OR) of gates: margin =
$\max(\rho_1, \rho_2, \ldots)$
A check bundle's margin equals the weakest link, identified for free. The gate doesn't just fail or pass; it points at where the tube is thinnest — which constraint is closest to breaking.
Design rule
Write checks that return distances, not verdicts:
- "off by 340ms"
- "3 of 41 cases failing" (vs 0 expected)
- "coverage 71% vs target 80%"
This is the quantitative sibling of coupling-to-the-learner's "checks emit gradients": the gradient gives the direction to repair; the margin gives the magnitude. Together, they make the repair loop a measurable contraction.
One line: a boolean gate is a tripwire; a margin gate is an instrument — and only instruments can measure convergence.