COOLJAPAN
← All posts

TensorLogic 0.1.0 Released — The First Stable Logic-as-Tensor Compiler for Neurosymbolic AI

TensorLogic compiles logical rules (predicates, quantifiers, implications) into optimized einsum graphs for unified neural, symbolic, and probabilistic models. It now graduates from 0.1.0-rc.1 to its first stable 0.1.0 on an upgraded SciRS2 0.3.4 / OxiRS 0.2.2 / SkleaRS 0.1.0 / ToRSh 0.1.1 stack — fully Pure Rust, zero warnings, 6,397 tests at 100%.

release tensorlogic neurosymbolic einsum pure-rust logic

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.

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:

Tips

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

↑ Back to all posts