def get_x_indicator_variable_index(i, j, k, l, m, n):
    """
    Map the i,j,k,l indices to the sequential indicator variable index
    as generated by linear_objective_function_coefficients().
    This is basically the (4-dimensional) 'array equation' (as per
    row-major arrays in C for example).

    Note that for MiniSat+, the variables are juist indexed sequentially
    (from 1), and we are mapping the x_{ijkl} to x_r for
    0 <= r < m^2*n^2 variables,
    This function gets the sequential index for an x_{ijkl} variable.

    Parameters:
        i, j, k, l - indices for indicator variables as per loop in
                     linear_objective_function_coefficients()
        m - order of tableau a (0 <= i,k < m)
        n - order of tableau b (0 <= j,l < n)

    Return value:
        index r of indicator variable x_{r} as generated by
        linear_objective_function_coefficients()
        
    """
    return  ((i*n + j)*m + k)*n + l