Not as far as I know -- it needs to be a function of the relevant state, and usually this is done by hand.