libsemigroups  v3.0.0
C++ library for semigroups and monoids
All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
Loading...
Searching...
No Matches

This page contains the documentation of the various member functions of the KnuthBendix class that can be used to access the state of an instance.

Those functions with the prefix current_ do not perform any further enumeration.

Functions

auto active_rules ()
 Return a range object containing the active rules.
 
bool confluent () const
 Check confluence of the current rules.
 
bool confluent_known () const noexcept
 Check if the current system knows the state of confluence of the current rules.
 
WordGraph< uint32_t > const & gilman_graph ()
 Return the Gilman WordGraph.
 
size_t number_of_active_rules () const noexcept
 Return the current number of active rules in the KnuthBendix instance.
 
size_t number_of_inactive_rules () const noexcept
 Return the current number of inactive rules in the KnuthBendix instance.
 
size_t total_rules () const noexcept
 Return the number of rules that KnuthBendix has created.
 

Function Documentation

◆ active_rules()

template<typename Word, typename Rewriter = detail::RewriteTrie, typename ReductionOrder = ShortLexCompare>
auto active_rules ( )

This function returns a range object containing the pairs of strings which represent the rules of a KnuthBendix instance. The first entry in every such pair is greater than the second according to the reduction ordering of the KnuthBendix instance.

Returns
A range object containing the current active rules.

◆ confluent()

template<typename Rewriter = detail::RewriteTrie, typename ReductionOrder = ShortLexCompare>
bool confluent ( ) const
nodiscard

Check confluence of the current rules.

Returns
true if the KnuthBendix instance is confluent and false if it is not.

◆ confluent_known()

template<typename Rewriter = detail::RewriteTrie, typename ReductionOrder = ShortLexCompare>
bool confluent_known ( ) const
nodiscardnoexcept

Check if the current system knows the state of confluence of the current rules.

Returns
true if the confluence of the rules in the KnuthBendix instance is known, and false if it is not.

◆ gilman_graph()

template<typename Rewriter = detail::RewriteTrie, typename ReductionOrder = ShortLexCompare>
WordGraph< uint32_t > const & gilman_graph ( )

This function returns the Gilman WordGraph of the system.

The Gilman WordGraph is a digraph where the labels of the paths from the initial node (corresponding to the empty word) correspond to the shortlex normal forms of the semigroup elements.

The semigroup is finite if the graph is cyclic, and infinite otherwise.

Returns
A const reference to a WordGraph.
Exceptions
This function guarantees not to throw a LibsemigroupsException.
Warning
This will terminate when the KnuthBendix instance is reduced and confluent, which might be never.
See also
number_of_classes, and normal_forms.

◆ number_of_active_rules()

template<typename Rewriter = detail::RewriteTrie, typename ReductionOrder = ShortLexCompare>
size_t number_of_active_rules ( ) const
nodiscardnoexcept

This function returns the current number of active rules in the KnuthBendix instance.

Returns
The current number of active rules, a value of type size_t.
Exceptions
This function is noexcept and is guaranteed never to throw.
Complexity
Constant.

◆ number_of_inactive_rules()

template<typename Rewriter = detail::RewriteTrie, typename ReductionOrder = ShortLexCompare>
size_t number_of_inactive_rules ( ) const
inlinenodiscardnoexcept

This function returns the current number of inactive rules in the KnuthBendix instance.

Returns
The current number of inactive rules, a value of type size_t.
Exceptions
This function is noexcept and is guaranteed never to throw.
Complexity
Constant.

◆ total_rules()

template<typename Rewriter = detail::RewriteTrie, typename ReductionOrder = ShortLexCompare>
size_t total_rules ( ) const
inlinenodiscardnoexcept

This function returns the total number of Rule instances that have been created whilst whilst the Knuth-Bendix algorithm has been running. Note that this is not the sum of number_of_active_rules and number_of_inactive_rules, due to the re-initialisation of rules where possible.

Returns
The total number of rules, a value of type size_t.
Exceptions
This function is noexcept and is guaranteed never to throw.
Complexity
Constant.