The stable line is here: logic and tensors are now one thing, and it ships in production.
Today we released TensorLogic 0.1.0 — the first stable release of the logic-as-tensor compiler that turns predicates, quantifiers, and implications into optimized einsum graphs for unified neural, symbolic, and probabilistic models. This graduates the 0.1.0-rc.1 we announced back in March into a stable, production-ready 0.1.0 across every workspace crate.
TensorLogic is the Logic-as-Tensor Planning Layer for Neural-Symbolic AI — a minimal DSL and IR that compiles arbitrary logical expressions into native tensor algebra so that hybrid reasoning lives inside one tensor runtime. The release candidate proved the idea. Stable makes it something you can build on.
No C. No Fortran. No Python interpreter at the core. The classic neurosymbolic and tensor stack leans on a C/C++/Python tower — Prolog and Datalog engines on the symbolic side, PyTorch (and its C++ kernels) on the neural side, glued together with brittle interop. TensorLogic is Pure Rust end to end: a SciRS2 backend for tensors, OxiARC for compression, no rand, no flate2. It compiles to a single static binary, and it still gives you first-class Python through PyO3 when you want it.
Why the first stable release matters
Bolting symbolic logic onto neural tensors has always hurt in two directions at once. Symbolic rules are slow and non-differentiable, so they fight the optimizer. Neural networks are differentiable but carry no formal guarantees, so they happily violate the rules you care about. TensorLogic dissolves that boundary by treating logic as first-class tensor algebra — and 0.1.0 is the point where that approach stops being a candidate and starts being a foundation.
- Stable across the whole workspace. The version bump from 0.1.0-rc.1 to 0.1.0 lands on all workspace crates; all 10 internal crate references are updated to 0.1.0 stable, and
tensorlogic-pyis aligned to 0.1.0. - The entire dependency stack matured underneath it. SciRS2 moved 0.3.0 → 0.3.4 (scirs2-core / linalg / autograd / optimize), OxiRS jumped 0.1.0 → 0.2.2 — a major RDF / knowledge-graph API upgrade (oxirs-core, oxirs-gql, oxirs-ttl), SkleaRS reached 0.1.0 stable, and ToRSh moved 0.1.0 → 0.1.1.
- Fully Pure Rust now.
flate2was replaced withoxiarc-deflateper the OxiARC policy, and RNG is unified viascirs2_core— everyrand_09/rand_distr_05alias is gone, with no directranddependencies. - Clean by construction. All clippy warnings fixed, the zero-warnings policy enforced, and the remaining production
unwrap()calls eliminated (clippy::unwrap_used = 0). - Tested for real. 6,397 tests passing — a 100% pass rate.
Technical Deep Dive
The 0.1.0 workspace is organized as a small set of focused crates that move a logical expression all the way from text to executed tensors.
1. The front end — DSL and IR → compiler. You build expressions in tensorlogic-ir using TLExpr and Term — predicates, quantifiers, connectives. tensorlogic-compiler takes that IR and runs compile_to_einsum, lowering the logic into an optimized tensor computation graph. The logic you write is the einsum you run.
2. Execution — SciRS2 with SIMD, plus GPU. tensorlogic-scirs-backend executes the graph via Scirs2Exec on the SciRS2 backend, where SIMD acceleration delivers a transparent 2–4x speedup. For larger workloads the OxiCUDA crates — tensorlogic-oxicuda-backend, -oxicuda-sparse, -oxicuda-solver, -oxicuda-rng — provide a GPU path built on the OxiCUDA driver-only stack.
3. Training and inference — gradients through logic. tensorlogic-train handles training of logical constraints, and tensorlogic-infer exposes the TlAutodiff trait so you can learn constraints with gradients. Logic stops being a fixed mask and becomes something you optimize.
4. The ecosystem bridges — the neurosymbolic glue. tensorlogic-oxirs-bridge turns OxiRS RDF* / SHACL knowledge graphs into tensor rules; tensorlogic-sklears-kernels exposes SkleaRS logic kernels; tensorlogic-quantrs-hooks wires into QuantrS2; tensorlogic-trustformers bridges TrustformeRS; and bidirectional conversion with ToRSh — the pure-Rust PyTorch alternative — lets tensors flow both ways. Together these bridges are what make TensorLogic the connective tissue of the stack rather than an island.
Getting Started
Add it to your project:
cargo add tensorlogic
Then compile a transitivity rule into an einsum graph and run it on the SciRS2 backend:
use tensorlogic_compiler::compile_to_einsum;
use tensorlogic_ir::{TLExpr, Term};
use tensorlogic_scirs_backend::Scirs2Exec;
// Rule: knows(x, y) ∧ knows(y, z) → knows(x, z)
let x = Term::var("x");
let y = Term::var("y");
let z = Term::var("z");
let knows_xy = TLExpr::pred("knows", vec![x.clone(), y.clone()]);
let knows_yz = TLExpr::pred("knows", vec![y.clone(), z.clone()]);
let premise = TLExpr::and(knows_xy, knows_yz);
// Compile logic → optimized einsum graph
let graph = compile_to_einsum(&premise)?;
// Execute on the SciRS2 backend (SIMD-accelerated)
let mut executor = Scirs2Exec::new();
let result = executor.forward(&graph)?;
Prefer Python? The bindings ship as pytensorlogic and feel just as direct:
import pytensorlogic as tl
ctx = tl.compiler_context()
ctx.add_domain("Person", 100)
x, y = tl.var("x"), tl.var("y")
rule = tl.exists(y, tl.pred("knows", [x, y]))
graph = tl.compile_with_context(rule, ctx)
What’s inside
Everything that shipped in the finished 0.1.0:
- A logic → einsum compiler (
tensorlogic-ir+tensorlogic-compiler) that lowers predicates, quantifiers, and implications into optimized tensor graphs. - A SciRS2 SIMD backend (
Scirs2Exec) delivering 2–4x speedups transparently. - A GPU path via OxiCUDA (backend, sparse, solver, and RNG crates), driver-only.
- Production-ready Python bindings —
pytensorlogic, with NumPy integration and a clean PyO3 surface built with maturin. - The five ecosystem bridges: OxiRS (RDF* / SHACL), SkleaRS kernels, QuantrS2 hooks, TrustformeRS, and bidirectional ToRSh conversion.
- 24 benchmark groups across 5 suites, so performance is measured, not assumed.
- The dependency upgrades that came with stable: SciRS2 0.3.4, OxiRS 0.2.2, SkleaRS 0.1.0, ToRSh 0.1.1, oxicode 0.2, plus clap / clap_complete 4.6.
Tips
- Bring only the bridges you need. The meta crate ships
fullby default (train + oxirs + quantrs + sklears + trustformers). For a leaner build, start fromminimaland opt in to justtrain,oxirs,quantrs,sklears, ortrustformers. - Register quantifier domains before compiling. Quantifiers need a domain size to lower correctly. In Python:
ctx.add_domain("Person", 100)on acompiler_context(), thencompile_with_context(rule, ctx). - Train constraints, don’t just check them. Use the
TlAutodifftrait fromtensorlogic-infertogether withtensorlogic-trainto push gradients through your logical rules. - Go to GPU when the graphs grow. Switch execution onto the OxiCUDA backend crates for large workloads — the driver-only path keeps the build Pure Rust.
- Call it from Python in one line.
import pytensorlogic as tlgives youtl.var,tl.pred,tl.exists, and thecompiler_context()flow with full NumPy interop. - Let SIMD do its work. The SciRS2 backend applies its 2–4x SIMD acceleration automatically — no flags, no kernel tuning required.
The neurosymbolic foundation
As of late April 2026, TensorLogic is the neurosymbolic glue of the COOLJAPAN stack — and now a stable one. It binds SciRS2 (tensors), OxiRS (knowledge graphs), SkleaRS (kernels), ToRSh (neural), QuantrS2 (quantum), and TrustformeRS (transformers) into a single differentiable tensor framework. All Pure Rust. All shipped. There is nothing to bolt together with a foreign runtime.
This is also a quiet milestone of patience: TensorLogic is one of the three oldest projects in the ecosystem, with its first commit on 2025-11-08 — the same day as TenRSo, with only VoiRS predating it. A project that has been maturing since the very first days of COOLJAPAN has now reached its first stable release.
Repository: https://github.com/cool-japan/tensorlogic
Star the repo if you want neural networks that obey logic — with gradients, in Pure Rust, from a single binary.
The boundary between symbolic and neural was never a wall. With 0.1.0 stable, it’s a compiler pass. It’s all tensors.
— KitaSan at COOLJAPAN OÜ April 27, 2026