Skip to main content

Distributed Deductive System Sorts (DDSS)

DDSS is a distributed deductive system with a scalable architecture, providing identical implementations in both Python and TypeScript. It currently supports distributed engines including forward-chaining, E-graph, and more.

Design Philosophy

DDSS adopts a modular architecture that decomposes the deductive system into independent but collaborative sub-systems:

  1. Separation of Concerns: Each module focuses on a specific reasoning task.
  2. Concurrent Execution: All modules collaborate asynchronously through a shared database, fully utilizing system resources.
  3. Persistent Storage: Uses a database to store facts and ideas, ensuring data consistency.

The system uses a database as the central hub, with two tables (facts and ideas) for interaction between sub-systems:

  • Eager engines (e.g., forward-chaining): Read facts and eagerly produce new facts. They also add ideas to broadcast "I want this XXX" - indicating what new facts they need to produce more results.

  • Lazy engines (e.g., E-graph): Could produce too many facts if eager, so they quietly accept facts without producing many. They only produce facts when they see ideas from other engines that they can (partially) fulfill.

Modules

The system consists of the following modules, implemented symmetrically in ddss/*.py and ddss/*.ts:

  • Input (ddss/input.py, ddss/input.ts): Interactive input interface with BNF syntax parsing
  • Output (ddss/output.py, ddss/output.ts): Real-time display of facts and ideas from the database
  • Load (ddss/load.py, ddss/load.ts): Batch import of facts from standard input
  • Dump (ddss/dump.py, ddss/dump.ts): Export all facts and ideas to output
  • Search (ddss/search.py, ddss/search.ts): Forward-chaining deductive search engine
  • Chain (ddss/chain.py, ddss/chain.ts): Alternative forward-chaining engine using Chain API
  • Egg (ddss/egg.py, ddss/egg.ts): E-graph based equality reasoning engine

Installation

You can choose either the Python or TypeScript version. Both provide the same ddss command-line interface.

Python Version

uvx ddss

Using pip

pip install ddss
ddss

TypeScript Version

npx @hzhangxyz/ddss

Using npm

npm install -g @hzhangxyz/ddss
ddss

Usage

The usage, command-line options, and interactive syntax are identical regardless of the implementation language used.

Basic Usage

Run DDSS with a temporary SQLite database:

ddss

Specifying a Database

DDSS supports multiple database backends using the -a or --addr option:

# SQLite (persistent)
ddss --addr sqlite:///path/to/database.db

# MySQL
ddss --addr mysql://user:password@host:port/database

# MariaDB
ddss --addr mariadb://user:password@host:port/database

# PostgreSQL
ddss --addr postgresql://user:password@host:port/database

Selecting Components

By default, DDSS runs with all interactive components (input, output, search, egg). You can select specific components using the -c or --component option:

# Run only input and output (no inference engines)
ddss --component input output

# Run with only the forward-chaining engine
ddss --component input output search

# Run with only the E-graph engine
ddss --component input output egg

Available components:

  • input: Interactive input interface
  • output: Real-time display of facts and ideas
  • search: Forward-chaining deductive search engine
  • chain: Alternative forward-chaining engine using Chain API
  • egg: E-graph based equality reasoning engine
  • load: Batch import facts from standard input
  • dump: Export all facts and ideas to output

Interactive Usage

After starting, input facts and rules at the input: prompt. The syntax follows the format premise => conclusion:

Example 1: Simple Inference

Input a fact stating a is true:

input: => a

Input a rule stating if a then b:

input: a => b

The system automatically derives and displays => b:

fact: => b

Example 2: Equality Reasoning

Input an equality relation a == b:

input: => a == b

Input an idea for b == a by creating a rule that requires it:

input: b == a => target

The system will derive both the idea and facts:

idea: => b == a
fact: => b == a
fact: => target

License

This project is licensed under the GNU Affero General Public License v3.0 or later. See LICENSE.md for details.

Metadata

Release files for ddss 0.0.44

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for ddss 0.0.44
File Interpreter ABI Platform Actions
ddss-0.0.44-py3-none-any.whl Python 3 none any Details for ddss-0.0.44-py3-none-any.whl

Release files / ddss-0.0.44-py3-none-any.whl

Download URL ddss-0.0.44-py3-none-any.whl
Size 31.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
64fac6e9d2528257d6e8ff69a2ba082927351a4bc64eacda256fc98d5ecb2594
BLAKE2b-256 checksum
How to use checksums
03648fdd3fae4268cf57557035198deb3d84c0dd97e74022b844e8c5ab5c156a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 7, 2026.

Transparency log

Security for ddss 0.0.44

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 1 file in this release has been uploaded with provenance metadata.

Attestation for ddss-0.0.44-py3-none-any.whl

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 7, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.44 This release

1 release file Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page