TL;DR
This paper introduces Belief Programming, a new paradigm where developers write environment models instead of manual state estimators for systems operating under uncertainty. By pairing this with Epistemic Hoare Logic, the authors provide a unified framework to both execute and formally verify programs that must reason about hidden states, such as UAV controllers and space probes.
What Problem Does This Paper Address?
Many modern computer systems operate in "partially observable" environments—situations where the program cannot see the true state of the world directly. For example, a drone knows its estimated altitude from a noisy GPS sensor, not its actual altitude.
Traditionally, developers handle this by writing a state estimator (like a Kalman filter) to guess the hidden state and a separate environment model to verify the software's safety. This process is redundant, error-prone, and difficult to verify. If the estimator’s logic doesn't perfectly align with the environment model, the system can fail catastrophically. A famous example cited in the paper is the Mars Polar Lander, which likely crashed because its software miscalculated its touchdown state based on noisy sensor data.
Methods
The authors propose a two-part solution:
- Belief Programming (BLIMP): They designed a core language called BLIMP (Belief IMP). Instead of writing an estimator, the developer writes a model of the environment using a
choosestatement to represent nondeterministic, hidden values. The runtime automatically maintains a belief state—a set of all possible environments the system could currently be in. observe x: Filters the belief state to keep only the possibilities consistent with a real-world measurement.infer P: Allows the program to branch based on the belief state (e.g., "If it is possible that altitude < 5ft, then flare the engines").- Epistemic Hoare Logic (EHL): To verify these programs, the authors extended classical Hoare logic with modal operators:
- $\diamond P$ ("Possibly P"): True if $P$ holds in at least one environment in the belief state.
- $\square P$ ("Certainly P"): True if $P$ holds in all environments in the belief state.
- This allows developers to prove that a controller will always take the right action, even when it only has partial information.
Datasets
The paper does not use traditional training datasets. Instead, it evaluates the methodology using two primary benchmarks:
- UAV Altitude Controller: A model of a drone trying to maintain a 500ft altitude despite wind gusts and sensor noise.
- Mars Polar Lander (MPL): A reconstruction of the flight control software for the ill-fated 1999 Mars mission.
- MPL-Exp: A newly introduced version of the MPL benchmark that uses exponential discretization (larger grid cells for high altitudes, smaller for low altitudes) to test how state-space representation affects performance.
Key Insights and Ideas
- The Runtime is the Estimator: By treating the environment model as part of the code, the state estimator is generated automatically. This eliminates the "semantic gap" between how a program thinks the world works and how it actually performs estimation.
- Soundness and Precision: The authors formally prove that their belief state is both sound (the true state is always inside the belief set) and precise (every state in the belief set is actually possible).
- Verification of "Knowledge": Epistemic Hoare Logic allows for much more intuitive safety requirements. Instead of reasoning about complex probability distributions, a developer can simply state: "The engine must be enabled if the lander is certainly above the ground."
Key Results
- Feasibility: The authors implemented BLIMP in C (called CBLIMP) using hash sets to represent belief states.
- Performance:
- The UAV controller ran with a latency of ~2.5ms per step, easily meeting the 1-second requirement for standard GPS units.
- The standard MPL model was slow (~2.4s per step), but the optimized MPL-Exp version achieved 0.76ms, well under the 10ms real-time requirement for spacecraft landing.
- Bug Prevention: They demonstrated that EHL could formally prove the absence of the specific logic error that caused the original Mars Polar Lander to crash.
Limitations and Future Work
- Scalability: The current implementation uses an exhaustive set-based representation for the belief state. This works for small state spaces but scales poorly as the number of variables increases.
- Runtime SMT: The authors suggest that future versions could use SMT (Satisfiability Modulo Theories) solvers at runtime to manage constraints symbolically rather than listing every possible state.
- Restricted Belief States: Another path forward is using restricted geometric shapes (like ellipsoids or polytopes) to approximate the belief state more efficiently, though this might sacrifice some of the "precision" proved in this paper.
Summary updated