datalog: comprehensive integration test (184/184)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 47s
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 47s
Single program exercising recursion + stratified negation +
aggregation + comparison composed end-to-end via dl-eval. Confirms
the full pipeline (parser → safety → stratifier → semi-naive +
aggregate post-pass → query) on a non-trivial program.
edge graph + banned set →
reach transitive closure →
safe (reach minus banned) →
reach_count via count aggregation grouped by source →
popular = reach_count >= 2
This commit is contained in:
@@ -1,8 +1,8 @@
|
|||||||
{
|
{
|
||||||
"lang": "datalog",
|
"lang": "datalog",
|
||||||
"total_passed": 183,
|
"total_passed": 184,
|
||||||
"total_failed": 0,
|
"total_failed": 0,
|
||||||
"total": 183,
|
"total": 184,
|
||||||
"suites": [
|
"suites": [
|
||||||
{"name":"tokenize","passed":26,"failed":0,"total":26},
|
{"name":"tokenize","passed":26,"failed":0,"total":26},
|
||||||
{"name":"parse","passed":18,"failed":0,"total":18},
|
{"name":"parse","passed":18,"failed":0,"total":18},
|
||||||
@@ -12,8 +12,8 @@
|
|||||||
{"name":"semi_naive","passed":8,"failed":0,"total":8},
|
{"name":"semi_naive","passed":8,"failed":0,"total":8},
|
||||||
{"name":"negation","passed":10,"failed":0,"total":10},
|
{"name":"negation","passed":10,"failed":0,"total":10},
|
||||||
{"name":"aggregates","passed":18,"failed":0,"total":18},
|
{"name":"aggregates","passed":18,"failed":0,"total":18},
|
||||||
{"name":"api","passed":13,"failed":0,"total":13},
|
{"name":"api","passed":14,"failed":0,"total":14},
|
||||||
{"name":"demo","passed":18,"failed":0,"total":18}
|
{"name":"demo","passed":18,"failed":0,"total":18}
|
||||||
],
|
],
|
||||||
"generated": "2026-05-08T09:45:03+00:00"
|
"generated": "2026-05-08T09:47:44+00:00"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# datalog scoreboard
|
# datalog scoreboard
|
||||||
|
|
||||||
**183 / 183 passing** (0 failure(s)).
|
**184 / 184 passing** (0 failure(s)).
|
||||||
|
|
||||||
| Suite | Passed | Total | Status |
|
| Suite | Passed | Total | Status |
|
||||||
|-------|--------|-------|--------|
|
|-------|--------|-------|--------|
|
||||||
@@ -12,5 +12,5 @@
|
|||||||
| semi_naive | 8 | 8 | ok |
|
| semi_naive | 8 | 8 | ok |
|
||||||
| negation | 10 | 10 | ok |
|
| negation | 10 | 10 | ok |
|
||||||
| aggregates | 18 | 18 | ok |
|
| aggregates | 18 | 18 | ok |
|
||||||
| api | 13 | 13 | ok |
|
| api | 14 | 14 | ok |
|
||||||
| demo | 18 | 18 | ok |
|
| demo | 18 | 18 | ok |
|
||||||
|
|||||||
@@ -213,6 +213,23 @@
|
|||||||
"?- p(X), q(X).")
|
"?- p(X), q(X).")
|
||||||
(list {:X 2} {:X 3}))
|
(list {:X 2} {:X 3}))
|
||||||
|
|
||||||
|
;; Comprehensive integration: recursion + stratified negation
|
||||||
|
;; + aggregation + comparison composed in a single program.
|
||||||
|
;; (Uses _Anything as a regular var instead of `_` so the
|
||||||
|
;; outer rule binds via the reach lit.)
|
||||||
|
(dl-api-test-set! "integration"
|
||||||
|
(dl-eval
|
||||||
|
(str
|
||||||
|
"edge(a, b). edge(b, c). edge(c, d). edge(a, d). "
|
||||||
|
"banned(c). "
|
||||||
|
"reach(X, Y) :- edge(X, Y). "
|
||||||
|
"reach(X, Z) :- edge(X, Y), reach(Y, Z). "
|
||||||
|
"safe(X, Y) :- reach(X, Y), not(banned(Y)). "
|
||||||
|
"reach_count(X, N) :- reach(X, Z), count(N, Y, safe(X, Y)). "
|
||||||
|
"popular(X) :- reach_count(X, N), >=(N, 2).")
|
||||||
|
"?- popular(X).")
|
||||||
|
(list {:X (quote a)}))
|
||||||
|
|
||||||
;; dl-rule-from-list with no arrow → fact-style.
|
;; dl-rule-from-list with no arrow → fact-style.
|
||||||
(dl-api-test-set! "no arrow → fact-like rule"
|
(dl-api-test-set! "no arrow → fact-like rule"
|
||||||
(let
|
(let
|
||||||
|
|||||||
@@ -284,6 +284,14 @@ large graphs.
|
|||||||
|
|
||||||
_Newest first._
|
_Newest first._
|
||||||
|
|
||||||
|
- 2026-05-08 — Comprehensive integration test in api suite: a
|
||||||
|
single program exercising recursion (`reach` transitive closure)
|
||||||
|
+ stratified negation (`safe X Y :- reach X Y, not banned Y`) +
|
||||||
|
aggregation (`reach_count` via count) + comparison (`>= N 2`)
|
||||||
|
composed end-to-end via `dl-eval source query-source`. Confirms
|
||||||
|
the full pipeline (parser → safety → stratifier → semi-naive +
|
||||||
|
aggregate post-pass → query) on a non-trivial program.
|
||||||
|
|
||||||
- 2026-05-08 — Bug fix: aggregates work as top-level query goals.
|
- 2026-05-08 — Bug fix: aggregates work as top-level query goals.
|
||||||
`dl-match-lit` (the naive matcher used by `dl-find-bindings`) was
|
`dl-match-lit` (the naive matcher used by `dl-find-bindings`) was
|
||||||
missing the `dl-aggregate?` dispatch — it was only present in
|
missing the `dl-aggregate?` dispatch — it was only present in
|
||||||
|
|||||||
Reference in New Issue
Block a user