Hi everybody, I have a general question that I'm not sure if it makes sense, so forgive me in case I say some blasphemy on the theoretical point of view.

Let's say that I have an optimization problem with three variables *x, y, z*, and *z* is the variable to optimize over. Suppose *x* and *y* are independent variables, and *z* depends in some way from their value. This means that, if we fix *x* and *y*, then *z* can only have one value. In other words, *z=f(x,y)* for some function *f.*

If *f* can be expressed through an arithmetic function, I can define *z* as a *dexpr*: For instance, if *z* is equal to the sum of *x* and *y* I can define *z* as

dexpr int z = x+y;

instead of defining it a variable and let the search assign its value through the propagation of the constraint *z == x+y* that I will have to define in the *subject to* block.

Now, imagine that *f* is a complex function that can't be expressed arithmetically, but it's still writable in some programming language. Think of *f* as a Java function with nested loops, complex data structures (internal array variables, queues, hashmaps, trees...) that takes as input *x* and *y* and after some iterations outputs the value of *z.*

Would it be possible, with the obvious help of the Concert API*,* to express this kind of dependency? Ideally, I would like to write something like that in my constraint model:

dvar int x, y;

dexpr int z = f(x,y);

maximize z;

Where *f**(int a, int b)* is a function defined in some context where I have access to more expressive structures than the sole arithmetic operators of OPL. Here I'm thinking of a program that uses the Concert API, but perhaps even OPL Script might do the job.

Ideas?

Regards,

Stefano