Operators
- Assignment operators
-
i := 10 i += 20 ! Same as i := i + 20 i -= 5 ! Same as i := i - 5
- Assignment operators with linear constraints
-
C := 5*x + 2*y <= 20 D := C + 7*y
then D isD := 5*x + 9*y - 20
The constraint type is dropped with :=C := 5*x + 2*y <= 20 C += 7*y
then C isC := 5*x + 9*y <= 20
The constraint type is retained with +=, -= - Arithmetic operators
-
standard: + - * / power: ^ int. division/remainder: mod div sum: sum(i in 1..10) ... product: prod(i in 1..10) ... minimum/maximum: min(i in 1..10) ... count: count(i in 1..10 | isodd(i)) - Linear and non-linear expressions
-
Decision variables can be combined into linear or non-linear expressions using the arithmetic operators- module mmxprs only works with linear constraints, so no prod, min, max, ...
- other solver modules, e.g., mmquad, mmnl, mmxnlp, also accept (certain) non-linear expressions
- Logical operators
-
constants: true, false standard: and, or, not AND: and(i in 1..10) ... OR: or(i in 1..10) ... comparison: <, >, =, <>, <=, >= - Set operators
-
constants: {'A', 'B'} union: + union: union(i in 1..10) ... intersection: * intersection: inter(i in 1..10) ... difference: - - Set comparison operators
-
subset: Set1 <= Set2 superset: Set1 >= Set2 equals: Set1 = Set2 not equals: Set1 <> Set2 element of: "Oil5" in Set1 not element of: "Oil5" not in Set1 - List operators
-
constants: [1, 2, 3] concatenation: +, sum truncation: - equals: L1 = L2 not equals: L1 <> L2