Skip to content

v0.1.0 - Initial Release: Neural-Symbolic AI with Tensor Logic

Choose a tag to compare

@Mathews-Tom Mathews-Tom released this 10 Dec 19:13
· 36 commits to main since this release

TensorLogic v0.1.0

First public release of TensorLogic, a neural-symbolic AI framework unifying logical reasoning and tensor computation based on Pedro Domingos' Tensor Logic paper
(arXiv:2510.12269).

Installation

pip install python-tensorlogic

# With MLX support (Apple Silicon)
pip install python-tensorlogic[mlx]

Highlights

Core Tensor Logic Operations

- Logical operations mapped to tensor operations (AND → Hadamard, OR → max, implications → max(1-a, b))
- Existential/universal quantification via axis summation
- Temperature-controlled reasoning (T=0 for deductive, higher for analogical)

Multiple Compilation Strategies

- Hard - Crisp Boolean logic
- Soft - Differentiable relaxation with temperature control
- Gödel - Gödel fuzzy logic (min/max operations)
- Product - Product fuzzy logic (multiplication-based)
- Łukasiewicz - Łukasiewicz fuzzy logic (bounded operations)

Backend Abstraction

- NumPy - Universal fallback
- MLX - Apple Silicon optimized with lazy evaluation and Metal GPU acceleration

Einops-Style Pattern API

from tensorlogic.api import parse_pattern, compile_pattern

# Self-documenting logical formulas
pattern = parse_pattern("exists y: Related(x, y) and HasProperty(y)")

Lean 4 Verification Bridge (Experimental)

- First neural-symbolic framework with formal verification support
- Bidirectional Python ↔ Lean 4 communication
- Theorem verification for tensor operations

Requirements

- Python ≥ 3.12
- NumPy ≥ 1.24.0
- MLX ≥ 0.30.0 (optional, for Apple Silicon)

What's Next

- Extended pattern language support
- Additional compilation strategies
- Performance optimizations
- Expanded Lean 4 theorem library

Links

- PyPI: https://pypi.org/project/python-tensorlogic/
- Documentation: https://github.com/Mathews-Tom/TensorLogic#readme
- Issues: https://github.com/Mathews-Tom/TensorLogic/issues