datalog: group-by-via-aggregate-in-rule test (216/216)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 24s
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 24s
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
{
|
||||
"lang": "datalog",
|
||||
"total_passed": 215,
|
||||
"total_passed": 216,
|
||||
"total_failed": 0,
|
||||
"total": 215,
|
||||
"total": 216,
|
||||
"suites": [
|
||||
{"name":"tokenize","passed":26,"failed":0,"total":26},
|
||||
{"name":"parse","passed":18,"failed":0,"total":18},
|
||||
@@ -11,10 +11,10 @@
|
||||
{"name":"builtins","passed":19,"failed":0,"total":19},
|
||||
{"name":"semi_naive","passed":8,"failed":0,"total":8},
|
||||
{"name":"negation","passed":10,"failed":0,"total":10},
|
||||
{"name":"aggregates","passed":18,"failed":0,"total":18},
|
||||
{"name":"aggregates","passed":19,"failed":0,"total":19},
|
||||
{"name":"api","passed":20,"failed":0,"total":20},
|
||||
{"name":"magic","passed":22,"failed":0,"total":22},
|
||||
{"name":"demo","passed":18,"failed":0,"total":18}
|
||||
],
|
||||
"generated": "2026-05-08T10:19:48+00:00"
|
||||
"generated": "2026-05-08T10:21:54+00:00"
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# datalog scoreboard
|
||||
|
||||
**215 / 215 passing** (0 failure(s)).
|
||||
**216 / 216 passing** (0 failure(s)).
|
||||
|
||||
| Suite | Passed | Total | Status |
|
||||
|-------|--------|-------|--------|
|
||||
@@ -11,7 +11,7 @@
|
||||
| builtins | 19 | 19 | ok |
|
||||
| semi_naive | 8 | 8 | ok |
|
||||
| negation | 10 | 10 | ok |
|
||||
| aggregates | 18 | 18 | ok |
|
||||
| aggregates | 19 | 19 | ok |
|
||||
| api | 20 | 20 | ok |
|
||||
| magic | 22 | 22 | ok |
|
||||
| demo | 18 | 18 | ok |
|
||||
|
||||
@@ -227,6 +227,22 @@
|
||||
(list {:L (list)}))
|
||||
|
||||
;; Aggregate vs single distinct.
|
||||
;; Group-by via aggregate-in-rule-body. Per-user friend count
|
||||
;; over a friends relation. The U var is bound by the prior
|
||||
;; positive lit u(U) so the aggregate counts only U-rooted
|
||||
;; friends per group.
|
||||
(dl-at-test-set! "group-by per-user friend count"
|
||||
(dl-query
|
||||
(dl-program
|
||||
"u(alice). u(bob). u(carol).
|
||||
f(alice, x). f(alice, y). f(bob, x).
|
||||
counts(U, N) :- u(U), count(N, X, f(U, X)).")
|
||||
(list (quote counts) (quote U) (quote N)))
|
||||
(list
|
||||
{:U (quote alice) :N 2}
|
||||
{:U (quote bob) :N 1}
|
||||
{:U (quote carol) :N 0}))
|
||||
|
||||
;; Stratification: recursion through aggregation is rejected.
|
||||
(dl-at-test! "agg recursion rejected"
|
||||
(dl-at-throws?
|
||||
|
||||
Reference in New Issue
Block a user