## `Cat::CancellationAbelianMonoid` -- the category of abelian monoids with cancellation

#### Introduction

`Cat::CancellationAbelianMonoid` represents the category of abelian monoids with cancellation.

#### Generating the category

`Cat::CancellationAbelianMonoid()`

#### Categories

`Cat::AbelianMonoid`

#### Details

- A `Cat::CancellationAbelianMonoid` is an abelian monoid where the cancellation law holds according to the operation `+`, i.e. a + b = a + c implies b = c.

#### Method _subtract: subtracts two elements

- `_subtract(dom x, dom y)`
- - Must return `z` such that `x` = `y` + `z` or `FAIL` if `z` dosn't exist. The result is unique due to the cancellation law.

#### Method equal: test for equality

- `equal(dom x, dom y)`
- - Returns `TRUE` if `x` - `y` exists and is equal to zero. Returns `FAIL` if `x` - `y` returns `FAIL`.
  - The method `"iszero"` is used to test for zero.

#### Method _negate: negate element

- `_negate(dom x)`
- - Returns the opposite of `x` by computing 0 - `x` or `FAIL` if the subtraction fails.

#### Method intmult: returns integer multiple

- `intmult(dom x, DOM_INT n)`
- - Returns the `n`-fold sum of `x`. The integer `n` may also be negative. In this case the opposite of `x` is computed. If no opposite exists then `FAIL` is returned, otherwise the -`n`-fold sum of the opposite is returned.

#### Changes

- no changes

Do you have questions or comments?
Copyright © SciFace Software GmbH & Co. KG 2000