Autonomous Learning of Action Models for Planning