def get_highest_priority_reachable(Sr):
    """
    Sr: The remaining unconsidered part of the original solution
    Return: the highest priority rule which is also reachable,
            i.e. that is to say it is in table 1. Or None if no
            rules are reachable.
    """
    reachable = [r for r in Sr if r.table == 0]
    # Sort decreasing so we get the highest priority
    reachable.sort(key=lambda x: -x.priority)
    if reachable:
        return reachable[0]
    return None