Wrote transitive_relation.pl