Great …
The transitive closure example could be a great jump off point for tabling – and to understand why you want the recursive call – which without tabling goes into an infinite loop – to be happening as soon as possible – to make the code more efficient.