Table of Contents
Fetching ...

Continuous Modal Logical Neural Networks: Modal Reasoning via Stochastic Accessibility

Antonin Sulc

TL;DR

Fuid Logic and LINNs can guide neural networks to produce consistent solutions across diverse domains: epistemic/doxastic logic (multi-robot hallucination detection), temporal logic (recovering the Lorenz attractor geometry from logical constraints alone), and deontic logic (learning safe confinement dynamics from a logical specification).

Abstract

We propose Fluid Logic, a paradigm in which modal logical reasoning, temporal, epistemic, doxastic, deontic, is lifted from discrete Kripke structures to continuous manifolds via Neural Stochastic Differential Equations (Neural SDEs). Each type of modal operator is backed by a dedicated Neural SDE, and nested formulas compose these SDEs in a single differentiable graph. A key instantiation is Logic-Informed Neural Networks (LINNs): analogous to Physics-Informed Neural Networks (PINNs), LINNs embed modal logical formulas such as ($\Box$ bounded) and ($\Diamond$ visits\_lobe) directly into the training loss, guiding neural networks to produce solutions that are structurally consistent with prescribed logical properties, without requiring knowledge of the governing equations. The resulting framework, Continuous Modal Logical Neural Networks (CMLNNs), yields several key properties: (i) stochastic diffusion prevents quantifier collapse ($\Box$ and $\Diamond$ differ), unlike deterministic ODEs; (ii) modal operators are entropic risk measures, sound with respect to risk-based semantics with explicit Monte Carlo concentration guarantees; (iii)SDE-induced accessibility provides structural correspondence with classical modal axioms; (iv) parameterizing accessibility through dynamics reduces memory from quadratic in world count to linear in parameters. Three case studies demonstrate that Fluid Logic and LINNs can guide neural networks to produce consistent solutions across diverse domains: epistemic/doxastic logic (multi-robot hallucination detection), temporal logic (recovering the Lorenz attractor geometry from logical constraints alone), and deontic logic (learning safe confinement dynamics from a logical specification).

Continuous Modal Logical Neural Networks: Modal Reasoning via Stochastic Accessibility

TL;DR

Fuid Logic and LINNs can guide neural networks to produce consistent solutions across diverse domains: epistemic/doxastic logic (multi-robot hallucination detection), temporal logic (recovering the Lorenz attractor geometry from logical constraints alone), and deontic logic (learning safe confinement dynamics from a logical specification).

Abstract

We propose Fluid Logic, a paradigm in which modal logical reasoning, temporal, epistemic, doxastic, deontic, is lifted from discrete Kripke structures to continuous manifolds via Neural Stochastic Differential Equations (Neural SDEs). Each type of modal operator is backed by a dedicated Neural SDE, and nested formulas compose these SDEs in a single differentiable graph. A key instantiation is Logic-Informed Neural Networks (LINNs): analogous to Physics-Informed Neural Networks (PINNs), LINNs embed modal logical formulas such as ( bounded) and ( visits\_lobe) directly into the training loss, guiding neural networks to produce solutions that are structurally consistent with prescribed logical properties, without requiring knowledge of the governing equations. The resulting framework, Continuous Modal Logical Neural Networks (CMLNNs), yields several key properties: (i) stochastic diffusion prevents quantifier collapse ( and differ), unlike deterministic ODEs; (ii) modal operators are entropic risk measures, sound with respect to risk-based semantics with explicit Monte Carlo concentration guarantees; (iii)SDE-induced accessibility provides structural correspondence with classical modal axioms; (iv) parameterizing accessibility through dynamics reduces memory from quadratic in world count to linear in parameters. Three case studies demonstrate that Fluid Logic and LINNs can guide neural networks to produce consistent solutions across diverse domains: epistemic/doxastic logic (multi-robot hallucination detection), temporal logic (recovering the Lorenz attractor geometry from logical constraints alone), and deontic logic (learning safe confinement dynamics from a logical specification).
Paper Structure (50 sections, 7 theorems, 11 equations, 22 figures, 4 tables)

This paper contains 50 sections, 7 theorems, 11 equations, 22 figures, 4 tables.

