The Konieczny class
The class Konieczny
implements Konieczny’s algorithm as described
in Konieczny’s article [Kon94]. This algorithm is similar to
that of Lallement and McFadden from [LM90]. It differs in
being applicable to subsemigroups of a non-regular semigroup, though is
essentially the same algorithm for elements which happen to be regular. A
Konieczny
instance is defined by a generating set, and the main
function is Runner.run
, which implements Konieczny’s Algorithm. If
Runner.run
is invoked and Runner.finished
returns True
, then
the size, partial order of \(\mathscr{D}\)-classes, and frames for each
\(\mathscr{D}\)-class are known.
See also
Konieczny.DClass
and Runner
.
Contents
The class |
|
Add a copy of an element to the generators. |
|
Add collection of generators from a list. |
|
Test membership of an element. |
|
Copy a Konieczny. |
|
Returns an iterator yielding the \(\mathscr{D}\)-classes. |
|
Returns the current number of \(\mathscr{D}\)-classes. |
|
Returns the current number of \(\mathscr{H}\)-classes. |
|
Returns the current number of \(\mathscr{L}\)-classes. |
|
Returns the current number of regular \(\mathscr{R}\)-classes. |
|
Returns the current number of idempotents. |
|
Returns the current number of regular \(\mathscr{D}\)-classes |
|
Returns the current number of regular \(\mathscr{L}\)-classes. |
|
Returns the current number of regular \(\mathscr{R}\)-classes. |
|
Returns the current number of regular elements. |
|
Returns an iterator yielding the so-far enumerated regular \(\mathscr{D}\)-classes of a |
|
Returns the current size. |
|
Returns the degree of elements. |
|
Returns the generator given by an index. |
|
Returns an iterator yielding the generators of a |
|
Initialize an existing Runner object. |
|
Test regularity of an element. |
|
Returns the number of \(\mathscr{D}\)-classes. |
|
Returns the number of \(\mathscr{H}\)-classes. |
|
Returns the number of \(\mathscr{L}\)-classes. |
|
Returns the number of \(\mathscr{R}\)-classes. |
|
Returns the number of generators. |
|
Returns the number of idempotents. |
|
Returns the number of regular \(\mathscr{D}\)-classes. |
|
Returns the number of regular \(\mathscr{L}\)-classes. |
|
Returns the number of regular \(\mathscr{R}\)-classes. |
|
Returns the number of regular elements. |
|
Returns the size. |
Full API
- class Konieczny
- __init__(self: Konieczny, gens: list[Element]) None
Construct from generators.
This function constructs a
Konieczny
instance generated by the specified container of generators. There can be duplicate generators and although they do not count as distinct elements, they do count as distinct generators. In other words, the generators are precisely (a copy of) gens in the same order they occur in gens.- Parameters:
gens (list[Element]) – the generators represented by this.
- Raises:
LibsemigroupsError – if gens is empty.
LibsemigroupsError – if the items in gens do not all have the same degree.
- D_class_of_element(self: Konieczny, x: Element) Konieczny.DClass
Returns the \(\mathscr{D}\)-class containing an element.
- Parameters:
x (Element) – a possible element.
- Returns:
The
Konieczny.DClass
containing x.- Return type:
- Raises:
LibsemigroupsError – if x does not belong to self.
- D_classes(self: Konieczny) collections.abc.Iterator[Konieczny.DClass]
Returns an iterator yielding the \(\mathscr{D}\)-classes of a
Konieczny
object. This function triggers a full enumeration.- Returns:
An iterator yielding \(\mathscr{D}\)-classes.
- Return type:
- add_generator(self: Konieczny, gen: Element) Konieczny
Add a copy of an element to the generators.
It is possible, if perhaps not desirable, to add the same generator multiple times.
- Parameters:
gen (Element) – the generator to add.
- Returns:
self.
- Return type:
- Raises:
LibsemigroupsError – if the degree of x is incompatible with the existing degree.
LibsemigroupsError – if
started
returnsTrue
.
- add_generators(self: Konieczny, coll: list[Element]) Konieczny
Add collection of generators from a list.
See
Konieczny.add_generator
for a detailed description.- Parameters:
coll (list[Element]) – the collection of generators to add.
- Returns:
self.
- Return type:
- Raises:
LibsemigroupsError – the degree of any item in coll is incompatible with the existing degree (if any).
LibsemigroupsError –
started
returnsTrue
.
- contains(self: Konieczny, x: Element) bool
Test membership of an element.
Returns
True
if x belongs to self andFalse
if it does not.
- current_D_classes(self: Konieczny) collections.abc.Iterator[Konieczny.DClass]
Returns an iterator yielding the \(\mathscr{D}\)-classes.
This function does not trigger any enumeration; the iterator returned may be invalidated by any call to a non-const member function of the
Konieczny
class.- Returns:
An iterator.
- Return type:
- current_number_of_D_classes(self: Konieczny) int
Returns the current number of \(\mathscr{D}\)-classes.
- Returns:
The number of \(\mathscr{D}\)-classes so far enumerated.
- Return type:
- current_number_of_H_classes(self: Konieczny) int
Returns the current number of \(\mathscr{H}\)-classes.
- Returns:
The number of \(\mathscr{H}\)-classes so far enumerated.
- Return type:
- current_number_of_L_classes(self: Konieczny) int
Returns the current number of \(\mathscr{L}\)-classes.
- Returns:
The number of \(\mathscr{L}\)-classes so far enumerated.
- Return type:
- current_number_of_R_classes(self: Konieczny) int
Returns the current number of regular \(\mathscr{R}\)-classes.
- Returns:
The number of \(\mathscr{L}\)-classes so far enumerated.
- Return type:
- current_number_of_idempotents(self: Konieczny) int
Returns the current number of idempotents.
- Returns:
The number of idempotents so far enumerated.
- Return type:
- current_number_of_regular_D_classes(self: Konieczny) int
Returns the current number of regular \(\mathscr{D}\)-classes
- Returns:
The number of regular \(\mathscr{D}\)-classes so far enumerated.
- Return type:
- current_number_of_regular_L_classes(self: Konieczny) int
Returns the current number of regular \(\mathscr{L}\)-classes.
- Returns:
The number of regular \(\mathscr{L}\)-classes so far enumerated.
- Return type:
- current_number_of_regular_R_classes(self: Konieczny) int
Returns the current number of regular \(\mathscr{R}\)-classes.
- Returns:
The number of regular \(\mathscr{R}\)-classes so far enumerated.
- Return type:
- current_number_of_regular_elements(self: Konieczny) int
Returns the current number of regular elements.
- Returns:
The number of regular elements so far enumerated.
- Return type:
- current_regular_D_classes(self: Konieczny) collections.abc.Iterator[Konieczny.DClass]
Returns an iterator yielding the so-far enumerated regular \(\mathscr{D}\)-classes of a
Konieczny
object. This function does not trigger any enumeration; the iterator returned may be invalidated by any call to a non-const member function of theKonieczny
class.- Returns:
An iterator yielding regular \(\mathscr{D}\)-classes.
- Return type:
- current_size(self: Konieczny) int
Returns the current size.
- Returns:
The number of elements so far enumerated.
- Return type:
See also
- degree(self: Konieczny) int
Returns the degree of elements. All elements of a
Konieczny
must have the same degree; this function returns that degree.- Returns:
The degree of any (and all) elements.
- Return type:
- generator(self: Konieczny, pos: int) Element
Returns the generator given by an index.
This function returns the generator of self with index pos.
- Parameters:
pos (int) – the index of the generator.
- Returns:
The generator with given index.
- Return type:
Element
- Raises:
LibsemigroupsError – if the value of pos is greater than
number_of_generators()
.- Complexity:
Constant.
See also
- generators(self: Konieczny) collections.abc.Iterator[Konieczny.DClass]
Returns an iterator yielding the generators of a
Konieczny
object. This function does not trigger any enumeration; the iterator returned may be invalidated by any call to a non-const member function of theKonieczny
class.- Returns:
An iterator yielding the generators.
- Return type:
- init(self: Runner) Runner
Initialize an existing Runner object.
This function puts a
Runner
object back into the same state as if it had been newly default constructed.- Returns:
self.
- Return type:
See also
- is_regular_element(self: Konieczny, x: Element) bool
Test regularity of an element.
This function returns
True
if x is a regular element andFalse
if it is not.- Parameters:
x (Element) – a possible element.
- Returns:
Whether or not x belongs to self.
- Return type:
- number_of_D_classes(self: Konieczny) int
Returns the number of \(\mathscr{D}\)-classes.
- Returns:
The number of \(\mathscr{D}\)-classes.
- Return type:
- number_of_H_classes(self: Konieczny) int
Returns the number of \(\mathscr{H}\)-classes.
- Returns:
The number of \(\mathscr{H}\)-classes.
- Return type:
- number_of_L_classes(self: Konieczny) int
Returns the number of \(\mathscr{L}\)-classes.
- Returns:
The number of \(\mathscr{L}\)-classes.
- Return type:
- number_of_R_classes(self: Konieczny) int
Returns the number of \(\mathscr{R}\)-classes.
- Returns:
The number of \(\mathscr{R}\)-classes.
- Return type:
- number_of_generators(self: Konieczny) int
Returns the number of generators.
This function returns the number of generators given to self. Note that there may be duplicate generators, and so self may have more generators than unique generators.
- Returns:
The number of generators.
- Return type:
See also
- number_of_idempotents(self: Konieczny) int
Returns the number of idempotents.
- Returns:
The number of idempotents.
- Return type:
- number_of_regular_D_classes(self: Konieczny) int
Returns the number of regular \(\mathscr{D}\)-classes.
- Returns:
The number of regular \(\mathscr{D}\)-classes.
- Return type:
- number_of_regular_L_classes(self: Konieczny) int
Returns the number of regular \(\mathscr{L}\)-classes.
- Returns:
The number of regular \(\mathscr{L}\)-classes.
- Return type:
- number_of_regular_R_classes(self: Konieczny) int
Returns the number of regular \(\mathscr{R}\)-classes.
- Returns:
The number of regular \(\mathscr{R}\)-classes.
- Return type:
- number_of_regular_elements(self: Konieczny) int
Returns the number of regular elements.
- Returns:
The number of regular elements.
- Return type: