Blog74K views2,733 votes0 replies1,949 following
Turn Prolog Recursion Into Fast, Terminating Queries with Tabling
Tabling in SWI‑Prolog memoizes recursive sub‑goals, turning non‑terminating graph queries into fast, terminating ones. A worked example shows how to declare a path predicate, the performance gains, and practical trade‑offs.