20260728 Fix a bug with "option keep_dv_eqn 1;" after a solve. E.g., var x := .5; var y = x^2 + 1; minimize zot: sin(y); solve; option keep_dv_eqn 1; solve; gave "MINOS 5.51: bad line 16 of /tmp/at190653.nl". Omit parentheses around generated names except for names that start with '=' (which are possible in the solexpand output with some settings of new option absmaxmin, described below). For example, in the output for var x >= -2 <= 1; minimize zot: <<.5;1.1,-2.7>>x; option pl_linearize 5; solexpand; you will see subject to zot@x@def: x + zot@x@lambda[0] - zot@x@lambda[2] = 0.5; instead of the previous subject to (zot@x@def): x + (zot@x@lambda)[0] - (zot@x@lambda)[2] = 0.5; Fix a bug seen in the (silly) example var x; var y = <<1,3,6;-1,1,-1,1>>x - 2; minimize zot: y^2; option keep_dv_eqn 1; in which "solve;" gave a "bad line" error message. Fix a bug seen with defined variables. Example: var x {1..4} in 0..4; var count2 = count {i in 1..3} (x[i]==i); display _varname, _var; gave a bug message about an unexpected type in dvopgen. Fix an obscure bug seen in commands following a "solve" with "option substout 1". A simple example seems hard to find. Fix a bug with composing a piece-wise linear term with another piece-wise linear term (via a defined variable) in an objective. Example: var x; var y = 3*x + 1 + <<-1;-1,1>>(x,-1); minimize f: 3*x + 1 + <<-1;-1,1>>(x,-1) + <<0;-1,1>>y); Derived from example 1.2 of Kreimeier Pokutta Walther & Woodstock (2023), p. 3 of https://optimization-online.org/wp-content/uploads/2023/03/abssmooth-fw.pdf New option absmaxmin. The default $absmaxmin = 0 causes no changes. Specifying "option absmaxmin 1" causes solvers to see several changes that can alternatively be controlled by bits in $absmaxmin - 1 when $absmaxmin > 0: if $absmaxmin = 1 or ($absmaxmin-1) mod 2 == 1, abs(...) is replaced by a piecewise-linear exprepssion, possibly involving a new variable assinged to the "..." expression by a new constraint; if $absmaxmin = 1 or ($absmaxmin-1) mod 4 >= 2 min(...) and max(...) are replaced by expressions involving abs(...), which may be further replaced by piecewise linear expressions, depending on $absmaxmin. if $absmaxmin = 1 or ($absmaxmin-1) mod 8 >= 4, nonlinear use of a piecewise-linear expression is replaced by a new variable and a new constraint that assigns the piecewise-linear expression to the new variable. The new constraint may be further modified if option pl_linearize has its default value. New option times_file giving the name of a file to which the output caused by "option times 1" and "option gentimes 1" should be written. Such output is always appended to the specified file. To start with an empty file, use a "remove" command before an "option times_file" command. Fix a bug, introduced 20250227, with a linear defined variable involving other defined variables that have a piecewise-linear term. Printing commands sometimes showed a wrong value (though "solve" was not affected). Example: var x; var y1 = <<1;1,2>>x; var y2 = <<1.5;.5,2>>x; var z = 3*x + 2*y1 + 4*y2; s.t. zot: z <= 38; let x := 2; display x, y1, y2, z; # showed a wrong value for z # (6 rather than 19) Fix more bugs with a linear defined variable having a piecewise- linear term. The following example gave Bug: bug: corrupted del_mblk arg and, after this was fixed, gave wrong values for y and f in the second ("cplex") iteration. #Inspired by example 1.2 from Kreimeier Pokutta Walther & #Woodstock (2023), p. 3 #https://optimization-online.org/wp-content/uploads/2023/03/abssmooth-fw.pdf #Assume foofa_gurobi.sol and foofa_cplex.sol are available. var x in [-100, 100]; var y = 3*x + 1 + <<-1;-1,1>>(x,-1); minimize f:0.25*(3*x + 1 + <<-1;-1,1>>(x,-1) + <<0;-1,1>>y); # f = max(0, x, 2*x+1) # f is easily simplified to max(0, 2*x+1), but that is irrelevant set Solvers; data; set Solvers = gurobi cplex ; for{s in Solvers} { solution ('foofa_' & s & '.sol'); display x, y, f; } The following variant of this example now works correctly: var x := 2; minimize f: 0.25*(3*x + 1 + abs(x+1) + abs(3*x + 1 + abs(x+1))); write gfoof0; option absmaxmin 1; write gfoof1; set Solvers; data; set Solvers = cplex gurobi knitro xpress minos; for{s in Solvers} { shell (s & ' foof0 wantsol=1'); solution foof0.sol; display x, f; shell (s & ' foof1 wantsol=1'); display x, f; }