From 18fb54a8c559a4d0bdbd519376ce2079acf947dc Mon Sep 17 00:00:00 2001 From: giles Date: Fri, 8 May 2026 09:37:12 +0000 Subject: [PATCH] datalog: refresh module headers (findall, 6 demos) --- lib/datalog/aggregates.sx | 13 +++++++------ lib/datalog/demo.sx | 10 +++++++--- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/lib/datalog/aggregates.sx b/lib/datalog/aggregates.sx index 27117fd6..af0ef0f1 100644 --- a/lib/datalog/aggregates.sx +++ b/lib/datalog/aggregates.sx @@ -1,11 +1,12 @@ -;; lib/datalog/aggregates.sx — count / sum / min / max aggregation. +;; lib/datalog/aggregates.sx — count / sum / min / max / findall. ;; -;; Surface form (always 3-arg in the parsed AST): +;; Surface form (always 3-arg after the relation name): ;; -;; (count Result Var GoalLit) -;; (sum Result Var GoalLit) -;; (min Result Var GoalLit) -;; (max Result Var GoalLit) +;; (count Result Var GoalLit) +;; (sum Result Var GoalLit) +;; (min Result Var GoalLit) +;; (max Result Var GoalLit) +;; (findall List Var GoalLit) ;; ;; Parsed naturally because arg-position compounds are already allowed ;; (Phase 4 needs them for arithmetic). At evaluation time the aggregator diff --git a/lib/datalog/demo.sx b/lib/datalog/demo.sx index 036feae9..f15dd645 100644 --- a/lib/datalog/demo.sx +++ b/lib/datalog/demo.sx @@ -6,11 +6,15 @@ ;; below show the shape of queries we want, and the test suite runs ;; them against synthetic in-memory tuples loaded via dl-program-data. ;; -;; Three thematic demos: +;; Six thematic demos: ;; -;; 1. Federation — follow graph, transitive reach, mutuals. -;; 2. Content — posts, tags, likes, popularity, "for you" feed. +;; 1. Federation — follow graph, transitive reach, mutuals, FOAF. +;; 2. Content — posts, tags, likes, popularity, "for you" feed. ;; 3. Permissions — group membership and resource access. +;; 4. Cooking-posts — canonical "posts about cooking by people I +;; follow (transitively)" multi-domain query. +;; 5. Tag co-occurrence — distinct (T1, T2) pairs with counts. +;; 6. Shortest path — weighted-DAG path enumeration + min agg. ;; ── Demo 1: federation follow graph ───────────────────────────── ;; EDB: (follows ACTOR-A ACTOR-B) — A follows B.