libsemigroups  v3.0.3
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 Reporter, so we don't duplicate the doc here.
509 template <typename Time>
510 void report_every(Time val) {
512 _word_graph.report_every(val);
513 }
514
515 [[nodiscard]] nanoseconds report_every() const noexcept {
516 return Reporter::report_every();
517 }
518#endif
519
536 ToddCoxeterImpl& def_max(size_t val) noexcept;
537
547 [[nodiscard]] size_t def_max() const noexcept;
548
564 ToddCoxeterImpl& def_policy(options::def_policy val);
565
578 [[nodiscard]] options::def_policy def_policy() const noexcept;
579
603 ToddCoxeterImpl& f_defs(size_t val);
604
628 [[nodiscard]] size_t f_defs() const noexcept;
629
653 ToddCoxeterImpl& hlt_defs(size_t val);
654
678 [[nodiscard]] size_t hlt_defs() const noexcept;
679
713 ToddCoxeterImpl& large_collapse(size_t val) noexcept;
714
729 [[nodiscard]] size_t large_collapse() const noexcept;
730
748 ToddCoxeterImpl& lookahead_extent(options::lookahead_extent val) noexcept;
749
763 [[nodiscard]] options::lookahead_extent lookahead_extent() const noexcept;
764
784 ToddCoxeterImpl& lookahead_growth_factor(float val);
785
797 [[nodiscard]] float lookahead_growth_factor() const noexcept;
798
818 ToddCoxeterImpl& lookahead_growth_threshold(size_t val) noexcept;
819
831 [[nodiscard]] size_t lookahead_growth_threshold() const noexcept;
832
853 ToddCoxeterImpl& lookahead_min(size_t val) noexcept;
854
868 [[nodiscard]] size_t lookahead_min() const noexcept;
869
885 ToddCoxeterImpl& lookahead_next(size_t val) noexcept;
886
899 [[nodiscard]] size_t lookahead_next() const noexcept;
900
922 ToddCoxeterImpl&
924
938
960 ToddCoxeterImpl& lookahead_stop_early_ratio(float val);
961
973 float lookahead_stop_early_ratio() const noexcept;
974
992 ToddCoxeterImpl& lookahead_style(options::lookahead_style val) noexcept;
993
1004 [[nodiscard]] options::lookahead_style lookahead_style() const noexcept;
1005
1027 ToddCoxeterImpl& lower_bound(size_t val) noexcept;
1028
1040 [[nodiscard]] size_t lower_bound() const noexcept;
1041
1057 ToddCoxeterImpl& save(bool val) noexcept;
1058
1069 [[nodiscard]] bool save() const noexcept;
1070
1085 ToddCoxeterImpl& strategy(options::strategy val) noexcept;
1086
1097 [[nodiscard]] options::strategy strategy() const noexcept;
1098
1116 ToddCoxeterImpl& use_relations_in_extra(bool val) noexcept;
1117
1130 [[nodiscard]] bool use_relations_in_extra() const noexcept;
1131
1132#ifdef LIBSEMIGROUPS_PARSED_BY_DOXYGEN
1148 ToddCoxeterImpl& def_version(options::def_version val);
1149
1162 [[nodiscard]] options::def_version def_version() const noexcept;
1163#else
1164 using FelschGraphSettings_::def_version;
1165 using FelschGraphSettings_::settings;
1166#endif
1167
1169 // 9. ToddCoxeterImpl - accessors - public
1171
1172#ifndef LIBSEMIGROUPS_PARSED_BY_DOXYGEN
1173 [[nodiscard]] Presentation<word_type> const&
1174 internal_presentation() const noexcept {
1175 return _word_graph.presentation();
1176 }
1177#endif
1178
1179 // [[nodiscard]] bool empty() const {
1180 // return (internal_presentation().rules.empty() &&
1181 // generating_pairs().empty()
1182 // && current_word_graph().number_of_nodes_active() == 1);
1183 // // FIXME(1) there's an issue where the word graph can have 0
1184 // nodes but
1185 // 1
1186 // // active node.
1187 // }
1188
1216 word_graph_type const& current_word_graph() const noexcept {
1217 return _word_graph;
1218 }
1219
1246 word_graph_type const& word_graph();
1247
1271 Forest const& current_spanning_tree() const noexcept {
1272 return _forest;
1273 }
1274
1286
1330 inline Order standardization_order() const noexcept {
1331 return _standardized;
1332 }
1333
1349 bool is_standardized(Order val) const;
1350
1364 bool is_standardized() const;
1365
1367 // 10. ToddCoxeterImpl - modifiers - public
1369
1379
1404
1420 void perform_lookahead(bool stop_early);
1421
1423 // 11. ToddCoxeterImpl - word -> index
1425
1441
1468 // NOTE: the graph contains one more node than there are element
1469 // if the underlying presentation does not contain the empty word
1470 template <typename Iterator1, typename Iterator2>
1471 index_type current_index_of_no_checks(Iterator1 first,
1472 Iterator2 last) const;
1473
1499 template <typename Iterator1, typename Iterator2>
1500 index_type current_index_of(Iterator1 first, Iterator2 last) const {
1501 throw_if_letter_not_in_alphabet(first, last);
1502 return current_index_of_no_checks(first, last);
1503 }
1504
1530 template <typename Iterator1, typename Iterator2>
1531 index_type index_of_no_checks(Iterator1 first, Iterator2 last);
1532
1558 template <typename Iterator1, typename Iterator2>
1559 index_type index_of(Iterator1 first, Iterator2 last) {
1560 throw_if_letter_not_in_alphabet(first, last);
1561 return index_of_no_checks(first, last);
1562 }
1563
1565
1567 // 12. ToddCoxeterImpl - index -> word
1569
1586
1614 // NOTE THAT: the graph contains one more node than there are element
1615 // if the underlying presentation does not contain the empty word
1616 template <typename OutputIterator>
1617 OutputIterator current_word_of_no_checks(OutputIterator d_first,
1618 index_type i) const;
1619
1645 template <typename OutputIterator>
1646 OutputIterator current_word_of(OutputIterator d_first,
1647 index_type i) const;
1648
1672 template <typename Iterator>
1673 Iterator word_of_no_checks(Iterator d_first, index_type i) {
1674 run();
1675 LIBSEMIGROUPS_ASSERT(finished());
1676 return current_word_of_no_checks(d_first, i);
1677 }
1678
1703 template <typename Iterator>
1704 Iterator word_of(Iterator d_first, index_type i) {
1705 run();
1706 LIBSEMIGROUPS_ASSERT(finished());
1707 return current_word_of(d_first, i);
1708 }
1709
1711
1712 private:
1714 // 13. Runner - pure virtual member functions - private
1716
1717 void really_run_impl();
1718
1719 void run_impl() override;
1720
1721 bool finished_impl() const override {
1722 return _finished;
1723 }
1724
1726 // 14. ToddCoxeterImpl - member functions - private
1728
1729 void copy_settings_into_graph();
1730
1731 // This function has prefix tc_ because there's already a settings
1732 // function in a base class
1733 Settings& tc_settings();
1734 Settings const& tc_settings() const;
1735
1737 // ToddCoxeterImpl - main strategies - private
1739
1740 void init_run();
1741 void finalise_run();
1742
1743 void felsch();
1744 void hlt();
1745 void CR_style();
1746 void R_over_C_style();
1747 void Cr_style();
1748 void Rc_style();
1749
1751 // ToddCoxeterImpl - reporting - private
1753
1754 void report_next_lookahead(size_t old_value) const;
1755 void report_nodes_killed(int64_t number) const;
1756
1758 // ToddCoxeterImpl - lookahead - private
1760
1761 static constexpr bool StopEarly = true;
1762 static constexpr bool DoNotStopEarly = false;
1763
1764 size_t hlt_lookahead(bool stop_early);
1765 size_t felsch_lookahead();
1766 }; // class ToddCoxeterImpl
1767
1768 } // namespace detail
1769
1770} // namespace libsemigroups
1771
1772#include "todd-coxeter-impl.tpp"
1773#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:1271
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:1216
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:1330
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:1673
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:1704
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:1500
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:1559
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