General AMPL functions, as described in the slides that you reference, are not yet available. At this point, we do not have a definite date for releasing a beta version that willgeneral functions. Any beta release that does become available will be announced on this forum.
For your example, you have a simple piecewise-linear function, with slope 1 on [0,b] and slope -1 on [b,2b]. Thus if you have defined "var a >= 0, <= 2*b;", then you can use AMPL's
piecewise-linear notation to write this function as
<<b; 1,-1>> a
Concerning your other question, if your cases are different files of data for the same model, you can read the files in a loop; see the example with "set CASES" on
page 273 of the AMPL book. If your cases are models that have different combinations of constraints, they can be defined as different
named problems that you can switch between by using "problem" statements. If neither of these options offers what you are looking for, then I suggest opening a new thread in this forum with a more specific question about cases.