datalog: dl-query accepts conjunctive goal lists (167/167)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 54s

dl-query now auto-dispatches on the first element's shape:
- positive literal (head is a symbol) or {:neg ...} dict → wrap
- list of literals → conjunctive query

dl-query-coerce normalizes; dl-query-user-vars collects the union
of user-named vars (deduped, '_' filtered) for projection. Old
single-literal callers unchanged.

  (dl-query db '(p X))                   ; single
  (dl-query db '((p X) (q X)))           ; conjunction
  (dl-query db (list '(n X) '(> X 2)))   ; with comparison

2 new api tests cover multi-goal AND and conjunction with comparison.
This commit is contained in:
2026-05-08 09:17:15 +00:00
parent b95d8c5a63
commit 408fc27366
5 changed files with 94 additions and 24 deletions

View File

@@ -1,8 +1,8 @@
{
"lang": "datalog",
"total_passed": 165,
"total_passed": 167,
"total_failed": 0,
"total": 165,
"total": 167,
"suites": [
{"name":"tokenize","passed":26,"failed":0,"total":26},
{"name":"parse","passed":18,"failed":0,"total":18},
@@ -12,8 +12,8 @@
{"name":"semi_naive","passed":8,"failed":0,"total":8},
{"name":"negation","passed":10,"failed":0,"total":10},
{"name":"aggregates","passed":16,"failed":0,"total":16},
{"name":"api","passed":9,"failed":0,"total":9},
{"name":"api","passed":11,"failed":0,"total":11},
{"name":"demo","passed":13,"failed":0,"total":13}
],
"generated": "2026-05-08T09:12:57+00:00"
"generated": "2026-05-08T09:16:59+00:00"
}