datalog: built-in-only query goals (236/236)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 47s

This commit is contained in:
2026-05-08 14:19:25 +00:00
parent 21c541bd1b
commit 4a7cff2f6b
3 changed files with 20 additions and 6 deletions

View File

@@ -1,14 +1,14 @@
{ {
"lang": "datalog", "lang": "datalog",
"total_passed": 233, "total_passed": 236,
"total_failed": 0, "total_failed": 0,
"total": 233, "total": 236,
"suites": [ "suites": [
{"name":"tokenize","passed":26,"failed":0,"total":26}, {"name":"tokenize","passed":26,"failed":0,"total":26},
{"name":"parse","passed":20,"failed":0,"total":20}, {"name":"parse","passed":20,"failed":0,"total":20},
{"name":"unify","passed":28,"failed":0,"total":28}, {"name":"unify","passed":28,"failed":0,"total":28},
{"name":"eval","passed":32,"failed":0,"total":32}, {"name":"eval","passed":32,"failed":0,"total":32},
{"name":"builtins","passed":20,"failed":0,"total":20}, {"name":"builtins","passed":23,"failed":0,"total":23},
{"name":"semi_naive","passed":8,"failed":0,"total":8}, {"name":"semi_naive","passed":8,"failed":0,"total":8},
{"name":"negation","passed":10,"failed":0,"total":10}, {"name":"negation","passed":10,"failed":0,"total":10},
{"name":"aggregates","passed":20,"failed":0,"total":20}, {"name":"aggregates","passed":20,"failed":0,"total":20},
@@ -16,5 +16,5 @@
{"name":"magic","passed":28,"failed":0,"total":28}, {"name":"magic","passed":28,"failed":0,"total":28},
{"name":"demo","passed":21,"failed":0,"total":21} {"name":"demo","passed":21,"failed":0,"total":21}
], ],
"generated": "2026-05-08T14:16:19+00:00" "generated": "2026-05-08T14:19:14+00:00"
} }

View File

@@ -1,6 +1,6 @@
# datalog scoreboard # datalog scoreboard
**233 / 233 passing** (0 failure(s)). **236 / 236 passing** (0 failure(s)).
| Suite | Passed | Total | Status | | Suite | Passed | Total | Status |
|-------|--------|-------|--------| |-------|--------|-------|--------|
@@ -8,7 +8,7 @@
| parse | 20 | 20 | ok | | parse | 20 | 20 | ok |
| unify | 28 | 28 | ok | | unify | 28 | 28 | ok |
| eval | 32 | 32 | ok | | eval | 32 | 32 | ok |
| builtins | 20 | 20 | ok | | builtins | 23 | 23 | ok |
| semi_naive | 8 | 8 | ok | | semi_naive | 8 | 8 | ok |
| negation | 10 | 10 | ok | | negation | 10 | 10 | ok |
| aggregates | 20 | 20 | ok | | aggregates | 20 | 20 | ok |

View File

@@ -179,6 +179,20 @@
((db (dl-program "n(0). n(1). n(2). n(3). n(4). n(5). n(6). n(7). n(8). n(9).\n big(X) :- n(X), >=(X, 5)."))) ((db (dl-program "n(0). n(1). n(2). n(3). n(4). n(5). n(6). n(7). n(8). n(9).\n big(X) :- n(X), >=(X, 5).")))
(do (dl-saturate! db) (len (dl-relation db "big")))) (do (dl-saturate! db) (len (dl-relation db "big"))))
5) 5)
;; Built-in / arithmetic literals work as standalone query goals
;; (without needing a wrapper rule).
(dl-bt-test-set! "comparison-only goal true"
(dl-eval "" "?- <(1, 2).")
(list {}))
(dl-bt-test-set! "comparison-only goal false"
(dl-eval "" "?- <(2, 1).")
(list))
(dl-bt-test-set! "is goal binds"
(dl-eval "" "?- is(N, +(2, 3)).")
(list {:N 5}))
;; Bounded successor: a recursive rule with a comparison ;; Bounded successor: a recursive rule with a comparison
;; guard terminates because the Herbrand base is effectively ;; guard terminates because the Herbrand base is effectively
;; bounded. ;; bounded.