def state_utility(ufuncs, state):
    """computes utility for a state"""
    utility = 0
    for attr, value in state.items():
        if attr in ufuncs:
            utility += ufuncs[attr](state[attr])
    return utility
