(self, array, start_idx, data)
Stores either a single element or a range of elements in the array.

        :param array:     Reference to the array.
        :param start_idx: Starting index for the store.
        :param data:      Either a single value or a list of values.
Stores either a single element or a range of elements in the array.
Stores either a single element or a range of elements in the array .
def store_array_elements(self, array, start_idx, data):
        """
        Stores either a single element or a range of elements in the array.

        :param array:     Reference to the array.
        :param start_idx: Starting index for the store.
        :param data:      Either a single value or a list of values.
        """
        # we process data as a list of elements
        # => if there is only a single element, wrap it in a list
        data = data if isinstance(data, list) else [data]

        # concretize start index
        concrete_start_idxes = self.concretize_store_idx(start_idx)

        if len(concrete_start_idxes) == 1:
            # only one start index
            # => concrete store
            concrete_start_idx = concrete_start_idxes[0]
            for i, value in enumerate(data):
                self._store_array_element_on_heap(array=array,
                                                  idx=concrete_start_idx+i,
                                                  value=value,
                                                  value_type=array.element_type)
            # if the index was symbolic before concretization, this
            # constraint it to concrete start idx
            self.state.add_constraints(concrete_start_idx == start_idx)

        else:
            # multiple start indexes
            # => symbolic store
            start_idx_options = []
            for concrete_start_idx in concrete_start_idxes:
                start_idx_options.append(concrete_start_idx == start_idx)
                # we store elements condtioned with the start index:
                # => if concrete_start_idx == start_idx
                #    then store the value
                #    else keep the current value
                for i, value in enumerate(data):
                    self._store_array_element_on_heap(array=array,
                                                      idx=concrete_start_idx+i,
                                                      value=value,
                                                      value_type=array.element_type,
                                                      store_condition=start_idx_options[-1])

            # constraint start_idx, s.t. it evals to one of the concretized indexes
            constraint_on_start_idx = self.state.solver.Or(*start_idx_options)
            self.state.add_constraints(constraint_on_start_idx)
def store_array_elements ( self , array , start_idx , data ) : # we process data as a list of elements # => if there is only a single element, wrap it in a list data = data if isinstance ( data , list ) else [ data ] # concretize start index concrete_start_idxes = self . concretize_store_idx ( start_idx ) if len ( concrete_start_idxes ) == 1 : # only one start index # => concrete store concrete_start_idx = concrete_start_idxes [ 0 ] for i , value in enumerate ( data ) : self . _store_array_element_on_heap ( array = array , idx = concrete_start_idx + i , value = value , value_type = array . element_type ) # if the index was symbolic before concretization, this # constraint it to concrete start idx self . state . add_constraints ( concrete_start_idx == start_idx ) else : # multiple start indexes # => symbolic store start_idx_options = [ ] for concrete_start_idx in concrete_start_idxes : start_idx_options . append ( concrete_start_idx == start_idx ) # we store elements condtioned with the start index: # => if concrete_start_idx == start_idx #    then store the value #    else keep the current value for i , value in enumerate ( data ) : self . _store_array_element_on_heap ( array = array , idx = concrete_start_idx + i , value = value , value_type = array . element_type , store_condition = start_idx_options [ - 1 ] ) # constraint start_idx, s.t. it evals to one of the concretized indexes constraint_on_start_idx = self . state . solver . Or ( * start_idx_options ) self . state . add_constraints ( constraint_on_start_idx )