Learning Task Specifications from Demonstrations