Towards a Unified Framework for Learning and Reasoning