Metadata-Version: 2.4
Name: omnibias-boolean
Version: 0.1.0a2
Summary: Differentiable Boolean algebra: exact ANF/Reed-Muller and Walsh spectra, Boolean differential calculus, reproductive equation solving, and a beta-annealed soft-gate system solver built on the omnibias closed-form derivative towers (torch + jax).
Author-email: Vardan Grigoryants <vardan@derivon.ai>
Maintainer-email: Derivon <info@derivon.ai>
License-Expression: Apache-2.0
Project-URL: Homepage, https://github.com/derivon-ai/omnibias
Project-URL: Documentation, https://github.com/derivon-ai/omnibias/blob/main/docs/api/boolean.md
Project-URL: Source, https://github.com/derivon-ai/omnibias
Project-URL: Issues, https://github.com/derivon-ai/omnibias/issues
Project-URL: Changelog, https://github.com/derivon-ai/omnibias/blob/main/CHANGELOG.md
Keywords: boolean-algebra,reed-muller,algebraic-normal-form,boolean-differential-calculus,boolean-unification,differentiable-logic
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Scientific/Engineering :: Mathematics
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: omnibias-core>=0.5.0rc1
Provides-Extra: torch
Requires-Dist: torch>=2.0; extra == "torch"
Requires-Dist: omnibias-torch>=0.5.0rc1; extra == "torch"
Requires-Dist: omnibias-binary[torch]>=0.1.0a2; extra == "torch"
Provides-Extra: jax
Requires-Dist: jax>=0.4.30; extra == "jax"
Requires-Dist: jaxlib>=0.4.30; extra == "jax"
Requires-Dist: omnibias-jax>=0.5.0rc1; extra == "jax"
Requires-Dist: omnibias-binary[jax]>=0.1.0a2; extra == "jax"
Provides-Extra: all
Requires-Dist: omnibias-boolean[jax,torch]; extra == "all"
Provides-Extra: test
Requires-Dist: pytest>=7.0; extra == "test"
Requires-Dist: numpy>=1.24; extra == "test"
Provides-Extra: dev
Requires-Dist: omnibias-boolean[all,test]; extra == "dev"
Requires-Dist: ruff>=0.1.0; extra == "dev"
Requires-Dist: mypy>=1.5; extra == "dev"
Dynamic: license-file

# omnibias-boolean

**From truth values to exact algebra.** Representations can change while every Boolean result stays fixed.

![From truth values to exact algebra.](https://raw.githubusercontent.com/derivon-ai/omnibias/62200950132cb8fc53cc627f4614b5380058be82/packages/omnibias-boolean/docs/visuals/story.gif)

[Static poster](https://raw.githubusercontent.com/derivon-ai/omnibias/62200950132cb8fc53cc627f4614b5380058be82/packages/omnibias-boolean/docs/visuals/poster.png) · [Narrow-screen animation](https://raw.githubusercontent.com/derivon-ai/omnibias/62200950132cb8fc53cc627f4614b5380058be82/packages/omnibias-boolean/docs/visuals/story-mobile.gif) · [How this visual is computed](https://raw.githubusercontent.com/derivon-ai/omnibias/62200950132cb8fc53cc627f4614b5380058be82/packages/omnibias-boolean/docs/visuals/scene.py)

Truth tables or Boolean polynomials enter; exact ANF, Walsh coefficients, Boolean derivatives or equation solutions leave. Use this package for finite algebraic structure; use binary for tensor quantization.

The animation uses computed outputs to explain this package. Frame transitions
are illustrative unless a training step is explicitly identified; it is not a
performance comparison.


[API reference](https://github.com/derivon-ai/omnibias/blob/main/docs/api/boolean.md) · [Source](https://github.com/derivon-ai/omnibias/tree/main/packages/omnibias-boolean/src/omnibias/boolean) · [Tests](https://github.com/derivon-ai/omnibias/tree/main/packages/omnibias-boolean/tests) · [Talk to Derivon](mailto:info@derivon.ai)

## The mathematical connection

Exact Boolean algebra needs neither a small bias spacing nor a temperature schedule. Optional differentiable gates connect it to temperature collapse: finite β gives a smooth relaxation and hardening requires a stated tie rule. Bias-collapse kernels can differentiate those smooth gates, but do not turn approximate gate optimization into an exact Boolean proof.

## Run this README

The examples use `omnibias-boolean` on Python >=3.10. Their installed-wheel
profile selects runtime features, not an editable workspace. Install the prepared
prerelease from PyPI:

```bash
python -m pip install --pre "omnibias-boolean==0.1.0a2"
```

For local development before publication, build and test the coordinated wheelhouse
using the [release guide](https://github.com/derivon-ai/omnibias/blob/main/RELEASE.md).
The package's [wheel profile](https://github.com/derivon-ai/omnibias/blob/main/packages/omnibias-boolean/wheel-tests.toml)
executes the examples below outside the source checkout.

Existing published consumers may need historical primitive versions; see the
[compatibility policy](https://github.com/derivon-ai/omnibias/blob/main/RELEASE.md#published-consumer-compatibility).

## Why this package exists

Boolean functions have algebraic structure that a generic real-valued tensor does not expose. Boolean lets you move between exact finite representations, inspect interactions with discrete derivatives, and solve bounded algebraic systems. Optional tensor realizations connect those structures to learnable soft gates.

## What you can build

- Truth tables and algebraic normal forms over GF(2).
- Walsh transforms, influences and exact Boolean derivatives.
- Finite equation solvers, with optional Torch/JAX gate and spectrum operations.

Choose exact mode for truth-table identities, bounded logic tests and reference oracles. Choose a tensor realization when the purpose is optimization through a smooth model. Keeping the two separate lets you compare a learned gate with the exact finite behavior it is intended to approximate.

## A working example

```python
from omnibias.boolean import truth_table_from_callable, anf_from_truth_table
from omnibias.boolean import truth_table_from_anf

xor = truth_table_from_callable(lambda a, b: a ^ b, 2)
polynomial = anf_from_truth_table(xor)
assert truth_table_from_anf(polynomial) == xor
print(polynomial)
```

## Choose the right contract

Truth-table size is exponential in the number of variables. Exact enumeration is a bounded reference tool, not a polynomial-time solver for arbitrary large Boolean systems. A soft gate gradient and a Boolean derivative are different operators with different meanings.

## Explore and validate

The [API guide](https://github.com/derivon-ai/omnibias/blob/main/docs/api/boolean.md) contains the generated module/export
inventory. Use it to find the focused implementation rather than guessing a
symbol from another package. The [capability map](https://github.com/derivon-ai/omnibias/blob/main/docs/capabilities.md)
connects the primitives to larger scientific workflows.

From the main repository, run the package’s regression suite:

```bash
uv run pytest packages/omnibias-boolean/tests -q
```

## License

Apache-2.0. See [LICENSE](https://github.com/derivon-ai/omnibias/blob/main/packages/omnibias-boolean/LICENSE) and the [licensing policy](https://github.com/derivon-ai/omnibias/blob/main/LICENSING.md).
