We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5d06b1b commit 28d14c4Copy full SHA for 28d14c4
src/knuth-bendix.cpp
@@ -113,6 +113,17 @@ namespace libsemigroups {
113
R"pbdoc(
114
Default constructor.
115
)pbdoc")
116
+ .def("__repr__",
117
+ [](fpsemigroup::KnuthBendix const& kb) {
118
+ auto n = (kb.alphabet().empty()
119
+ ? "-"
120
+ : detail::to_string(kb.alphabet().size()));
121
+ auto conf = (kb.confluent() ? "" : "non-");
122
+ return std::string("<") + conf + "confluent KnuthBendix with "
123
+ + n + " letters + "
124
+ + detail::to_string(kb.number_of_active_rules())
125
+ + " active rules>";
126
+ })
127
.def(
128
"set_alphabet",
129
[](fpsemigroup::KnuthBendix& kb, std::string const& a) {
0 commit comments