Distributed Deductive System Sorts
Project description
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:
- Separation of Concerns: Each module focuses on a specific reasoning task.
- Concurrent Execution: All modules collaborate asynchronously through a shared database, fully utilizing system resources.
- 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 - DS (
ddss/ds.py,ddss/ds.ts): Forward-chaining deductive search engine - 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
Using uvx (Recommended)
uvx ddss
Using pip
pip install ddss
ddss
TypeScript Version
Using npx (Recommended)
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, ds, 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 ds
# Run with only the E-graph engine
ddss --component input output egg
Available components:
input: Interactive input interfaceoutput: Real-time display of facts and ideasds: Forward-chaining deductive search engineegg: E-graph based equality reasoning engineload: Batch import facts from standard inputdump: 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.
Links
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ddss-0.0.32-py3-none-any.whl.
File metadata
- Download URL: ddss-0.0.32-py3-none-any.whl
- Upload date:
- Size: 31.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
78fda287ab247affddeb809fa83dfe7762a936ecef095fa5047101ddc6cd1817
|
|
| MD5 |
950dfb9f9293dc20a6b7a1cf873d32b5
|
|
| BLAKE2b-256 |
d5620da12628ebf81c5dcce2cf21a5add8e42e17f35ee33e76b2723f4790b7a9
|
Provenance
The following attestation bundles were made for ddss-0.0.32-py3-none-any.whl:
Publisher:
wheels.yml on USTC-KnowledgeComputingLab/ddss
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ddss-0.0.32-py3-none-any.whl -
Subject digest:
78fda287ab247affddeb809fa83dfe7762a936ecef095fa5047101ddc6cd1817 - Sigstore transparency entry: 779874394
- Sigstore integration time:
-
Permalink:
USTC-KnowledgeComputingLab/ddss@2bf4c60f026960770562f006e93288ee3e8229af -
Branch / Tag:
refs/tags/v0.0.32 - Owner: https://github.com/USTC-KnowledgeComputingLab
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
wheels.yml@2bf4c60f026960770562f006e93288ee3e8229af -
Trigger Event:
push
-
Statement type: