rewritten in C++: closure_transitive() + BUGFIX
removed some warnings in preorders.cpp