Forgetting to learn logic programs