def is_valid_modification_of_V_s(included_variables: list, excluded_variables: list, V_s: dict) -> bool:
    """
    When considering an update to a set V_u under construction, by including a set of variables
    that must be included in the final form of V_s, and a set of variables that must not be
    included, this function helps determine wether that is compatible with the contents of V_s that
    have already been established before. For example, if we want to include the variable B_0 in
    V_s but that variable was already flagged for exclusion when considering a previous monomial,
    this function will return False.
    
    :param included_variables: List of variables we would like to include in V_s, such as [B_0, C_2].
    
    :param excluded_variables: List of variables we would not want to put in V_s, because that will
        may no longer change the sign of a previously seen monomial. E.g.: [D_1].
        
    :param V_s: Configuration of V_s so far, stating which variables will be included in the final set,
        and which ones can not be included, according to the monomials already considered. It takes
        the shape of a dictionary with the variables as keys, and a boolean value for each key,
        indicating whether that variable is included or not. Missing variables have not been
        considered yet. E.g.: {B_0: True, B_2: False, C_0: False, C_1: False, C_2: False}.
        
    :result: True if V_s can be modified as suggested, False otherwise.
    """
    
    result = True
    
    i = 0
    while result and i < len(included_variables):
        variable = included_variables[i]
        if variable in V_s and V_s[variable] is False:
            result = False
        i += 1
        
    i = 0
    while result and i < len(excluded_variables):
        variable = excluded_variables[i]
        if variable in V_s and V_s[variable] is True:
            result = False
        i += 1
        
    return result