On the design and implementation of a top-down datalog interpreter in C++