Papers
Topics
Authors
Recent
Search
2000 character limit reached

NeSyCat: A Monad-Based Categorical Semantics of the Neurosymbolic ULLER Framework

Published 27 Apr 2026 in cs.AI, cs.LO, math.CT, and math.LO | (2604.24612v1)

Abstract: ULLER (Unified Language for LEarning and Reasoning) offers a unified first-order logic (FOL) syntax, enabling its knowledge bases to be used directly across a wide range of neurosymbolic systems. The original specification endows this syntax with three pairwise independent semantics: classical, fuzzy, and probabilistic, each accompanied by dedicated semantic rules. We show that these seemingly disparate semantics are all instances of one categorical framework based on monads, the very construct that models side effects in functional programming. This enables the modular addition of new semantics and systematic translations between them. As example, we outline the addition of generalised quantification in Logic Tensor Networks (LTN) to arbitrary (also infinite) domains by extending the Giry monad to probability spaces. In particular, our approach allows a modular implementation of ULLER in Python and Haskell, of which we have published initial versions on GitHub.

Summary

  • The paper introduces a monad-based categorical framework that unifies diverse semantics for neurosymbolic reasoning.
  • It employs computational monads and aggregated double monoid bounded lattices to integrate classical, probabilistic, and fuzzy logics.
  • The framework ensures modularity and scalability, supporting both theoretical analysis and practical implementations in Python and Haskell.

Monad-Based Categorical Semantics for Neurosymbolic ULLER: The NeSyCat Framework

Introduction and Motivation

The NeSyCat framework presents a formal categorical semantics for ULLER ("Unified Language for Learning and Reasoning"), generalizing first-order logic (FOL) syntax for neurosymbolic reasoning and learning systems. ULLER's original design accommodates classical, fuzzy, and probabilistic semantics via separate inductive rules, resulting in redundancy and lack of modularity. NeSyCat addresses these issues by providing a uniform monad-based categorical foundation, enabling seamless modularity, extensibility, and systematic translation between semantics. The categorical approach leverages computational monads—originally conceived in functional programming to abstract side-effects—to encapsulate stochastic, neural, and nondeterministic computations within a logical framework.

Formal Structure of NeSyCat

NeSyCat is grounded in categorical logic and monad theory. The central constructs are:

  • Aggregated Double Monoid Bounded Lattices (2Mon-BLat): This generalizes the truth-value spaces, expanding upon classical Boolean algebras to support various aggregation and combination operations (e.g., t-norms/t-conorms for fuzzy logic, probabilistic sums/products) that are parametrizable per semantics.
  • Monads: Computational monads model the effectful extensions of logic, such as probabilistic computation, neural inference, or nondeterminism. Monads (identity, distribution, powerset, Giry) are used to encapsulate computation and facilitate sequential composition in the semantics.

A NeSy framework F=(T,R)\mathcal{F} = (\mathcal{T}, \mathcal{R}) is specified by a monad T\mathcal{T} and an aggr-2Mon-BLat algebra R\mathcal{R} over the monadic truth space TΩ\mathcal{T}\Omega for some base set Ω\Omega (e.g., {0,1}\{0,1\}, [0,1][0,1], R\mathbb{R}). Interpretations I\mathcal{I} generalize Tarskian semantics by mapping logical and computational symbols (including neural models) into the monadic truth space. The syntax is extended first-order logic with computational assignments, allowing the embedding of neural computations as logical terms.

Uniform Semantics: Syntax and Tarskian Interpretation

NeSyCat defines the semantics of formulas inductively, parametrized by the monad and the truth algebra. Computational terms [x:=m(T⃗)]F[x := m(\vec{T})]F are interpreted via the Kleisli extension, while quantifiers and connectives leverage the algebraic operations of T\mathcal{T}0. Key features:

  • Bracketing of Neural Computations: Dynamic logic-style brackets for neural or computational assignments are interpreted monadically, allowing lossless integration of neural inference processes (e.g., expected values for probabilistic models).
  • Semantic Modularization: A single inductive rule set covers all instances (classical, probabilistic, fuzzy), eliminating code and semantic rule duplication.
  • Aggregation and Quantification: General aggregation operators support flexible quantification, covering finite, infinite, and measure-theoretic domains (e.g., using products, supremum, geometric means, or integrals).
  • Categorical Generalization: NeSyCat semantics extend to arbitrary categories (e.g., measurable spaces, probability spaces), enabling rigorous treatment of continuous distributions and infinite domains (crucial for theoretical completeness and practical expressiveness).

Concrete Examples and Instantiations

