Files
rose-ash/lib/datalog/scoreboard.md
giles 6bae94bae1
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 25s
datalog: reject compound terms in fact / rule-head args
Datalog has no function symbols in argument positions, but the
existing dl-add-fact! / dl-add-rule! validators only checked that
literals were ground (no free variables). A compound like `+(1, 2)`
contains no variables, so:

  p(+(1, 2)).
  => stored as the unreduced tuple `(p (+ 1 2))`

  double(*(X, 2)) :- n(X).  n(3).
  => saturates `double((* 3 2))` instead of `double(6)`

Added dl-simple-term? (number / string / symbol) and an
args-simple? walker, used by:

  - dl-add-fact!: all args must be simple terms
  - dl-add-rule!: rule head args must be simple terms (variables
    are symbols, so they pass)

Compounds remain legal in body literals where they encode `is` /
arithmetic / aggregate sub-goals. Error messages name the offending
literal and point the user at the body-only mechanism.

2 new regression tests; conformance 271/271.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-11 08:44:30 +00:00

18 lines
421 B
Markdown

# datalog scoreboard
**271 / 271 passing** (0 failure(s)).
| Suite | Passed | Total | Status |
|-------|--------|-------|--------|
| tokenize | 31 | 31 | ok |
| parse | 23 | 23 | ok |
| unify | 29 | 29 | ok |
| eval | 42 | 42 | ok |
| builtins | 26 | 26 | ok |
| semi_naive | 8 | 8 | ok |
| negation | 10 | 10 | ok |
| aggregates | 23 | 23 | ok |
| api | 22 | 22 | ok |
| magic | 36 | 36 | ok |
| demo | 21 | 21 | ok |