The InversePresentation class

For an implementation of inverse presentations for semigroups or monoids.

This class can be used to construction inverse presentations for semigroups or monoids and is intended to be used as the input to other algorithms in libsemigroups_pybind11.

This class inherits from Presentation.

Types

In what follows, we use the following pseudo-types:

  • Letter for str | int

  • Word for str | list[int]

Recall that, once a presentation has been constructed, the type of its letters and words are fixed.

Contents

InversePresentation

For an implementation of inverse presentations for semigroups or monoids.

InversePresentation.inverse(…)

Return the inverse of a letter in the alphabet.

InversePresentation.inverses(…)

Overloaded function.

InversePresentation.throw_if_bad_alphabet_rules_or_inverses(…)

Check if the InversePresentation is valid.

Full API

class InversePresentation
__init__(*args, **kwargs)

Overloaded function.

__init__(self: Presentation, word: type) None

Default constructor.

This function default constructs an uninitialised Presentation instance.

Keyword Arguments:
  • word (type) – the type of words to use. Must be either str or list[int].

__init__(self: Presentation, alphabet: str | list[int]) None

Construct a presentation from an alphabet.

This function constructs a Presentation instance with the alphabet specified by alphabet.

Parameters:

alphabet (str | list[int]) – the alphabet of the presentation.

Raises:

LibsemigroupsError – if there are duplicate letters in alphabet.

__init__(self: InversePresentation, p: Presentation) None

Construct an InversePresentation, initially with empty inverses, from a Presentation.

Parameters:

p (Presentation) – the Presentation to construct from.

inverse(self: InversePresentation, x: Letter) Letter

Return the inverse of a letter in the alphabet.

Returns the inverse of the letter x.

Parameters:

x (Letter) – the letter whose index is sought.

Returns:

the index of x.

Return type:

Letter

Raises:

LibsemigroupsError – if no inverses have been set, or if index(x) throws.

inverses(*args, **kwargs)

Overloaded function.

inverses(self: InversePresentation) Word

Return the inverse of each letter in the alphabet.

Returns the inverse of each letter in the alphabet.

Returns:

the inverses.

Return type:

Word

inverses(self: InversePresentation, w: Word) InversePresentation

Set the inverse of each letter in the alphabet.

Parameters:

w (Word) – a word containing the inverses.

Returns:

self.

Return type:

InversePresentation

Raises:

Note

Whilst the alphabet is not specified as an argument to this function, it is necessary to validate the alphabet here; a specification of inverses cannot make sense if the alphabet contains duplicate letters.

throw_if_bad_alphabet_rules_or_inverses(self: InversePresentation) None

Check if the InversePresentation is valid.

Check if the InversePresentation is valid. Specifically, check that the alphabet does not contain duplicate letters, that all rules only contain letters defined in the alphabet, and that the inverses act as semigroup inverses.

Raises: