Bi-decomposition using boolean relations