Skip to content

Commit a2acd6a

Browse files
Rename throw_if_alphabet_not_duplicate_free -> throw_if_alphabet_has_duplicates
1 parent d531d14 commit a2acd6a

2 files changed

Lines changed: 14 additions & 13 deletions

File tree

include/libsemigroups/presentation.hpp

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ namespace libsemigroups {
203203
//! any) consist of letters belonging to the alphabet.
204204
//!
205205
//! \sa
206-
//! * \ref throw_if_alphabet_not_duplicate_free
206+
//! * \ref throw_if_alphabet_has_duplicates
207207
//! * \ref throw_if_bad_rules
208208
//! * \ref throw_if_bad_alphabet_or_rules
209209
// TODO(1) Rename alphabet_size
@@ -531,9 +531,9 @@ namespace libsemigroups {
531531
//!
532532
//! \complexity
533533
//! Linear in the length of the alphabet.
534-
void throw_if_alphabet_not_duplicate_free() const {
534+
void throw_if_alphabet_has_duplicates() const {
535535
decltype(_alphabet_map) alphabet_map;
536-
throw_if_alphabet_not_duplicate_free(alphabet_map);
536+
throw_if_alphabet_has_duplicates(alphabet_map);
537537
}
538538

539539
//! \brief Check if a letter belongs to the alphabet or not.
@@ -588,22 +588,22 @@ namespace libsemigroups {
588588
//! Check if the alphabet and rules are valid.
589589
//!
590590
//! \throws LibsemigroupsException if \ref
591-
//! throw_if_alphabet_not_duplicate_free or
591+
//! throw_if_alphabet_has_duplicates or
592592
//! \ref throw_if_bad_rules does.
593593
//!
594594
//! \complexity
595595
//! Worst case \f$O(mnp)\f$ where \f$m\f$ is the length of length of the
596596
//! word, \f$n\f$ is the size of the alphabet and \f$p\f$ is the number of
597597
//! rules.
598598
void throw_if_bad_alphabet_or_rules() const {
599-
throw_if_alphabet_not_duplicate_free();
599+
throw_if_alphabet_has_duplicates();
600600
throw_if_bad_rules();
601601
}
602602

603603
private:
604604
void try_set_alphabet(decltype(_alphabet_map)& alphabet_map,
605605
word_type& old_alphabet);
606-
void throw_if_alphabet_not_duplicate_free(
606+
void throw_if_alphabet_has_duplicates(
607607
decltype(_alphabet_map)& alphabet_map) const;
608608
}; // class Presentation
609609

@@ -1581,8 +1581,9 @@ namespace libsemigroups {
15811581
//! \tparam Word the type of the words in the presentation.
15821582
//! \param p the presentation.
15831583
//!
1584-
//! \throws LibsemigroupsException if \ref throw_if_bad_alphabet_or_rules
1585-
//! throws on the initial presentation.
1584+
//! \throws LibsemigroupsException if
1585+
//! \ref Presentation::throw_if_bad_alphabet_or_rules throws on the initial
1586+
//! presentation.
15861587
template <typename Word>
15871588
void normalize_alphabet(Presentation<Word>& p);
15881589

@@ -2269,10 +2270,10 @@ namespace libsemigroups {
22692270
//! duplicate letters.
22702271
//!
22712272
//! \sa
2272-
//! * \ref Presentation<Word>::throw_if_alphabet_not_duplicate_free
2273+
//! * \ref Presentation<Word>::throw_if_alphabet_has_duplicates
22732274
//! * \ref presentation::throw_if_bad_inverses
22742275
InversePresentation& inverses(word_type const& w) {
2275-
Presentation<Word>::throw_if_alphabet_not_duplicate_free();
2276+
Presentation<Word>::throw_if_alphabet_has_duplicates();
22762277
presentation::throw_if_bad_inverses(*this, w);
22772278
return inverses_no_checks(w);
22782279
}

include/libsemigroups/presentation.tpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ namespace libsemigroups {
201201
template <typename Word>
202202
void Presentation<Word>::remove_generator(
203203
typename Presentation<Word>::letter_type x) {
204-
throw_if_alphabet_not_duplicate_free();
204+
throw_if_alphabet_has_duplicates();
205205
if (in_alphabet(x)) {
206206
remove_generator_no_checks(x);
207207
} else {
@@ -253,7 +253,7 @@ namespace libsemigroups {
253253
}
254254

255255
template <typename Word>
256-
void Presentation<Word>::throw_if_alphabet_not_duplicate_free(
256+
void Presentation<Word>::throw_if_alphabet_has_duplicates(
257257
decltype(_alphabet_map)& alphabet_map) const {
258258
LIBSEMIGROUPS_ASSERT(alphabet_map.empty());
259259
size_type index = 0;
@@ -272,7 +272,7 @@ namespace libsemigroups {
272272
Presentation<Word>::try_set_alphabet(decltype(_alphabet_map)& alphabet_map,
273273
word_type& old_alphabet) {
274274
try {
275-
throw_if_alphabet_not_duplicate_free(alphabet_map);
275+
throw_if_alphabet_has_duplicates(alphabet_map);
276276
_alphabet_map = std::move(alphabet_map);
277277
} catch (LibsemigroupsException& e) {
278278
_alphabet = std::move(old_alphabet);

0 commit comments

Comments
 (0)