datalog: arith / by zero raises instead of returning inf
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 47s

`is(R, /(X, 0))` was silently producing IEEE infinity:

  (dl-eval "p(10). q(R) :- p(X), is(R, /(X, 0))." "?- q(R).")
  => ({:R inf})

That value then flowed through comparisons (anything < inf, anything
> inf) and aggregations (sum of inf, max of inf) producing nonsense
results downstream. `dl-eval-arith` now checks the divisor before
the host `/` and raises "division by zero in <expr>" — surfacing
the bug at its source rather than letting infinity propagate.

1 new test; conformance 264/264.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-11 07:59:25 +00:00
parent 9e380fd96e
commit 00881f84eb
5 changed files with 31 additions and 9 deletions

View File

@@ -1,6 +1,6 @@
# datalog scoreboard
**263 / 263 passing** (0 failure(s)).
**264 / 264 passing** (0 failure(s)).
| Suite | Passed | Total | Status |
|-------|--------|-------|--------|
@@ -8,7 +8,7 @@
| parse | 22 | 22 | ok |
| unify | 29 | 29 | ok |
| eval | 39 | 39 | ok |
| builtins | 23 | 23 | ok |
| builtins | 24 | 24 | ok |
| semi_naive | 8 | 8 | ok |
| negation | 10 | 10 | ok |
| aggregates | 23 | 23 | ok |