FroidurePin

class FroidurePin

This page contains the documentation for functionality in libsemigroups_pybind11 for the Froidure-Pin algorithm. The class FroidurePin implements the Froidure-Pin algorithm as described in the article "Algorithms for computing finite semigroups" by Veronique Froidure and Jean-Eric Pin.

A FroidurePin instance is defined by a generating set, and the main method is run(), which implements the Froidure-Pin Algorithm. If run() is invoked and finished() returns True, then the size, the left and right Cayley graphs are determined, and a confluent terminating presentation for the semigroup is known.

While FroidurePin is not a class the objects returned by FroidurePin have identical methods, and so we document FroidurePin as if it was a class.

Constructors

FroidurePin.__init__()

Overloaded function.

Generators

FroidurePin.add_generator()

Add a copy of an element to the generators.

FroidurePin.add_generators()

Add collection of generators.

FroidurePin.closure()

Add non-redundant generators in collection.

FroidurePin.copy_closure()

Copy and add non-redundant generators.

FroidurePin.copy_add_generators()

Copy and add a collection of generators.

FroidurePin.number_of_generators()

Returns the number of generators.

FroidurePin.generator()

Returns the generator with specified index.

Settings

FroidurePin.batch_size()

Overloaded function.

FroidurePin.concurrency_threshold()

Overloaded function.

FroidurePin.immutable()

Overloaded function.

FroidurePin.max_threads()

Overloaded function.

FroidurePin.reserve()

Requests the given capacity for elements.

Membership + comparison

FroidurePin.contains()

Test membership of an element.

FroidurePin.current_position()

Overloaded function.

FroidurePin.position_to_sorted_position()

Returns the sorted index of an element via its index.

FroidurePin.position()

Find the position of an element with enumeration if necessary.

FroidurePin.sorted_position()

Returns the sorted index of an element.

FroidurePin.equal_to()

Check equality of words in the generators.

Accessors

FroidurePin.__iter__()

Returns an iterator pointing to the first element.

FroidurePin.at()

Access element specified by index with bound checks.

FroidurePin.current_size()

Returns the number of elements so far enumerated.

FroidurePin.size()

Returns the size.

FroidurePin.sorted_at()

Access element specified by sorted index with bound checks.

FroidurePin.sorted()

Returns an iterator pointing to the first element (sorted).

Attributes

FroidurePin.is_monoid()

Check if the semigroup is a monoid.

FroidurePin.is_finite()

Check finiteness.

FroidurePin.degree()

Returns the degree of any and all elements.

Idempotents

FroidurePin.is_idempotent()

Check if an element is an idempotent via its index.

FroidurePin.idempotents()

Returns an iterator pointing at the first idempotent.

FroidurePin.number_of_idempotents()

Returns the number of idempotents.

Cayley graphs

FroidurePin.left_cayley_graph()

Returns the left Cayley graph

FroidurePin.right_cayley_graph()

Returns the right Cayley graph

Factorisation, products, and relations

FroidurePin.current_length()

Returns the length of the short-lex least word.

FroidurePin.current_max_word_length()

Returns the maximum length of a word in the generators so far computed.

FroidurePin.current_number_of_rules()

Returns the number of relations that have been found so far.

FroidurePin.factorisation()

Overloaded function.

FroidurePin.length()

Returns the length of the short-lex least word.

FroidurePin.minimal_factorisation()

Returns a short-lex least word representing an element given by index.

FroidurePin.number_of_rules()

Returns the total number of relations in the presentation.

FroidurePin.product_by_reduction()

Compute a product using the Cayley graph.

FroidurePin.fast_product()

Multiply elements via their indices.

FroidurePin.rules()

Returns an iterator pointing to the first rule (if any).

FroidurePin.word_to_element()

Convert a word in the generators to an element.

Prefixes and suffixes

FroidurePin.final_letter()

Returns the last letter of the element with specified index.

FroidurePin.first_letter()

Returns the first letter of the element with specified index.

FroidurePin.prefix()

Returns the index of the longest proper prefix.

FroidurePin.suffix()

Returns the position of the longest proper suffix.

Running and reporting

FroidurePin.enumerate()

Enumerate until at least a specified number of elements are found.

FroidurePin.run()

Run the algorithm until it finishes.

FroidurePin.run_for()

Run for a specified amount of time.

FroidurePin.run_until()

Run until a nullary predicate returns True or finished().

FroidurePin.kill()

Stop running the algorithm (thread-safe).

FroidurePin.dead()

Check if the runner is dead.

FroidurePin.finished()

Check if the main algorithm has been run to completion or not.

FroidurePin.started()

Check if run() has been called at least once before.

FroidurePin.report()

Check if it is time to report.

FroidurePin.report_every()

Set the minimum elapsed time between reports.

FroidurePin.report_why_we_stopped()

Report why we stopped.

FroidurePin.running()

Check if currently running.

FroidurePin.timed_out()

Check if the main algorithm has or should timed out.

FroidurePin.stopped()

Check if the main algorithm has or should stop.

FroidurePin.stopped_by_predicate()

Check if the main algorithm was, or should be, stopped by the nullary predicate passed as first argument to run_until().