Files
rose-ash/lib/datalog/scoreboard.md
giles 6d04cf7bf2
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 50s
datalog: aggregation count/sum/min/max (Phase 8, 134/134)
New lib/datalog/aggregates.sx: (count R V Goal), (sum R V Goal),
(min R V Goal), (max R V Goal). dl-eval-aggregate runs
dl-find-bindings on the goal under the outer subst, collects
distinct values of V, applies the operator, binds R. Empty input:
count/sum return 0; min/max produce no binding (rule fails).

Group-by emerges naturally from outer-subst substitution into the
goal — `popular(P) :- post(P), count(N, U, liked(U, P)), >=(N, 3).`
counts per-post.

Stratifier extended: dl-aggregate-dep-edge contributes a
negation-like edge so the aggregate's goal relation is fully
derived before the aggregate fires (non-monotonicity respected).
Safety relaxed for aggregates: goal-internal vars are existentials,
only the result var becomes bound.
2026-05-08 08:28:45 +00:00

349 B

datalog scoreboard

134 / 134 passing (0 failure(s)).

Suite Passed Total Status
tokenize 26 26 ok
parse 18 18 ok
unify 28 28 ok
eval 15 15 ok
builtins 19 19 ok
semi_naive 8 8 ok
negation 10 10 ok
aggregates 10 10 ok