Skip to content

tiny-datalog 0.3.0

Choose a tag to compare

@andrewgoodchild andrewgoodchild released this 05 Oct 00:43
· 9 commits to main since this release

Tabling with stratified negation. tiny-datalog-tabling now runs programs with not when they stratify: a negated subgoal's tables are completed one stratum down before they are read. Negation through recursion is still refused, with a pointer to --models for the well-founded semantics.

A friendlier library.

engine = run_program(rules, facts={"depends": [("app", "lib")], "service": ["app"]})
engine.query("exposed(S, C)")   # [{'S': ..., 'C': ...}, ...]

Course. Lesson 15 adds a section on what full SLG resolution adds, and eight queens as a worked example: tabling solves it in 0.4s, while plain bottom-up must build 2.5 million intermediate facts. benchmarks/generate.py queens N generates any board size.