def prod_quality_rule_upper(m, j, k):
    expr = 0
    flow = 0
    for l in [ll for (ll, jj) in con_pool_prod if (jj == j)]:
        flow += m.y[(l, j)]
        for i in [ii for (ii, ll) in con_feed_pool if (ll == l)]:
            expr += ((feed_cons[i][k] * m.q[(i, l)]) * m.y[(l, j)])
    for i in [ii for (ii, jj) in con_feed_prod if (jj == j)]:
        flow += m.z[(i, j)]
        expr += (feed_cons[i][k] * m.z[(i, j)])
    return (expr <= (max_cons[j][k] * flow))
def prod_quality_rule_upper(m, j, k):
    expr = 0
    flow = 0
    for l in [ll for (ll, jj) in con_pool_prod if (jj == j)]:
        flow += m.y[(l, j)]
        for i in [ii for (ii, ll) in con_feed_pool if (ll == l)]:
            expr += ((feed_cons[i][k] * m.q[(i, l)]) * m.y[(l, j)])
    for i in [ii for (ii, jj) in con_feed_prod if (jj == j)]:
        flow += m.z[(i, j)]
        expr += (feed_cons[i][k] * m.z[(i, j)])
    return (expr <= (max_cons[j][k] * flow))