datalog: cousin (multi-adornment same-relation) magic test (240/240)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 54s

This commit is contained in:
2026-05-08 23:00:22 +00:00
parent 62a5a29d5b
commit a4ef271459
3 changed files with 24 additions and 6 deletions

View File

@@ -1,8 +1,8 @@
{
"lang": "datalog",
"total_passed": 239,
"total_passed": 240,
"total_failed": 0,
"total": 239,
"total": 240,
"suites": [
{"name":"tokenize","passed":26,"failed":0,"total":26},
{"name":"parse","passed":20,"failed":0,"total":20},
@@ -13,8 +13,8 @@
{"name":"negation","passed":10,"failed":0,"total":10},
{"name":"aggregates","passed":20,"failed":0,"total":20},
{"name":"api","passed":20,"failed":0,"total":20},
{"name":"magic","passed":31,"failed":0,"total":31},
{"name":"magic","passed":32,"failed":0,"total":32},
{"name":"demo","passed":21,"failed":0,"total":21}
],
"generated": "2026-05-08T14:40:44+00:00"
"generated": "2026-05-08T22:41:23+00:00"
}

View File

@@ -1,6 +1,6 @@
# datalog scoreboard
**239 / 239 passing** (0 failure(s)).
**240 / 240 passing** (0 failure(s)).
| Suite | Passed | Total | Status |
|-------|--------|-------|--------|
@@ -13,5 +13,5 @@
| negation | 10 | 10 | ok |
| aggregates | 20 | 20 | ok |
| api | 20 | 20 | ok |
| magic | 31 | 31 | ok |
| magic | 32 | 32 | ok |
| demo | 21 | 21 | ok |

View File

@@ -268,6 +268,24 @@
(= (len semi) 1))))
true)
;; Same relation called with different adornment patterns
;; in different rules. The worklist must enqueue and process
;; each (rel, adornment) pair.
(dl-mt-test! "magic with multi-adornment same relation"
(let
((db (dl-program
"parent(p1, alice). parent(p2, bob).
parent(g, p1). parent(g, p2).
sibling(P1, P2) :- parent(G, P1), parent(G, P2),
!=(P1, P2).
cousin(X, Y) :- parent(P1, X), parent(P2, Y),
sibling(P1, P2).")))
(let
((semi (dl-query db (list (quote cousin) (quote alice) (quote Y))))
(magic (dl-magic-query db (list (quote cousin) (quote alice) (quote Y)))))
(= (len semi) (len magic))))
true)
;; Magic over a rule whose body contains an aggregate.
;; The rewriter passes aggregate body lits through unchanged
;; (no propagation generated for them), so semi-naive's count