Knowledge-based and Data-driven Reasoning and Learning for Ad Hoc Teamwork