Skip to main content

doxa

Warning Doxa is currently in an early, unstable stage. APIs, query semantics, file formats, and behavior may change without notice. It is not yet recommended for production use.

An epistemic knowledge representation language — Datalog/Prolog-grounded, temporally-aware, conflict-sensitive, and auditable.

The Problem

Existing knowledge systems collapse important epistemic distinctions into a single dimension:

  • Classical Datalog / SQL — facts are ground truth. Conflict is a bug, ignorance is absence, decay requires manual deletion.
  • Probabilistic systems — a scalar p ∈ [0,1] cannot distinguish no evidence from equal evidence both ways; conflict, ignorance, and uncertainty all look the same.
  • Graph / triple stores — no first-class uncertainty model at all.

None of these can represent: "Source A strongly believes X, Source B strongly disbelieves X, valid between D1–D2, and the conflict is unresolved."

What Doxa Does

Every fact in Doxa is a BeliefRecord — a ground atom paired with:

  • b / d — independent degrees of evidence for and against (b + d ≤ 1)
  • src — who asserts this belief
  • vf / vt — real-world validity period
  • et — epistemic time (when the belief entered the KB)

This yields four qualitatively distinct epistemic states grounded in Belnap's four-valued logic:

State b d Meaning
None 0 0 No evidence either way
True > 0 0 Evidence for, not against
False 0 > 0 Evidence against, not for
Both > 0 > 0 Conflicting evidence

No single confidence scalar can represent all four — the distinction between None and Both is categorical, not a matter of degree.

bird(owl) @{b:0.98, src:"https://en.wikipedia.org/wiki/Owl", et:"2026-03-24"}.
weight_g(owl, 1500) @{b:0.98, src:"https://en.wikipedia.org/wiki/Owl", et:"2026-03-24"}.
wingspan_cm(owl, 110) @{b:0.97, src:"https://en.wikipedia.org/wiki/Owl", et:"2026-03-24"}.

bird(penguin) @{b:1.0, src:"https://en.wikipedia.org/wiki/Penguin", et:"2026-03-24"}.
weight_g(penguin, 30000) @{b:0.95, src:"https://en.wikipedia.org/wiki/Penguin", et:"2026-03-24"}.
wingspan_cm(penguin, 60) @{b:0.90, src:"https://en.wikipedia.org/wiki/Penguin", et:"2026-03-24"}.

can_fly(X) :-
    bird(X),
    weight_g(X, W),
    wingspan_cm(X, S),
    div(W, S, R),
    lt(R, 20) @{
        b:0.98, 
        src:"simplified heuristic inspired by wing loading (weight / wing area)", 
        et:"2026-03-24"
    }.
doxa> ?- can_fly(owl).
  1: b=0.913, d=0, status=true
doxa> ?- can_fly(penguin). 
  1: b=0, d=0, status=neither

Key Properties

  • Conflict without corruption — disagreeing sources produce Both, not an average; conflict is queryable, and the query policy (credulous/skeptical) resolves it at query time
  • Ignorance without inference — unasserted facts return None, not a prior or default false
  • Time as a language primitive — temporal validity and epistemic time are enforced uniformly via asof query semantics, not modeling conventions
  • Auditability built in — derivation traces (explain) name every supporting BeliefRecord, its source, validity window, and belief degree
  • Guaranteed termination — Datalog semantics ensure every query over a finite KB terminates

Foundations

Doxa's parametric combination algebra follows Lakshmanan & Shiri (2001). Its (b, d) semantics are grounded in Belnap (1977) and instantiated with Jøsang's subjective logic (2016). Doxa's contribution is the co-design of these elements into a single language with first-class provenance, temporal annotation, and audit traces — promoted from modeling conventions to language primitives enforced by the parser.

Language Specification

For the full formal syntax, semantics, builtins, query options, and edge cases see the Language Specification.

Repository Layout

Path Description
doxa/core/ Core language model types and parsing
doxa/query/ Query execution engine
doxa/persistence/ Storage backends (memory, native, PostgreSQL)
doxa/cli/ CLI entry points and interactive terminal
tests/ Automated tests and fixtures

