Expand description
SafeDec-lite: STL-shielded constrained decoding for grid navigation.
This reproduces the core idea of constrained decoding for safe navigation policies without a learned model: a base navigation policy proposes a score for each discrete action, and a shield expressed in Signal Temporal Logic (STL) keeps the decoded action sequence safe.
- The base policy here is a deterministic greedy goal-seeker — it always prefers the action that most reduces distance to the goal, which happily cuts straight through a hazard.
- The shield is a set of STL specifications reusing
crate::stl_cbsprimitives: analways-avoidgeofence over a time interval (a hard constraint — candidates entering it are pruned) and aneventually-reachgoal region (a soft reward that shapes the beam). SafeDecoder::decoderuns a deterministic constrained beam search and returns both the greedy (unshielded) path and the shielded path, so the number of steps where the shield overrode the greedy choice — and the resulting robustness gain — is directly measurable.
Everything is deterministic: ties are broken by action index and the beam is sorted with a stable total order.
Structs§
- Safe
Decode Plan - Result of a shielded decode, paired with the greedy baseline.
- Safe
Decoder - STL-shielded constrained decoder over a grid navigation policy.
- Safe
NavConfig - Configuration for the STL-shielded navigation decoder.
- Timed
Region - A timed STL specification rectangle.