Repository navigation
Releases
tddlog 0.1.1
tddlog 0.1.1, the first release on crates.io.
The engine is 0.1.0's and gives the same answers. This release puts the
crate on crates.io, and brings the shorter README and guide and the
website as they are now. The release notes of
0.1.0 say
what tddlog reads and how it works.
Install
- Command line: download the archive for your platform below (Linux
x86-64 and ARM64 with glibc 2.28 or newer, macOS ARM64 and x86-64,
Windows x86-64), unpack it and run./tddlog examples/alarm.plin its
directory. Each archive has a.sha256beside it. - Python:
pip install tddlog. Wheels cover CPython 3.10 and later on
the same five platforms. - C and C++: the
tddlog-c-v0.1.1-*archives below hold the header, the
shared and the static library, a CMake package and a pkg-config file. - Rust:
tddlog = "0.1"from crates.io. - From source:
cargo install --locked tddlog, with Rust 1.88 or newer,
a C++20 compiler (GCC 11 or newer, or Clang 14 or newer) andmake. - In the browser: the playground
runs tddlog in the tab, with nothing to install.
Changes since 0.1.0
- The crate depends on the crates.io releases of tididi 0.2.0 and goatd
0.3.0, the same code as the commits 0.1.0 pinned. - The README is shorter: what tddlog is, how it compares, how to
install it, and links to the website,
which has every result by type of program and by baseline. - The guide is shorter, with the details folded.
- The website has a page on why tddlog is fast:
the optimizations in its pipeline, each with an example, and its
walkthroughs are traced again with this release. - The pedigree example is a line of dogs
(examples/larger/dog_pedigree.pl, formerlyblood_types.pl), with
the same model and answers.
tddlog 0.1.0
tddlog 0.1.0, the first release.
tddlog answers probabilistic Datalog programs exactly. Front ends reduce
ProbLog programs with function symbols and lists, Bayesian and Markov
networks, Dice programs, Circulette netlists and LPADs to it. tddlog
grounds the program, simplifies it, compiles it bottom up into tree
decision diagrams (TDDs) with the
tididi library, and reads every
query's probability off the diagrams.
Install
- Command line: download the archive for your platform below (Linux
x86-64 and ARM64 with glibc 2.28 or newer, macOS ARM64 and x86-64,
Windows x86-64), unpack it and run./tddlog examples/alarm.plin its
directory. Each archive has a.sha256beside it. - Python:
pip install tddlog. Wheels cover CPython 3.10 and later on
the same five platforms; elsewhere pip builds from the source
distribution, which needs Rust 1.88 or newer and a C++20 compiler. - C and C++: the
tddlog-c-v0.1.0-*archives below hold the header, the
shared and the static library, a CMake package and a pkg-config file. - Rust:
tddlog = { git = "https://github.com/Tractables/tddlog", tag = "v0.1.0" }. - From source:
cargo install --locked --git https://github.com/Tractables/tddlog --tag v0.1.0 tddlog,
with Rust 1.88 or newer, a C++20 compiler (GCC 11 or newer, or Clang
14 or newer) andmake; the README says what to do where the
system'scargoorg++is older. - In the browser: the playground
runs tddlog in the tab, with nothing to install.
What it reads
- ProbLog programs: probabilistic facts and rules, annotated
disjunctions, negation as failure, also through recursion where every
possible world has a well-founded model, comparisons and integer
arithmetic, function symbols and lists with ProbLog's list predicates,
call/N,findall/3,all/3andforall/2over probabilistic goals,
library(aggregate)'s aggregates,query/1andevidence/1,2. A
program can take values from the command line in its places$1,
$2, ... Not yet read: cut, if-then-else,assertand strings. - Bayesian networks in BIF, Hugin, GeNIe and UAI, with evidence in Ace's
.instor UAI's.evid, and Markov networks in UAI, where
--evidence-probabilitygives the partition function. - Dice programs, each integer as its bits and a loop as recursion over a
step index (not yet/,%andsample). - Circulette netlists, with a fault on each logic gate and every single,
pair and triple of faults a query. - LPADs written for cplint and PITA, PRISM's switches among them.
--program prints the program an input is read as, --ground the
ground program, which ProbLog also reads, and --cnf a weighted CNF for
a weighted model counter.
Inside
- Grounding: magic sets and semi-naive evaluation ground only what the
queries and the evidence depend on; transitive closures ground from
their bound end, and linear recursion is solved by Gaussian
elimination. - Simplification: the gates are hashed into an and-inverter graph, and
gates that random simulation and a SAT check prove equal are merged;
unit propagation, SAT backbones and equivalences condition the program
on its evidence; the rows of a table share class atoms and switches. - Compilation: each strongly connected component is compiled by a
fixpoint of the immediate-consequence operator on diagrams, negation
through recursion by its well-founded fixpoint. An atom read across a
narrow cut of the variable order is read through a named copy tied to
its definition, kept or composed away after the compile, whichever
gives the smaller diagram. - Vtrees:
--vtree auto, the default, runs layouts read from tree
decompositions (goatd), from
the program's order and from its fan-in, and a vtree searched by
rotations during the compile, in turns under doubling budgets of
engine work, and the first to finish answers. Each layout can also be
asked for by name. - Queries and evidence: every marginal is read off one backward pass,
probabilities below a double's range keep an exponent of their own,
and where only the probability of the evidence is asked each join sums
out what no later join reads.
Bindings and site
- A Rust library (
tddlog::read,tddlog::solve), a Python package
(tddlog.solve), a C library, and a WebAssembly build. - Alea.jl and Roulette can hand their inference to tddlog: Alea.jl's
tddlog backend on the branchtddlogof
Tractables/Alea.jl,
and Roulette's tddlog engine on the branchtddlogof
Tractables/roulette. - The site, https://tractables.github.io/tddlog/: the playground, a
guide with worked examples, the Rust, Python and C documentation, and
the results, with a page for each system compared and each benchmark's
program as each system read it.
How it compares
tddlog was compared with every exact inference system we could find, on
five types of program, each against the systems that natively handle
it, and on all programs together. Every answer is checked against an
exact reference. Runs are single-threaded, under a time limit of 300 or
600 s; the methods table
says how the runs were made and the speed-up counted. As of 2026-11-09:
- Probabilistic logic programs: tddlog answers 336 of 362, ProbLog 255
and PITA 226; tddlog is 214 times faster than ProbLog and 285 times
faster than PITA. - Probabilistic databases: tddlog answers 308 of 320 queries, ProvSQL
283; tddlog is 26 times faster than ProvSQL. - Bayesian networks: tddlog answers 616 of 634, Ace 414; tddlog is 55
times faster than Ace. - Markov networks: tddlog answers 250 of 290, TensorInference.jl 198;
tddlog is 6 times faster than TensorInference.jl. - Probabilistic functional programs: tddlog answers 297 of 336, Roulette
198 and Alea.jl 190; tddlog is 29 times faster than Roulette and 17
times faster than Alea.jl.
The README's Performance section has the tables and plots, and the
results page every
instance, time and program. The repository's baselines branch has the
code that runs each system and the copies of their programs.