datalog: magic ≡ semi on federation foaf demo (237/237)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 54s

This commit is contained in:
2026-05-08 14:29:18 +00:00
parent 4a7cff2f6b
commit e981368dcf
3 changed files with 20 additions and 6 deletions

View File

@@ -228,6 +228,20 @@
(and (= (len found) 1) (= (len missing) 0))))
true)
;; Magic equivalence on the federation demo.
(dl-mt-test! "magic ≡ semi on foaf demo"
(let
((db (dl-program-data
(quote ((follows alice bob)
(follows bob carol)
(follows alice dave)))
dl-demo-federation-rules)))
(let
((semi (dl-query db (quote (foaf alice X))))
(magic (dl-magic-query db (quote (foaf alice 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