datalog: rule-shape validators in dl-add-rule! (253/253)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 43s
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 43s
Two malformed-rule paths used to slip through:
- Empty head list `{:head () :body ()}` was accepted; the rule
would never fire but the relation-name lookup later returned
nil with confusing downstream errors.
- Non-list body (`{:head (...) :body 42}`) crashed in `rest`
during safety check with a cryptic "rest: 1 list arg".
dl-add-rule! now checks head shape (non-empty list with symbol
head) and body type (list) before any safety walk. Errors are
descriptive and surface at add time rather than during the next
saturation.
2 new eval tests.
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
# datalog scoreboard
|
||||
|
||||
**251 / 251 passing** (0 failure(s)).
|
||||
**253 / 253 passing** (0 failure(s)).
|
||||
|
||||
| Suite | Passed | Total | Status |
|
||||
|-------|--------|-------|--------|
|
||||
| tokenize | 29 | 29 | ok |
|
||||
| parse | 22 | 22 | ok |
|
||||
| unify | 28 | 28 | ok |
|
||||
| eval | 36 | 36 | ok |
|
||||
| eval | 38 | 38 | ok |
|
||||
| builtins | 23 | 23 | ok |
|
||||
| semi_naive | 8 | 8 | ok |
|
||||
| negation | 10 | 10 | ok |
|
||||
|
||||
Reference in New Issue
Block a user