A generic approach to decomposition algorithms, with an