Formally Verified Neurosymbolic Trajectory Learning via Tensor-based Linear Temporal Logic on Finite Traces
Mark Chevallier, Filip Smola, Richard Schmoetten, Jacques D. Fleuriot
TL;DR
The paper addresses enforcing temporal logic constraints in neural learning with formal guarantees by developing a tensor-based $LTL_f$ semantics implemented and verified in Isabelle/HOL. It introduces a differentiable loss $\mathcal{L}$ and its derivative $d\mathcal{L}$ over tensors, generated automatically into executable OCaml code and integrated with PyTorch for end-to-end neurosymbolic learning. The approach is validated through trajectory planning experiments, showing that constraint-driven training can shape behavior while maintaining formal correctness. The work provides a scalable, trustworthy framework for constrained learning, bridging formal verification with practical deep learning infrastructure and enabling robust, logic-guided optimization in motion planning and similar domains.
Abstract
We present a novel formalisation of tensor semantics for linear temporal logic on finite traces (LTLf), with formal proofs of correctness carried out in the theorem prover Isabelle/HOL. We demonstrate that this formalisation can be integrated into a neurosymbolic learning process by defining and verifying a differentiable loss function for the LTLf constraints, and automatically generating an implementation that integrates with PyTorch. We show that, by using this loss, the process learns to satisfy pre-specified logical constraints. Our approach offers a fully rigorous framework for constrained training, eliminating many of the inherent risks of ad-hoc, manual implementations of logical aspects directly in an "unsafe" programming language such as Python, while retaining efficiency in implementation.
