datalog: aggregate validates that agg-var appears in goal
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 37s
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 37s
`count(N, Y, p(X))` silently returned `N = 1` because `Y` was never bound by the goal — every match contributed the same unbound symbol which dl-val-member? deduped to a single entry. Similarly: sum(S, Y, p(X)) => raises "expected number, got symbol" findall(L, Y, p(X)) => L = (Y) (a list containing the unbound symbol) count(N, Y, p(X)) => N = 1 (silent garbage) Added a third validator in dl-eval-aggregate: the agg-var must syntactically appear among the goal's variables. Error names the variable and the goal and explains why the result would be meaningless. 1 new test; conformance 263/263. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
# datalog scoreboard
|
||||
|
||||
**262 / 262 passing** (0 failure(s)).
|
||||
**263 / 263 passing** (0 failure(s)).
|
||||
|
||||
| Suite | Passed | Total | Status |
|
||||
|-------|--------|-------|--------|
|
||||
@@ -11,7 +11,7 @@
|
||||
| builtins | 23 | 23 | ok |
|
||||
| semi_naive | 8 | 8 | ok |
|
||||
| negation | 10 | 10 | ok |
|
||||
| aggregates | 22 | 22 | ok |
|
||||
| aggregates | 23 | 23 | ok |
|
||||
| api | 22 | 22 | ok |
|
||||
| magic | 36 | 36 | ok |
|
||||
| demo | 21 | 21 | ok |
|
||||
|
||||
Reference in New Issue
Block a user