bdd tree queries