C++ and Prolog and stuff (oh my!)