Linearize sum of piecewise linear constraints


Cross posted here, but asking a variant on this forum.

I want to write a sum of piecewise linear constraints as an LP and am hoping to compare my approach with how Convex.jl or JuMP does it.

In particular, I believe that I can express the following constraint:

c_1\max(y + |x| - d_1, 0) + c_2\max(y + |x| - d_2, 0) + e - fy \leq 0 \tag{$*$}

where x,y are scalar decision variables, and c_i, d_i, e, f \geq 0 as the set of linear constraints

c_1(y+|x| - d_1) + c_2(y + |x| - d_2) + e - fy \leq 0 \\ c_1(y+|x| - d_1) + e - fy \leq 0 \\ c_2(y + |x| - d_2) + e - fy \leq 0 \\ e - fy \leq 0

I tried looking at the actual constraints that Convex.jl is using when it parses (*) by printing problem.constraints, but but it doesn’t seem to show how it breaks down (*) into simpler constraints. Where in the source would I look, or is there a way to print off the simplified constraints (for either JuMP or Convex.jl) and see how the solvers are parsing them?