datalog: magic over rule with negation regression test (227/227)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 42s

This commit is contained in:
2026-05-08 12:31:50 +00:00
parent d20df7aa8c
commit 5f4defe99e
3 changed files with 20 additions and 6 deletions

View File

@@ -197,6 +197,20 @@
6)
;; dl-magic-query: end-to-end driver, doesn't mutate caller's db.
;; Magic over a rule with negated body literal — propagation
;; rules generated only for positive lits; negated lits pass
;; through unchanged.
(dl-mt-test! "magic over rule with negation"
(let
((db (dl-program
"u(a). u(b). u(c). banned(b).
active(X) :- u(X), not(banned(X)).")))
(let
((semi (dl-query db (list (quote active) (quote X))))
(magic (dl-magic-query db (list (quote active) (quote X)))))
(= (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