Overview of subroutines and reserved words



There is a range of built-in functions and procedures available in Mosel. They are described fully in the Mosel Language Reference Manual. Here is a summary.

Modules

The distribution of Mosel contains several modules that add extra functionality to the language.

A full list of the functionality of a module can be obtained by using Mosel's exam command, for instance

mosel -c "exam mmsystem"

In this manual, we always use Xpress-Optimizer as solver. Access to the corresponding optimization functions is provided by the module mmxprs.

In the mmxprs module are the following useful functions.

For example, here is a nice habit to get into when solving a problem with the Xpress-MP Optimizer.

declarations
  status:array({XPRS_OPT,XPRS_UNF,XPRS_INF,XPRS_UNB,XPRS_OTH}) of string
end-declarations

status::([XPRS_OPT,XPRS_UNF,XPRS_INF,XPRS_UNB,XPRS_OTH])[
          "Optimum found","Unfinished","Infeasible","Unbounded","Failed"]
...
minimize(Obj)
writeln(status(getprobstat))

In the mmsystem module are various useful functions provided by the underlying operating system and a few programming utilities :

Other modules mentioned in this manual are mmodbc and mmetc.

See the module reference manuals for full details.

Reserved words

The following words are reserved in Mosel. The upper case versions are also reserved (i.e. AND and and are keywords but not And). Do not use them in a model except with their built-in meaning.

and, array, as
boolean, break
case
declarations, div, do, dynamic
elif, else, end
false, forall, forward, from, function
if, import, in, include, initialisations, initializations, integer, inter,
is_binary, is_continuous, is_free, is_integer, is_partint, is_semcont,
is_semint, is_sos1, is_sos2
linctr, list
max, min, mod, model, mpvar
next, not
of, options, or
package, parameters, procedure, public, prod
range, real, record, repeat, requirements
set, string, sum
then, to, true
union, until, uses
version
while



If you have any comments or suggestions about these pages, please send mail to docs@dashoptimization.com.