Install

pip install doxa-lang

Optional PostgreSQL dependencies:

pip install "doxa-lang[postgres]"

For local development from source:

pip install -e ".[dev,postgres]"
pytest

Native Build Prerequisites

  • Python >=3.11
  • Rust toolchain 1.89 (pinned in rust-toolchain.toml and CI)
  • A working C/C++ compiler toolchain (build-essential on Linux, Xcode CLT on macOS, MSVC Build Tools on Windows)

Prebuilt wheels are published for Linux/macOS/Windows on CPython 3.11-3.13. The prerequisites above are required when building from source.

Backend Matrix

--memory backend --engine backend Status
memory memory supported
memory native supported
native memory supported
native native supported
postgres postgres supported
memory postgres not supported
postgres memory not supported
postgres native not supported
native postgres not supported

Environment Variables

  • DOXA_POSTGRES_URL (default: postgresql://localhost/doxa): PostgreSQL connection URL used by --memory postgres.
  • DOXA_POSTGRES_NATIVE_SQL (1 to enable): route eligible PostgreSQL queries through the native SQL fast path.

Quick Start

doxa --help
doxa
doxa --memory postgres --engine postgres

The CLI supports memory, native, and postgres backends via --memory and --engine.

License

MIT

Metadata

Release files for doxa-lang 0.1.0

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

Source distribution (sdist)

Source distribution for doxa-lang 0.1.0
File Size Uploaded
doxa_lang-0.1.0.tar.gz 152.0 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for doxa-lang 0.1.0
File
doxa_lang-0.1.0-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details
doxa_lang-0.1.0-cp313-cp313-manylinux_2_34_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.34+ x86-64 Details
doxa_lang-0.1.0-cp313-cp313-macosx_11_0_arm64.whl CPython 3.13 CPython 3.13 macOS 11.0+ ARM64 Details
doxa_lang-0.1.0-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details
doxa_lang-0.1.0-cp312-cp312-manylinux_2_34_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.34+ x86-64 Details
doxa_lang-0.1.0-cp312-cp312-macosx_11_0_arm64.whl CPython 3.12 CPython 3.12 macOS 11.0+ ARM64 Details
doxa_lang-0.1.0-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details
doxa_lang-0.1.0-cp311-cp311-manylinux_2_34_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.34+ x86-64 Details
doxa_lang-0.1.0-cp311-cp311-macosx_11_0_arm64.whl CPython 3.11 CPython 3.11 macOS 11.0+ ARM64 Details

Total release size: 9.4 MB

Release files / doxa_lang-0.1.0.tar.gz

Download URL doxa_lang-0.1.0.tar.gz
Size 152.0 kB
Tags Source
SHA-256 checksum
How to use checksums
ceeddb4d72bfab24a73b7daf86725d7b73eab8ad533961d8201710f801b25436
BLAKE2b-256 checksum
How to use checksums
8ab6ae46a7ab506b2c30a6beed16da30ea217e95e6bc443f1debbddc45408b3d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 May 14, 2026.

Transparency log

Release files / doxa_lang-0.1.0-cp313-cp313-win_amd64.whl

Download URL doxa_lang-0.1.0-cp313-cp313-win_amd64.whl
Size 911.4 kB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
e9403b07a36e22248aaf573f7409982422586c1ff4daaffabb732696dd1be0f8
BLAKE2b-256 checksum
How to use checksums
5ec406fa9b02af6bec288eee7753250280d95f98c1c5ee8946c0a73934ef9f65
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 May 14, 2026.

Transparency log

Release files / doxa_lang-0.1.0-cp313-cp313-manylinux_2_34_x86_64.whl

Download URL doxa_lang-0.1.0-cp313-cp313-manylinux_2_34_x86_64.whl
Size 1.1 MB
Tags CPython 3.13 Linux glibc 2.34+ x86-64
SHA-256 checksum
How to use checksums
3396263df47a2240f2398fcaec95fab33d43ff331558f721bd4a9d40e772be3d
BLAKE2b-256 checksum
How to use checksums
378d7f88c2bbbad16789faecfc313a5c6cde398e951a2af04814b137c8208736
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 May 14, 2026.

Transparency log

Release files / doxa_lang-0.1.0-cp313-cp313-macosx_11_0_arm64.whl

Download URL doxa_lang-0.1.0-cp313-cp313-macosx_11_0_arm64.whl
Size 1.0 MB
Tags CPython 3.13 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
6105dad5ea2fb8d829fe89fa2dd179410bd12eeeace8c16501bad0b79dcf4215
BLAKE2b-256 checksum
How to use checksums
ecc151cd1cbd3c6ceb78f311287bcdef0cf357396b577a632a8e21b0099905a4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 May 14, 2026.

Transparency log

Release files / doxa_lang-0.1.0-cp312-cp312-win_amd64.whl

Download URL doxa_lang-0.1.0-cp312-cp312-win_amd64.whl
Size 911.6 kB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
69e062ef031a00b0a5a15c289244691293f461088601d22252774d3bab196af9
BLAKE2b-256 checksum
How to use checksums
5535c37ac5630c6dd55beb425c72713b2a3ce99e57e74d712d62a09aa9d9dacc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 May 14, 2026.

Transparency log

Release files / doxa_lang-0.1.0-cp312-cp312-manylinux_2_34_x86_64.whl

Download URL doxa_lang-0.1.0-cp312-cp312-manylinux_2_34_x86_64.whl
Size 1.1 MB
Tags CPython 3.12 Linux glibc 2.34+ x86-64
SHA-256 checksum
How to use checksums
e681aca1596f41c8b077aeb10e9fcf381226b5ea5faa7d1500af6eab4b32f7fe
BLAKE2b-256 checksum
How to use checksums
02591d1590a5e0f7a5bf9ea677e757e1add14e11e5b4e041c969ef3f1fed783b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 May 14, 2026.

Transparency log

Release files / doxa_lang-0.1.0-cp312-cp312-macosx_11_0_arm64.whl

Download URL doxa_lang-0.1.0-cp312-cp312-macosx_11_0_arm64.whl
Size 1.0 MB
Tags CPython 3.12 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
112961553f4a0976f6df78982081de8aee12a18264be43f3e15dd7ae160ed731
BLAKE2b-256 checksum
How to use checksums
3a2b2aaa45ba54ad50e062bc756e9ccadbd96362d2eb80763afa96ac66b5a13c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 May 14, 2026.

Transparency log

Release files / doxa_lang-0.1.0-cp311-cp311-win_amd64.whl

Download URL doxa_lang-0.1.0-cp311-cp311-win_amd64.whl
Size 912.6 kB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
56cfbb0cb7d44967fc253f3162abc139a19b9637a3758736b4aadf800c8a6c6d
BLAKE2b-256 checksum
How to use checksums
d294ab6cb31486e742584de2746f5971b1f2d92f6f604498fc871edce982476c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 May 14, 2026.

Transparency log

Release files / doxa_lang-0.1.0-cp311-cp311-manylinux_2_34_x86_64.whl

Download URL doxa_lang-0.1.0-cp311-cp311-manylinux_2_34_x86_64.whl
Size 1.1 MB
Tags CPython 3.11 Linux glibc 2.34+ x86-64
SHA-256 checksum
How to use checksums
ac66a19f7dac7fac80c843ff895a08fd7ccd7099fe31ef4c3061522b76f069fc
BLAKE2b-256 checksum
How to use checksums
64dab60187fdc43f3f015a5479a07b4ad31c85d35a520dc730b15532b71a53a5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 May 14, 2026.

Transparency log

Release files / doxa_lang-0.1.0-cp311-cp311-macosx_11_0_arm64.whl

Download URL doxa_lang-0.1.0-cp311-cp311-macosx_11_0_arm64.whl
Size 1.0 MB
Tags CPython 3.11 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
87a261c4f061510319910c2f4b0a7b4acaa2893aca0ed2712c0b507a4cfd6126
BLAKE2b-256 checksum
How to use checksums
4fdd6715e383fef6801692dac1ab6e8239be49c4f02efbdc78aacf1b5ef2986e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 May 14, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.0 This release

10 release files

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