Skip to content

Commit d64fa74

Browse files
Rename validate in presentation.*pp
1 parent 9abda98 commit d64fa74

31 files changed

Lines changed: 278 additions & 223 deletions

benchmarks/bench-sims1.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -834,7 +834,7 @@ namespace libsemigroups {
834834
REQUIRE(S.size() == 81);
835835

836836
auto p = to<Presentation<word_type>>(S);
837-
p.validate();
837+
p.throw_if_bad_alphabet_or_rules();
838838
REQUIRE(p.alphabet().size() == 10);
839839
REQUIRE(presentation::length(p) == 719);
840840

include/libsemigroups/cong-class.tpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ namespace libsemigroups {
180180
return;
181181
}
182182
LIBSEMIGROUPS_EXCEPTION(
183-
"No presentation has been set, so cannot validate the word!");
183+
"No presentation has been set, so cannot check the word!");
184184
}
185185

186186
template <typename Word>

include/libsemigroups/detail/felsch-graph.tpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ namespace libsemigroups {
331331
FelschGraph<Word, Node, Definitions>&
332332
FelschGraph<Word, Node, Definitions>::private_init_from_presentation() {
333333
#ifdef LIBSEMIGROUPS_DEBUG
334-
_presentation.validate();
334+
_presentation.throw_if_bad_alphabet_or_rules();
335335
#endif
336336
size_t r = (_presentation.contains_empty_word() ? 0 : 1);
337337
size_t c = _presentation.alphabet().size();

include/libsemigroups/detail/knuth-bendix-impl.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -729,10 +729,11 @@ namespace libsemigroups {
729729
// KnuthBendixImpl - member functions for rules and rewriting - public
730730
//////////////////////////////////////////////////////////////////////////
731731

732+
// TODO(1) remove
732733
template <typename Iterator1, typename Iterator2>
733734
void throw_if_letter_out_of_bounds(Iterator1 first,
734735
Iterator2 last) const {
735-
internal_presentation().validate_word(first, last);
736+
internal_presentation().throw_if_letter_not_in_alphabet(first, last);
736737
}
737738

738739
[[nodiscard]] Presentation<std::string> const&

include/libsemigroups/detail/knuth-bendix-impl.tpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ namespace libsemigroups {
252252
KnuthBendixImpl<Rewriter, ReductionOrder>::init(
253253
congruence_kind knd,
254254
Presentation<std::string>&& p) {
255-
p.validate();
255+
p.throw_if_bad_alphabet_or_rules();
256256
init();
257257
CongruenceCommon::init(knd);
258258
_presentation = std::move(p);

include/libsemigroups/detail/todd-coxeter-impl.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,10 +363,11 @@ namespace libsemigroups {
363363
WordGraph<Node> const& wg);
364364
#endif
365365

366+
// TODO(0) remove?
366367
template <typename Iterator1, typename Iterator2>
367368
void throw_if_letter_out_of_bounds(Iterator1 first,
368369
Iterator2 last) const {
369-
internal_presentation().validate_word(first, last);
370+
internal_presentation().throw_if_letter_not_in_alphabet(first, last);
370371
}
371372

372373
////////////////////////////////////////////////////////////////////////

include/libsemigroups/kambites-class.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -786,7 +786,7 @@ namespace libsemigroups {
786786
//! \p first to \p last is out of bounds.
787787
template <typename Iterator1, typename Iterator2>
788788
void throw_if_letter_out_of_bounds(Iterator1 first, Iterator2 last) const {
789-
_presentation.validate_word(first, last);
789+
_presentation.throw_if_letter_not_in_alphabet(first, last);
790790
}
791791

792792
//! \ingroup kambites_class_init_group

include/libsemigroups/kambites-class.tpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ namespace libsemigroups {
143143
Kambites<Word>& Kambites<Word>::init(congruence_kind knd,
144144
Presentation<native_word_type>&& p) {
145145
throw_if_1_sided(knd);
146-
p.validate();
146+
p.throw_if_bad_alphabet_or_rules();
147147
init();
148148
_presentation = std::move(p);
149149
ukkonen::add_words_no_checks(
@@ -184,7 +184,7 @@ namespace libsemigroups {
184184
if (success()) {
185185
_tmp_value1.assign(first1, last1);
186186
_tmp_value2.assign(first2, last2);
187-
// Words aren't validated, the below returns false if they contain
187+
// Words aren't checked, the below returns false if they contain
188188
// letters not in the alphabet.
189189
// The Kambites class requires that input to contains to be actual
190190
// objects not iterators. This is different from KnuthBendixImpl and

include/libsemigroups/knuth-bendix-class.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,9 +260,10 @@ namespace libsemigroups {
260260
//!
261261
//! \throw LibsemigroupsException if any letter in the range from
262262
//! \p first to \p last is out of bounds.
263+
// TODO(0) remove this
263264
template <typename Iterator1, typename Iterator2>
264265
void throw_if_letter_out_of_bounds(Iterator1 first, Iterator2 last) const {
265-
presentation().validate_word(first, last);
266+
presentation().throw_if_letter_not_in_alphabet(first, last);
266267
}
267268

268269
#ifdef LIBSEMIGROUPS_PARSED_BY_DOXYGEN

include/libsemigroups/knuth-bendix-helpers.tpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ namespace libsemigroups {
241241
redundant_rule(Presentation<Word> const& p, Time t) {
242242
constexpr static congruence_kind twosided = congruence_kind::twosided;
243243

244-
p.validate();
244+
p.throw_if_bad_alphabet_or_rules();
245245
Presentation<Word> q;
246246
q.alphabet(p.alphabet());
247247
q.contains_empty_word(p.contains_empty_word());
@@ -302,7 +302,7 @@ namespace libsemigroups {
302302
// constexpr static congruence_kind twosided =
303303
// congruence_kind::twosided;
304304

305-
// // TODO(1) validate lhs and rhs
305+
// // TODO(1) throw_if_bad_alphabet_or_rules lhs and rhs
306306
// KnuthBendixImpl kb(twosided, p);
307307
// std::string lphbt = p.alphabet();
308308
// std::vector<size_t> perm(lphbt.size(), 0);
@@ -312,7 +312,7 @@ namespace libsemigroups {
312312
// detail::apply_permutation(lphbt, perm);
313313

314314
// p.alphabet(lphbt);
315-
// p.validate();
315+
// p.throw_if_bad_alphabet_or_rules();
316316

317317
// kb.init(twosided, p);
318318
// // TODO(1) no checks

0 commit comments

Comments
 (0)