def prune_constants(constraints):
 pruned_constraints = []
 for constr in constraints:
  constr_type = type(constr)
  expr = copy.deepcopy(constr.expr)
  is_constant = prune_expr(expr)
  if is_constant:
   expr = lo.LinOp(lo.NO_OP, expr.size, [], None)
  pruned = constr_type(expr, constr.constr_id, constr.size)
  pruned_constraints.append(pruned)
 return pruned_constraints

def prune_constants ( constraints ) : pruned_constraints = [ ] for constr in constraints : constr_type = type ( constr ) expr = copy . deepcopy ( constr . expr ) is_constant = prune_expr ( expr ) if is_constant : expr = lo . LinOp ( lo . NO_OP , expr . size , [ ] , None ) pruned = constr_type ( expr , constr . constr_id , constr . size ) pruned_constraints . append ( pruned ) return pruned_constraints
returns a new list of constraints with constant terms removed .