Generalized roof duality and bisubmodular functions