fpsemigroup::KnuthBendix

class KnuthBendix : public libsemigroups::FpSemigroupInterface

Defined in knuth-bendix.hpp.

On this page we describe the functionality relating to the Knuth-Bendix algorithm for semigroups and monoids that is available in libsemigroups. This page contains a details of the member functions of the class libsemigroups::fpsemigroup::KnuthBendix.

This class is used to represent a string rewriting system defining a finitely presented monoid or semigroup.

See

libsemigroups::congruence::KnuthBendix.

Example

KnuthBendix kb;
kb.set_alphabet("abc");

kb.add_rule("aaaa", "a");
kb.add_rule("bbbb", "b");
kb.add_rule("cccc", "c");
kb.add_rule("abab", "aaa");
kb.add_rule("bcbc", "bbb");

!kb.confluent();       // true
kb.run();
kb.nr_active_rules();  // 31
kb.confluent();        // true