Text this: Tractability-preserving transformations of global cost functions.