Transitive

A relation is transitive when it carries through chains: if Alice's boss is Bob and Bob's boss is Carol, then Carol is above Alice too. Following a relation to the end of every chain gives its transitive closure: everyone above Alice, every group a user belongs to through nested groups, every product that can stand in for another through a chain of substitutes.

In a function you compute it with a recursive walk and a visited set. In Bondy it is two derivation rules:

bondy
relation Manages(boss: String, who: String) :-
    ReportsTo(who: who, boss: boss)
relation Manages(boss: String, who: String) :-
    ReportsTo(who: mid, boss: boss), Manages(boss: mid, who: who)

The engine repeats the rules until no new fact appears, so cycles in the data are handled for you. See relation and rule.