Recursion is the workhorse of Prometheux, and is a pattern that occurs naturally in many situations. In all recursive cases, there is:
  1. a recursive case, where a predicate is derived by itself, and
  2. a base case, which must not be derivable by itself, allowing the recursion to terminate.
Consider a graph of nodes and edges between them. A path can be defined as:
  1. A simple edge between 2 nodes.
  2. The list of such edges between any 2 nodes, via N-2 other nodes.
See how path can be a simple hop from one node to another, or requires 2 hops (via 1 intermediate node), or via 3 hops (via 2 intermediate nodes).

Transitive Closure

The task of finding out all pairs of nodes in a graph that are connected to each other either directly or indirectly is known as transitive closure. You might think of this asking if it’s possible to fly from some airport to another in one or more direct flights. Consider the following small graph: Recursion graph example
After execution, the relation path contains the following tuples:
From a, you can arrive at any other node. However, from b, you may only visit c, d, e and h.