Debugging logic programs at the implementation level