Knowledge based error recovery in robotized assembly