Key Result

theorem 1

Let a CMLNN be initialized with theory $\Gamma_0$ and SDE library $\mathcal{F}$ with non-empty consistent probability measures. Assume the per-path score is bounded $g_n \in [-B,B]$ (e.g., via bounded/Lipschitz valuations on compact $\mathcal{W}$ or explicit clipping), hence $\hat{L}_\phi \in [-B,B]

Figures (22)

  • Figure 1: The transition from Graph Logic to Fluid Logic. (A) MLNNs operate over finite world sets with static, enumerable accessibility relations. (B) CMLNNs embed worlds in a continuous manifold $\mathcal{W}$ where each modal operator $\Box_i, \Diamond_i$ is defined by its own Neural SDE. The stochastic diffusion coefficient $\sigma^{(i)}_\theta$ generates genuine branching, giving $\Box$ (all sample paths) and $\Diamond$ (exists a sample path) semantically distinct meanings. Gradients flow through the SDE solver via the stochastic adjoint method.
  • Figure 2: Case Study 1: three multi-agent scenarios. (a) Hallucination detection (epistemic + doxastic SDEs): Rover 3 (faulty sensor) believes safety where danger exists. Solid lines show true trajectories; dashed red is the doxastic path; dotted purple is the epistemic path. The hallucination flag triggers when $L_{B_3}(\Box\,\text{safe}){>}0.8$ and $U_{K_{\text{sw}}}(\Diamond\,\text{coll.}){>}0.3$. (b) Sustained escort (temporal SDE): a rescuer (blue) learns to shield Rover 3 (orange) around the true chasm toward the goal (star); final actual safety $0.82$, trust gap $W{=}1.53$. (c) Swarm defense (5 temporal formulas): the VIP (yellow) is escorted by scouts S1/S2 while evading enemies E1/E2; five logic objectives are jointly optimised. Additional detail in Appendix \ref{['sec:appendix:experiments']}.
  • Figure 3: Case Study 2: 3D attractor comparison on Lorenz-63. Ground truth shows the canonical two-lobe butterfly; the Pure MSE SDE collapses to one lobe; SDE+LINN recovers both lobes via $\Box(\text{bounded})\land\Diamond(\text{visits\_lobe})$.
  • Figure 4: Case Study 2: LINN as a logic regularizer. Left: Adding LINN to any base model reduces multi-step MSE and escape rate. Right: Lobe visitation frequency. Baseline models appear to have a balanced average Lobe Error, but suffer from structural collapse (individual trajectories rarely switch lobes). LINN forces explicit exploration of both lobes, recovering the global geometry at the cost of slightly perturbing the natural switching frequency.
  • Figure 5: Case Study 3: Deontic safe confinement. Left: 3D toroidal trajectories (poloidal cross-section wrapped onto torus geometry). Red paths show the temporal SDE (unconstrained physics, drifting outward and exiting the vessel). Blue paths show the deontic SDE (trained on $O(\Box_{[0,T]}\text{safe})$, staying confined with 0% exit). The confinement structure emerges from the logical objective alone, without a hand-crafted control law. Right: $L_\Box$ and $U_\Diamond$ of $\phi_\text{safe}$ over time. The deontic SDE (blue) maintains $L_{\Box\text{safe}} = 0.456$ (6.1$\times$ above temporal 0.075); the shaded quantifier gap $U_\Diamond - L_\Box > 0$ confirms non-collapsed quantifiers in both SDEs. Drift magnitude heatmaps showing the learned restoring force appear in Appendix \ref{['sec:appendix:experiments']}.
  • ...and 17 more figures

Theorems & Definitions (13)

  • theorem 1: Soundness of CMLNN Risk-Based Bounds
  • theorem 2: Quantifier Non-Collapse
  • proof : Sketch
  • definition 1: Population Entropic Risk Functional
  • definition 2: Population Necessity and Possibility Operators
  • theorem 3: Convergence
  • theorem 4: Universal Approximation of Transition Laws
  • theorem 5: Wasserstein Universal Approximation
  • proposition 1: Sample Complexity
  • theorem 6: Differentiability
  • ...and 3 more