datalog: indirect aggregate cycle rejected (230/230)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 57s

This commit is contained in:
2026-05-08 14:08:02 +00:00
parent 9edccb8f33
commit f12edc8fd9
3 changed files with 24 additions and 6 deletions

View File

@@ -244,6 +244,24 @@
{:U (quote carol) :N 0}))
;; Stratification: recursion through aggregation is rejected.
;; Indirect recursion through aggregation also rejected.
;; q -> r (via positive lit), r -> q (via aggregate body).
;; The aggregate edge counts as negation for stratification.
(dl-at-test! "indirect agg cycle rejected"
(dl-at-throws?
(fn ()
(let ((db (dl-make-db)))
(do
(dl-add-rule! db
{:head (list (quote q) (quote N))
:body (list (list (quote r) (quote N)))})
(dl-add-rule! db
{:head (list (quote r) (quote N))
:body (list (list (quote count) (quote N) (quote X)
(list (quote q) (quote X))))})
(dl-saturate! db)))))
true)
(dl-at-test! "agg recursion rejected"
(dl-at-throws?
(fn ()