A derivation of local composition expressions from partition functions