Learning logic programs through divide, constrain, and conquer