A General Branch-and-Bound Formulation for AND/OR Graph and Game Tree Search