datalog: disjunction via multiple rules test (231/231)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 52s

This commit is contained in:
2026-05-08 14:12:34 +00:00
parent f12edc8fd9
commit 0985dc6386
3 changed files with 19 additions and 6 deletions

View File

@@ -273,6 +273,19 @@
(dl-saturated? db))
false)
;; Disjunction via multiple rules — Datalog has no `;` in
;; body, so disjunction is expressed as separate rules with
;; the same head. Here plant_based(X) is satisfied by either
;; vegan(X) or vegetarian(X).
(dl-et-test-set! "disjunction via multiple rules"
(dl-query
(dl-program
"vegan(alice). vegetarian(bob). meat_eater(carol).
plant_based(X) :- vegan(X).
plant_based(X) :- vegetarian(X).")
(list (quote plant_based) (quote X)))
(list {:X (quote alice)} {:X (quote bob)}))
;; Bipartite-style join: pair-of-friends who share a hobby.
;; Three-relation join exercising the planner's join order.
(dl-et-test-set! "bipartite friends-with-hobby"