Learning Abstractions for Planning