def target_reachable(env, target, state):
    """
    Return True if target is reachable in network.

    Target is reachable iff:
        1) it's on an exposed subnet
        2) it's on a compromised subnet
        3) it's on a subnet connected to a compromised subnet
    """
    network = env.network
    if network.subnet_exposed(target[0]):
        return True
    for m in env.address_space:
        if state.machine_compromised(m):
            # machine compromised
            if network.subnets_connected(m[0], target[0]):
                return True
    return False