let has_neighbour_MUXOrs cycle tree =
    let rec neighbours cyc first =
      match cyc with
        f::s::tail -> if is_MUXor f tree && is_MUXor s tree then true else (neighbours (s::tail) first)
      | f::tail -> if is_MUXor f tree && is_MUXor first tree then true else false
      | _ -> false
    in let x::t = cycle
    in neighbours cycle x