libsemigroups  v3.0.0
C++ library for semigroups and monoids
Loading...
Searching...
No Matches
todd-coxeter-impl.hpp
1//
2// libsemigroups - C++ library for semigroups and monoids
3// Copyright (C) 2019-2025 James D. Mitchell
4//
5// This program is free software: you can redistribute it and/or modify
6// it under the terms of the GNU General Public License as published by
7// the Free Software Foundation, either version 3 of the License, or
8// (at your option) any later version.
9//
10// This program is distributed in the hope that it will be useful,
11// but WITHOUT ANY WARRANTY; without even the implied warranty of
12// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13// GNU General Public License for more details.
14//
15// You should have received a copy of the GNU General Public License
16// along with this program. If not, see <http://www.gnu.org/licenses/>.
17//
18
19// This file contains a declaration of a class for performing the Todd-Coxeter
20// algorithm for semigroups and monoids.
21//
22// TODO(1)
23// * re-implement reserve
24// * remove preferred_defs from FelschGraph etc (except where they are really
25// needed)? Or possibly reintroduce PrefDefs here
26// * re-add report why stopped
27
28#ifndef LIBSEMIGROUPS_DETAIL_TODD_COXETER_IMPL_HPP_
29#define LIBSEMIGROUPS_DETAIL_TODD_COXETER_IMPL_HPP_
30
31#include <chrono> // for nanoseconds
32#include <cstddef> // for size_t
33#include <cstdint> // for uint32_t
34#include <iterator> // for bidirect...
35#include <memory> // for unique_ptr
36#include <numeric> // for iota
37#include <string> // for string
38#include <utility> // for move, pair
39#include <vector> // for vector
40
41#include "libsemigroups/constants.hpp" // for operator!=
42#include "libsemigroups/debug.hpp" // for LIBSEMIG...
43#include "libsemigroups/forest.hpp" // for Forest
44#include "libsemigroups/order.hpp" // for Order
45#include "libsemigroups/presentation.hpp" // for Presenta...
46#include "libsemigroups/ranges.hpp" // for operator|
47#include "libsemigroups/runner.hpp" // for Reporter
48#include "libsemigroups/to-presentation.hpp" // for to_prese...
49#include "libsemigroups/types.hpp" // for word_type
50#include "libsemigroups/word-graph.hpp" // for WordGraph
51
52#include "cong-common-class.hpp" // for Congruen...
53#include "felsch-graph.hpp" // for FelschGraph
54#include "node-managed-graph.hpp" // for NodeMana...
55#include "node-manager.hpp" // for NodeMana...
56#include "word-graph-with-sources.hpp" // for WordGrap...
57
59// This file is organised as follows:
60// 0. ToddCoxeterImpl - member types - public
61// 1. ToddCoxeterImpl - nested classes - private
62// 2. ToddCoxeterImpl - data members - private
63// 3. ToddCoxeterImpl - constructors + initializers - public
64// 4. ToddCoxeterImpl - interface requirements - add_generating_pair
65// 5. ToddCoxeterImpl - interface requirements - number_of_classes
66// 6. ToddCoxeterImpl - interface requirements - contains
67// 7. ToddCoxeterImpl - interface requirements - reduce
68// 8. ToddCoxeterImpl - settings - public
69// 9. ToddCoxeterImpl - accessors - public
70// 10. ToddCoxeterImpl - modifiers - public
71// 11. ToddCoxeterImpl - word -> index
72// 12. ToddCoxeterImpl - index -> word
73// 13. Runner - pure virtual member functions - private
74// 14. ToddCoxeterImpl - member functions - private
76
77namespace libsemigroups {
78
79 // NOTE: groups are defined here because the order they are declared is the
80 // order they appear in the output doc.
81
89
104
120
130
144
156
157 namespace detail {
158 class ToddCoxeterImpl
159 : public detail::CongruenceCommon,
160 public detail::FelschGraphSettings<ToddCoxeterImpl> {
161 using FelschGraphSettings_ = FelschGraphSettings<ToddCoxeterImpl>;
162
163 public:
165 // 0. ToddCoxeterImpl - member types - public
167
168 struct options : public FelschGraphSettings_::options {
169 enum class strategy { hlt, felsch, CR, R_over_C, Cr, Rc };
170
171 enum class lookahead_extent { full, partial };
172
173 enum class lookahead_style { hlt, felsch };
174
175 enum class def_policy : uint8_t {
176 no_stack_if_no_space,
177 purge_from_top,
178 purge_all,
179 discard_all_if_no_space,
180 unlimited
181 };
182 }; // struct options
183
184 using node_type = typename WordGraph<uint32_t>::node_type;
185 using index_type = node_type;
186 using label_type = typename WordGraph<uint32_t>::label_type;
187 using native_word_type = word_type;
188
189 private:
191 // 1. ToddCoxeterImpl - nested classes - private
193
194 struct Settings;
195
196 class SettingsGuard;
197 friend class SettingsGuard;
198
199 class Definitions {
200 using Definition = std::pair<node_type, label_type>;
201
202 private:
203 bool _any_skipped;
204 std::vector<Definition> _definitions;
205 ToddCoxeterImpl const* _tc;
206
207 public:
208 Definitions() : _any_skipped(false), _definitions(), _tc(nullptr) {}
209 // TODO(1) init()
210
211 Definitions(Definitions const&) = default;
212 Definitions(Definitions&&) = default;
213 Definitions& operator=(Definitions const& that) = default;
214 Definitions& operator=(Definitions&&) = default;
215
216 // TODO(1) corresponding constructor
217 void init(ToddCoxeterImpl const* tc) {
218 _any_skipped = false;
219 _definitions.clear();
220 _tc = tc;
221 }
222
223 void emplace_back(node_type c, label_type x);
224
225 [[nodiscard]] bool any_skipped() const noexcept {
226 return _any_skipped;
227 }
228
229 [[nodiscard]] bool empty() const noexcept {
230 return _definitions.empty();
231 }
232
233 void pop(Definition& d) {
234 d = std::move(_definitions.back());
235 _definitions.pop_back();
236 }
237
238 void clear() {
239 _definitions.clear();
240 }
241
242 private:
243 bool is_active_node(node_type n) const noexcept {
244 return _tc->current_word_graph().is_active_node(n);
245 }
246 }; // class Definitions
247
248 class Graph : public detail::NodeManagedGraph<
249 detail::FelschGraph<word_type, uint32_t, Definitions>> {
250 using FelschGraph_
251 = detail::FelschGraph<word_type, uint32_t, Definitions>;
252 using NodeManagedGraph_ = NodeManagedGraph<FelschGraph_>;
253
254 public:
255 using node_type = typename NodeManagedGraph_::node_type;
256
257 Graph() = default;
258 Graph(Graph const&) = default;
259 Graph(Graph&&) = default;
260 Graph& operator=(Graph const&) = default;
261 Graph& operator=(Graph&&) = default;
262 // TODO(1) init()
263
264 Graph& operator=(WordGraph<node_type> const& wg) {
265 NodeManagedGraph_::operator=(wg);
266 return *this;
267 }
268
269 using FelschGraph_::target_no_checks;
270 using NodeManagedGraph_::NodeManagedGraph;
271
272 Graph& init();
273 // TODO(1) corresponding constructors
274 Graph& init(Presentation<word_type> const& p);
275 Graph& init(Presentation<word_type>&& p);
276
277 void process_definitions();
278
279 template <bool RegDefs>
280 void push_definition_hlt(node_type const& c,
281 word_type const& u,
282 word_type const& v);
283
284 template <typename Iterator>
285 size_t make_compatible(node_type& current,
286 Iterator first,
287 Iterator last,
288 bool stop_early,
289 std::chrono::nanoseconds stop_early_interval,
290 float stop_early_ratio);
291 }; // class Graph
292
294 // 2. ToddCoxeterImpl - data members - private
296
297 bool _finished;
298 Forest _forest;
299 std::vector<std::unique_ptr<Settings>> _settings_stack;
300 Order _standardized;
301 Graph _word_graph;
302
303 public:
304 using word_graph_type = Graph;
305
307 // 3. ToddCoxeterImpl - constructors + initializers - public
309
310 ToddCoxeterImpl();
311 ToddCoxeterImpl& init();
312
313 ToddCoxeterImpl(ToddCoxeterImpl const& that);
314 ToddCoxeterImpl(ToddCoxeterImpl&&);
315 ToddCoxeterImpl& operator=(ToddCoxeterImpl const&);
316 ToddCoxeterImpl& operator=(ToddCoxeterImpl&&);
317
318 ~ToddCoxeterImpl();
319
320 ToddCoxeterImpl(congruence_kind knd, Presentation<word_type>&& p);
321 ToddCoxeterImpl& init(congruence_kind knd, Presentation<word_type>&& p);
322 ToddCoxeterImpl(congruence_kind knd, Presentation<word_type> const& p);
323 ToddCoxeterImpl& init(congruence_kind knd,
324 Presentation<word_type> const& p);
325
326 // TODO(1) a to_todd_coxeter variant that throws if wg is not valid
327 // see below
328 template <typename Node>
329 ToddCoxeterImpl(congruence_kind knd, WordGraph<Node> const& wg)
330 : ToddCoxeterImpl() {
331 LIBSEMIGROUPS_ASSERT(!_settings_stack.empty());
332 init(knd, wg);
333 }
334
335 template <typename Node>
336 ToddCoxeterImpl& init(congruence_kind knd, WordGraph<Node> const& wg);
337
338 // TODO(1) rvalue ref WordGraph init + constructor
339
340 ToddCoxeterImpl(congruence_kind knd, ToddCoxeterImpl const& tc);
341
342 ToddCoxeterImpl& init(congruence_kind knd, ToddCoxeterImpl const& tc);
343
344 // This is a constructor and not a helper so that everything that takes a
345 // presentation has the same constructors, regardless of what they use
346 // inside.
347
348#ifndef LIBSEMIGROUPS_PARSED_BY_DOXYGEN
349 // Used in Sims
350 // TODO(1) could this and the next function be removed, and replaced
351 // with something else?
352 template <typename Node>
353 ToddCoxeterImpl(congruence_kind knd,
355 WordGraph<Node> const& wg) {
356 init(knd, p, wg);
357 }
358
359 // TODO(1) a to_todd_coxeter variant that throws if p is not valid
360 template <typename Node>
361 ToddCoxeterImpl& init(congruence_kind knd,
363 WordGraph<Node> const& wg);
364#endif
365
366 template <typename Iterator1, typename Iterator2>
367 void throw_if_letter_not_in_alphabet(Iterator1 first,
368 Iterator2 last) const {
369 internal_presentation().throw_if_letter_not_in_alphabet(first, last);
370 }
371
373 // 4. ToddCoxeterImpl - interface requirements - add_generating_pair
375
376 template <typename Iterator1,
377 typename Iterator2,
378 typename Iterator3,
379 typename Iterator4>
380 ToddCoxeterImpl& add_generating_pair_no_checks(Iterator1 first1,
381 Iterator2 last1,
382 Iterator3 first2,
383 Iterator4 last2) {
384 return detail::CongruenceCommon::add_internal_generating_pair_no_checks<
385 ToddCoxeterImpl>(first1, last1, first2, last2);
386 }
387
388 template <typename Iterator1,
389 typename Iterator2,
390 typename Iterator3,
391 typename Iterator4>
392 ToddCoxeterImpl& add_generating_pair(Iterator1 first1,
393 Iterator2 last1,
394 Iterator3 first2,
395 Iterator4 last2) {
396 return detail::CongruenceCommon::add_generating_pair<ToddCoxeterImpl>(
397 first1, last1, first2, last2);
398 }
399
401 // 5. ToddCoxeterImpl - interface requirements - number_of_classes
403
417 [[nodiscard]] uint64_t number_of_classes();
418
420 // 6. ToddCoxeterImpl - interface requirements - contains
422
423 template <typename Iterator1,
424 typename Iterator2,
425 typename Iterator3,
426 typename Iterator4>
427 tril currently_contains_no_checks(Iterator1 first1,
428 Iterator2 last1,
429 Iterator3 first2,
430 Iterator4 last2) const;
431
432 template <typename Iterator1,
433 typename Iterator2,
434 typename Iterator3,
435 typename Iterator4>
436 tril currently_contains(Iterator1 first1,
437 Iterator2 last1,
438 Iterator3 first2,
439 Iterator4 last2) const {
440 return detail::CongruenceCommon::currently_contains<ToddCoxeterImpl>(
441 first1, last1, first2, last2);
442 }
443
444 template <typename Iterator1,
445 typename Iterator2,
446 typename Iterator3,
447 typename Iterator4>
448 bool contains_no_checks(Iterator1 first1,
449 Iterator2 last1,
450 Iterator3 first2,
451 Iterator4 last2);
452
453 template <typename Iterator1,
454 typename Iterator2,
455 typename Iterator3,
456 typename Iterator4>
457 bool contains(Iterator1 first1,
458 Iterator2 last1,
459 Iterator3 first2,
460 Iterator4 last2);
461
463 // 7. ToddCoxeterImpl - interface requirements - reduce
465
466 template <typename OutputIterator,
467 typename InputIterator1,
468 typename InputIterator2>
469 OutputIterator reduce_no_run_no_checks(OutputIterator d_first,
470 InputIterator1 first,
471 InputIterator2 last) const;
472
473 template <typename OutputIterator,
474 typename InputIterator1,
475 typename InputIterator2>
476 OutputIterator reduce_no_run(OutputIterator d_first,
477 InputIterator1 first,
478 InputIterator2 last) const {
479 return detail::CongruenceCommon::reduce_no_run<ToddCoxeterImpl>(
480 d_first, first, last);
481 }
482
483 template <typename OutputIterator,
484 typename InputIterator1,
485 typename InputIterator2>
486 OutputIterator reduce_no_checks(OutputIterator d_first,
487 InputIterator1 first,
488 InputIterator2 last) {
489 return detail::CongruenceCommon::reduce_no_checks<ToddCoxeterImpl>(
490 d_first, first, last);
491 }
492
493 template <typename OutputIterator,
494 typename InputIterator1,
495 typename InputIterator2>
496 OutputIterator reduce(OutputIterator d_first,
497 InputIterator1 first,
498 InputIterator2 last) {
499 return detail::CongruenceCommon::reduce<ToddCoxeterImpl>(
500 d_first, first, last);
501 }
502
504 // 8. ToddCoxeterImpl - settings - public
506
507#ifndef LIBSEMIGROUPS_PARSED_BY_DOXYGEN
508 // This is documented in Runner, so we don't duplicate the doc here.
509 template <typename T>
510 void report_every(T val) {
512 _word_graph.report_every(val);
513 }
515#endif
516
533 ToddCoxeterImpl& def_max(size_t val) noexcept;
534
544 [[nodiscard]] size_t def_max() const noexcept;
545
561 ToddCoxeterImpl& def_policy(options::def_policy val);
562
575 [[nodiscard]] options::def_policy def_policy() const noexcept;
576
600 ToddCoxeterImpl& f_defs(size_t val);
601
625 [[nodiscard]] size_t f_defs() const noexcept;
626
650 ToddCoxeterImpl& hlt_defs(size_t val);
651
675 [[nodiscard]] size_t hlt_defs() const noexcept;
676
710 ToddCoxeterImpl& large_collapse(size_t val) noexcept;
711
726 [[nodiscard]] size_t large_collapse() const noexcept;
727
745 ToddCoxeterImpl& lookahead_extent(options::lookahead_extent val) noexcept;
746
760 [[nodiscard]] options::lookahead_extent lookahead_extent() const noexcept;
761
781 ToddCoxeterImpl& lookahead_growth_factor(float val);
782
794 [[nodiscard]] float lookahead_growth_factor() const noexcept;
795
815 ToddCoxeterImpl& lookahead_growth_threshold(size_t val) noexcept;
816
828 [[nodiscard]] size_t lookahead_growth_threshold() const noexcept;
829
850 ToddCoxeterImpl& lookahead_min(size_t val) noexcept;
851
865 [[nodiscard]] size_t lookahead_min() const noexcept;
866
882 ToddCoxeterImpl& lookahead_next(size_t val) noexcept;
883
896 [[nodiscard]] size_t lookahead_next() const noexcept;
897
919 ToddCoxeterImpl&
921
935
957 ToddCoxeterImpl& lookahead_stop_early_ratio(float val);
958
970 float lookahead_stop_early_ratio() const noexcept;
971
989 ToddCoxeterImpl& lookahead_style(options::lookahead_style val) noexcept;
990
1001 [[nodiscard]] options::lookahead_style lookahead_style() const noexcept;
1002
1024 ToddCoxeterImpl& lower_bound(size_t val) noexcept;
1025
1037 [[nodiscard]] size_t lower_bound() const noexcept;
1038
1054 ToddCoxeterImpl& save(bool val) noexcept;
1055
1066 [[nodiscard]] bool save() const noexcept;
1067
1082 ToddCoxeterImpl& strategy(options::strategy val) noexcept;
1083
1094 [[nodiscard]] options::strategy strategy() const noexcept;
1095
1113 ToddCoxeterImpl& use_relations_in_extra(bool val) noexcept;
1114
1127 [[nodiscard]] bool use_relations_in_extra() const noexcept;
1128
1129#ifdef LIBSEMIGROUPS_PARSED_BY_DOXYGEN
1145 ToddCoxeterImpl& def_version(options::def_version val);
1146
1159 [[nodiscard]] options::def_version def_version() const noexcept;
1160#else
1161 using FelschGraphSettings_::def_version;
1162 using FelschGraphSettings_::settings;
1163#endif
1164
1166 // 9. ToddCoxeterImpl - accessors - public
1168
1169#ifndef LIBSEMIGROUPS_PARSED_BY_DOXYGEN
1170 [[nodiscard]] Presentation<word_type> const&
1171 internal_presentation() const noexcept {
1172 return _word_graph.presentation();
1173 }
1174#endif
1175
1176 // [[nodiscard]] bool empty() const {
1177 // return (internal_presentation().rules.empty() &&
1178 // generating_pairs().empty()
1179 // && current_word_graph().number_of_nodes_active() == 1);
1180 // // FIXME(1) there's an issue where the word graph can have 0
1181 // nodes but
1182 // 1
1183 // // active node.
1184 // }
1185
1213 word_graph_type const& current_word_graph() const noexcept {
1214 return _word_graph;
1215 }
1216
1243 word_graph_type const& word_graph();
1244
1268 Forest const& current_spanning_tree() const noexcept {
1269 return _forest;
1270 }
1271
1283
1327 inline Order standardization_order() const noexcept {
1328 return _standardized;
1329 }
1330
1346 bool is_standardized(Order val) const;
1347
1361 bool is_standardized() const;
1362
1364 // 10. ToddCoxeterImpl - modifiers - public
1366
1376
1401
1417 void perform_lookahead(bool stop_early);
1418
1420 // 11. ToddCoxeterImpl - word -> index
1422
1438
1465 // NOTE: the graph contains one more node than there are element
1466 // if the underlying presentation does not contain the empty word
1467 template <typename Iterator1, typename Iterator2>
1468 index_type current_index_of_no_checks(Iterator1 first,
1469 Iterator2 last) const;
1470
1496 template <typename Iterator1, typename Iterator2>
1497 index_type current_index_of(Iterator1 first, Iterator2 last) const {
1498 throw_if_letter_not_in_alphabet(first, last);
1499 return current_index_of_no_checks(first, last);
1500 }
1501
1527 template <typename Iterator1, typename Iterator2>
1528 index_type index_of_no_checks(Iterator1 first, Iterator2 last);
1529
1555 template <typename Iterator1, typename Iterator2>
1556 index_type index_of(Iterator1 first, Iterator2 last) {
1557 throw_if_letter_not_in_alphabet(first, last);
1558 return index_of_no_checks(first, last);
1559 }
1560
1562
1564 // 12. ToddCoxeterImpl - index -> word
1566
1583
1611 // NOTE THAT: the graph contains one more node than there are element
1612 // if the underlying presentation does not contain the empty word
1613 template <typename OutputIterator>
1614 OutputIterator current_word_of_no_checks(OutputIterator d_first,
1615 index_type i) const;
1616
1642 template <typename OutputIterator>
1643 OutputIterator current_word_of(OutputIterator d_first,
1644 index_type i) const;
1645
1669 template <typename Iterator>
1670 Iterator word_of_no_checks(Iterator d_first, index_type i) {
1671 run();
1672 LIBSEMIGROUPS_ASSERT(finished());
1673 return current_word_of_no_checks(d_first, i);
1674 }
1675
1700 template <typename Iterator>
1701 Iterator word_of(Iterator d_first, index_type i) {
1702 run();
1703 LIBSEMIGROUPS_ASSERT(finished());
1704 return current_word_of(d_first, i);
1705 }
1706
1708
1709 private:
1711 // 13. Runner - pure virtual member functions - private
1713
1714 void really_run_impl();
1715
1716 void run_impl() override;
1717
1718 bool finished_impl() const override {
1719 return _finished;
1720 }
1721
1723 // 14. ToddCoxeterImpl - member functions - private
1725
1726 void copy_settings_into_graph();
1727
1728 // This function has prefix tc_ because there's already a settings
1729 // function in a base class
1730 Settings& tc_settings();
1731 Settings const& tc_settings() const;
1732
1734 // ToddCoxeterImpl - main strategies - private
1736
1737 void init_run();
1738 void finalise_run();
1739
1740 void felsch();
1741 void hlt();
1742 void CR_style();
1743 void R_over_C_style();
1744 void Cr_style();
1745 void Rc_style();
1746
1748 // ToddCoxeterImpl - reporting - private
1750
1751 void report_next_lookahead(size_t old_value) const;
1752 void report_nodes_killed(int64_t number) const;
1753
1755 // ToddCoxeterImpl - lookahead - private
1757
1758 static constexpr bool StopEarly = true;
1759 static constexpr bool DoNotStopEarly = false;
1760
1761 size_t hlt_lookahead(bool stop_early);
1762 size_t felsch_lookahead();
1763 }; // class ToddCoxeterImpl
1764
1765 } // namespace detail
1766
1767} // namespace libsemigroups
1768
1769#include "todd-coxeter-impl.tpp"
1770#endif // LIBSEMIGROUPS_DETAIL_TODD_COXETER_IMPL_HPP_
Class representing a collection of spanning trees of a word graph.
Definition forest.hpp:42
For an implementation of presentations for semigroups or monoids.
Definition presentation.hpp:102
nanoseconds report_every() const noexcept
Get the minimum elapsed time between reports.
Definition runner.hpp:222
std::chrono::nanoseconds nanoseconds
Alias for std::chrono::nanoseconds.
Definition runner.hpp:97
void run()
Run until finished.
bool finished() const
Check if run has been run to completion or not.
Node node_type
The type of nodes in a word graph.
Definition word-graph.hpp:98
Node label_type
The type of edge labels in a word graph.
Definition word-graph.hpp:101
Order
The possible orderings of words and strings.
Definition order.hpp:48
Presentation(Presentation< Word > const &) -> Presentation< Word >
Deduction guide.
Forest const & current_spanning_tree() const noexcept
Get the current possible spanning tree of the underlying word graph.
Definition todd-coxeter-impl.hpp:1268
Forest const & spanning_tree()
Get the spanning tree of the underlying word graph.
word_graph_type const & current_word_graph() const noexcept
Get the current word graph.
Definition todd-coxeter-impl.hpp:1213
word_graph_type const & word_graph()
Get the word graph after performing a full congruence enumeration.
bool is_standardized(Order val) const
Check if the word graph is currently standardized with respect to a given order.
Order standardization_order() const noexcept
Get the current standardization order of the underlying word graph.
Definition todd-coxeter-impl.hpp:1327
bool is_standardized() const
Check if the word graph is currently standardized with respect to any order.
OutputIterator current_word_of(OutputIterator d_first, index_type i) const
Insert a current word representing a class with given index into an output iterator.
Iterator word_of_no_checks(Iterator d_first, index_type i)
Insert the word representing a class with given index into an output iterator.
Definition todd-coxeter-impl.hpp:1670
Iterator word_of(Iterator d_first, index_type i)
Insert the word representing a class with given index into an output iterator.
Definition todd-coxeter-impl.hpp:1701
OutputIterator current_word_of_no_checks(OutputIterator d_first, index_type i) const
Insert a current word representing a class with given index into an output iterator.
uint64_t number_of_classes()
Compute the number of classes in the congruence.
void perform_lookahead(bool stop_early)
Perform a lookahead.
void shrink_to_fit()
Shrink the underlying word graph to remove all dead nodes.
bool standardize(Order val)
Standardize the current_word_graph.
options::def_version def_version() const noexcept
Get the current value of the definition version setting.
ToddCoxeterImpl & lookahead_extent(options::lookahead_extent val) noexcept
Set the lookahead extent.
ToddCoxeterImpl & lookahead_growth_factor(float val)
Set the lookahead growth factor.
ToddCoxeterImpl & lookahead_style(options::lookahead_style val) noexcept
Set the style of lookahead.
ToddCoxeterImpl & lookahead_stop_early_ratio(float val)
Set the lookahead stop early ratio.
ToddCoxeterImpl & lookahead_next(size_t val) noexcept
Set the threshold that will trigger a lookahead.
ToddCoxeterImpl & lookahead_min(size_t val) noexcept
Set the minimum value of lookahead_next.
ToddCoxeterImpl & use_relations_in_extra(bool val) noexcept
Set whether or not to perform an HLT-style push of the defining relations at the identity.
size_t def_max() const noexcept
Get the current value of the setting for the maximum number of definitions.
ToddCoxeterImpl & def_version(options::def_version val)
Set the value of the definition version setting.
ToddCoxeterImpl & lookahead_growth_threshold(size_t val) noexcept
Set the lookahead growth threshold.
ToddCoxeterImpl & strategy(options::strategy val) noexcept
Specify the congruence enumeration strategy.
ToddCoxeterImpl & def_max(size_t val) noexcept
Set the maximum number of definitions in the stack.
ToddCoxeterImpl & def_policy(options::def_policy val)
Set the definition policy.
ToddCoxeterImpl & lookahead_stop_early_interval(std::chrono::nanoseconds val) noexcept
Set the lookahead stop early interval.
ToddCoxeterImpl & save(bool val) noexcept
Set whether or not to process definitions during HLT.
ToddCoxeterImpl & f_defs(size_t val)
Set the number of Felsch style definitions in ACE strategies.
ToddCoxeterImpl & lower_bound(size_t val) noexcept
Specify the minimum number of classes that may permit any enumeration early stop.
ToddCoxeterImpl & large_collapse(size_t val) noexcept
Set the size of a large collapse.
ToddCoxeterImpl & hlt_defs(size_t val)
Set the number of HLT style definitions in ACE strategies.
index_type current_index_of(Iterator1 first, Iterator2 last) const
Returns the current index of the class containing a word.
Definition todd-coxeter-impl.hpp:1497
index_type current_index_of_no_checks(Iterator1 first, Iterator2 last) const
Returns the current index of the class containing a word.
index_type index_of_no_checks(Iterator1 first, Iterator2 last)
Returns the index of the class containing a word.
index_type index_of(Iterator1 first, Iterator2 last)
Returns the index of the class containing a word.
Definition todd-coxeter-impl.hpp:1556
std::vector< letter_type > word_type
Type for a word over the generators of a semigroup.
Definition types.hpp:101
tril
Enum to indicate true, false or not currently knowable.
Definition types.hpp:56
congruence_kind
Enum to indicate the sided-ness of a congruence.
Definition types.hpp:69
T move(T... args)
Namespace for everything in the libsemigroups library.
Definition action.hpp:44