rewritten to C++: is_transitive