Files
rose-ash/lib/datalog
giles a648247ae4
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 25s
datalog: dl-magic-query falls back on built-in/agg/neg goals (222/222)
Bug: dl-magic-query was always trying to seed a magic_<rel>^<adn>
fact for the query goal. For aggregate goals like (count N X (p X))
this produced a non-ground "fact" (magic_count^... N X (p X)) and
dl-add-fact! correctly rejected it, surfacing as an error.

Fix: dl-magic-query now detects built-in / aggregate / negation
goals up front and dispatches to plain dl-query for those cases —
magic-sets only applies to positive non-builtin literals against
rule-defined relations. Other shapes don't benefit from the
rewrite anyway.

1 new test confirms (count N X (p X)) returns the expected
{:N 3} via dl-magic-query.
2026-05-08 10:32:01 +00:00
..