Singular Manual: boolean expressions

1. | ### 4.6.5 boolean expressions A boolean expression is an int expression used in a logical context: An int expression <> 0 evaluates to TRUE (represented by 1), 0 evaluates to FALSE (represented by 0). The following is the list of available comparisons of objects of the same type. Note: There are no comparisons for ideals and modules, resolutions and maps. integer comparisons:
         i == j
         i != j    // or     i <> j
         i <= j
         i >= j
         i > j
         i < j
2. number comparisons:
         m == n
         m != n    // or     m <> n
         m < n
         m > n
         m <= n
         m >= n
3. For numbers from Z/p or from field extensions not all operations are useful: - 0 is always the smallest element, - in Z/p the representatives in the range -(p-1)/2..(p-1)/2 when p>2 resp. 0 and 1 for p=2 are used for comparisons, - in field extensions the last two operations (`>=,<=`) yield always TRUE (1) and the `<` and `>` are equivalent to `!=`. polynomial or vector comparisons:
         f == g
         f != g    // or     f <> g
         f <= g    // comparing the leading term w.r.t. the monomial order
         f <  g
         f >= g
         f >  g
4. intmat or matrix comparisons:
         v == w
         v != w    // or     v <> w
5. intvec or string comparisons:
         f == g
         f != g    // or     f <> g
         f <= g    // comparing lexicographically
         f >= g    // w.r.t. the order specified by ASCII
         f >  g
         f <  g
boolean expressions combined by boolean operations (`and`, `or`, `not`) Note: All arguments of a logical expression are first evaluated and then the value of the logical expression is determined. For example, the logical expression `(a || b)` is evaluated by first evaluating `a` and `b`, even though the value of `b` has no influence on the value of `(a || b)`, if `a` evaluates to true. Note that this evaluation is different from the left-to-right, conditional evaluation of logical expressions (as found in most programming languages). For example, in these other languages, the value of `(1 || b)` is determined without ever evaluating `b`. See Major differences to the C programming language.

User manual for Singular version 4.3.2, 2023, generated by texi2html.