def applyReplacements(symbol_list):
    """
    Apply the rules associated with each symbol to the symbols in
     `symbol_list`. Symbols with no defined rule are returned as-is.

    The elements of `symbol_list` must be subclasses of Symbol.

    Returns a tuple of (`replaced`, `new_symbol_list`) where `replaced` is
    True if any symbols had triggered a replacement rule, and
    `new_symbol_list` is the new list after applying all replacement rules.
    If `replaced` is False, `new_symbol_list` should be identical to
    `symbol_list`

    :param symbol_list:
    :type symbol_list: list[Symbol]
    :return:
    :rtype: (bool, list[Symbol])
    """
    replaced = False
    new_list = []
    for symbol in symbol_list:
        if hasattr(symbol, 'replace'):
            replaced = True
            new_symbols = symbol.replace()
            new_list.extend(new_symbols)
        else:
            new_list.append(symbol)

    return replaced, new_list