From model-based learning to model-free behaviour with Meta-Interpretive Learning