On-line learning of unrealizable tasks