Errata
Corrections to the first published edition of Datalevin: The Definitive Guide. Corrections listed here are also applied to the source for the website and future editions.
Chapter 9, ยง6.1: VIP silver rule
Reported: 2026-07-13
Status: Corrected in source
The published silver rule accepted a user who was either a high spender or a frequent shopper. Because a gold user satisfies both predicates, that rule also classified the user as silver.
The corrected silver rule excludes the conjunction that qualifies a user for gold:
[(vip-status ?u ?tier)
(or (is-high-spender? ?u)
(is-frequent-shopper? ?u))
(not-join [?u]
(is-high-spender? ?u)
(is-frequent-shopper? ?u))
[(ground :silver) ?tier]]
With the example data, the corrected result is:
#{["u1" :gold]
["u2" :silver]
["u3" :silver]}
