Construct piecewise functions to model a contextual situation.