NeSyCat encompasses a wide range of semantics as special cases, including:

  • Classical Logic: Identity monad, Boolean algebra, deterministic semantics.
  • Probabilistic Semantics: Distribution monad (finite), Giry monad (continuous), product algebra, expected value computation, aggregation via products or integrals.
  • Fuzzy/Real Logic: BL algebras on T\mathcal{T}1, t-norm/t-conorm operations, fuzzy predicates.
  • LTN Semantics: Probability monads on probability spaces, power means for quantifiers, S-product implication for soft logic tensor networks.
  • Logic of Paradox and Non-deterministic Logics: Powerset monad, three-valued algebras (Kleene/Priest), non-deterministic semantics.
  • Signal Temporal Logic (STL): Extended real-valued domains, aggregation via min/max approximations, temporal robustness metrics.
  • Weighted Model Counting/Integration: Monadic do-notation recovers WMC/WMI, supporting independent/joint/Bayesian structures via compositional monadic binding.

The framework is shown to subsume and extend previous paradigms (ULLER, DeepProbLog, LDL), providing a formal basis for modular neurosymbolic logic programming and reasoning.

Semantic Transformations and Translation

The categorical formalism supports systematic transformations ("NeSy transformations") between semantics—for example, mapping probabilistic interpretations onto classical or non-deterministic ones via argmax-style selection, preserving non-determinism in case of ties. This enables principled reasoning about cross-semantics translation and formal alignment of disparate neurosymbolic approaches.

Practical Implications and Implementation

NeSyCat is implemented as modular libraries in Python and Haskell, supporting user-defined monads and truth-value algebras. The implementations feature:

  • Modular Framework Definition: Users specify monad, truth space, and lattice, ensuring extensibility.
  • Uniform Tarskian Semantics: Evaluation of formulas is parametrized, supporting all described semantics without code duplication.
  • Sampling and Integration: Both Monte Carlo and analytical approaches are supported, facilitating scalable inference and quantification in infinite domains.
  • Type Safety and Language Integration: Haskell implementation enables rigorous type safety, while Python implementation supports interoperability with neural libraries.

By abstracting implementation concerns from semantic definitions, NeSyCat enables reproducibility, extensibility, and scalability in neurosymbolic system development.

Theoretical and Practical Implications

  • Categorical Structure: Formalization of neurosymbolic computation in categorical logic enables rigorous analysis, modularity, and extensibility. It aligns neurosymbolic reasoning with compositional semantics frameworks in programming language theory and category theory.
  • Uniformity and Interoperability: Eliminates semantic rule duplication, enables plug-and-play semantics, and supports clear mapping between systems (e.g., classical ↔ probabilistic ↔ fuzzy), facilitating benchmarking and comparative evaluation.
  • Expressiveness: Generalizes weighted model counting/integration, supports Bayesian networks, continuous probability, and higher-order logic (via quasi-Borel spaces), extending applicability beyond current neurosymbolic systems.
  • Scalability: Categorical modularity supports efficient implementation and automated translation, enabling scalable reasoning across heterogeneous AI models.
  • Integration with Probabilistic Programming: Leverages foundational work on Markov categories, Giry monads, and categorical probability theory, positioning neurosymbolic AI within the broader landscape of compositional and measure-theoretic probabilistic languages.

Speculation and Future Directions

  • Differentiable Semantics: Integration of differentiable manifolds and functions for backpropagation and learning is envisaged, leveraging categorical abstractions for optimization and neural-symbolic fusion.
  • Higher-Order Extensions: Adoption of Cartesian closed categories and quasi-Borel spaces may enable higher-order logic, functional programming semantics, and structured neural-symbolic reasoning.
  • Sampling and Approximation: Formal convergence theorems for sampling-based and Monte Carlo approximations are anticipated, supporting probabilistic reasoning in infinite domains.
  • Extension to STL/Non-associative Logics: Approximate algebraic structures (2Mon-BLat approximations) may encompass temporal logics and non-associative operators, broadening the scope of neurosymbolic reasoning.
  • Benchmarking and Evaluation: Modular semantics and formal translation can facilitate comprehensive benchmarking and evaluation of neurosymbolic systems under varied logical paradigms.

Conclusion

NeSyCat provides a uniform, modular, and categorical semantics for ULLER and neurosymbolic systems, parameterizing computational effects via monads and truth-value aggregation via algebraic structures. This framework resolves previous duplication, accommodates infinite and continuous domains, supports formal translation between semantics, and enables extensible, scalable implementation. The theoretical modularity supports both practical integration in AI libraries and formal analysis within categorical logic and probabilistic programming. Differentiability, computational complexity, and practical evaluation remain open areas for further investigation, while library implementations in Python and Haskell demonstrate immediate applicability. NeSyCat thus offers a rigorous foundation for advancing neurosymbolic AI via categorical and monadic semantics.

Paper to Video (Beta)

No one has generated a video about this paper yet.

Whiteboard

No one has generated a whiteboard explanation for this paper yet.

Open Problems

We haven't generated a list of open problems mentioned in this paper yet.

Collections

Sign up for free to add this paper to one or more collections.

Tweets

Sign up for free to view the 1 tweet with 0 likes about this paper.