datalog: reject malformed dict body literals
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 1m26s
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 1m26s
A dict in a rule body that isn't `{:neg <positive-lit>}` (the only
recognised dict shape) used to silently fall through every dispatch
clause in dl-rule-check-safety, contributing zero bound variables.
The user would then see a confusing "head variable(s) X do not
appear in any positive body literal" pointing at the head — not at
the actual bug in the body. Typos like `{:negs ...}` are the typical
trigger.
dl-process-lit! now flags both:
- a dict that lacks :neg
- a bare number / string / symbol used as a body lit
with a clear error naming the offending literal.
1 new regression test; conformance 265/265.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
{
|
||||
"lang": "datalog",
|
||||
"total_passed": 264,
|
||||
"total_passed": 265,
|
||||
"total_failed": 0,
|
||||
"total": 264,
|
||||
"total": 265,
|
||||
"suites": [
|
||||
{"name":"tokenize","passed":30,"failed":0,"total":30},
|
||||
{"name":"parse","passed":22,"failed":0,"total":22},
|
||||
{"name":"unify","passed":29,"failed":0,"total":29},
|
||||
{"name":"eval","passed":39,"failed":0,"total":39},
|
||||
{"name":"eval","passed":40,"failed":0,"total":40},
|
||||
{"name":"builtins","passed":24,"failed":0,"total":24},
|
||||
{"name":"semi_naive","passed":8,"failed":0,"total":8},
|
||||
{"name":"negation","passed":10,"failed":0,"total":10},
|
||||
@@ -16,5 +16,5 @@
|
||||
{"name":"magic","passed":36,"failed":0,"total":36},
|
||||
{"name":"demo","passed":21,"failed":0,"total":21}
|
||||
],
|
||||
"generated": "2026-05-11T07:59:10+00:00"
|
||||
"generated": "2026-05-11T08:03:45+00:00"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user