23 for (
const auto &ch : str)
37 result.reserve(this->
symbols_.size());
39 for (
const auto &sym : this->
symbols_)
41 result.push_back(sym.get_char());
54 return std::ranges::all_of(this->symbols_, [&alphabet](
const Symbol &s) {
55 return alphabet.contains(s);
Represents the formal alphabet ( or ) of a Turing Machine.
std::vector< Symbol > symbols_
The finite sequence of symbols forming the string.
std::string get_str() const noexcept(false)
Reconstructs a standard std::string representation from the underlying symbols.
bool is_valid_for(const Alphabet &alphabet) const noexcept
Validates if all symbols within this string belong to a specific formal Alphabet.
String() noexcept=default
Default constructor.
Represents a single symbol on the Turing Machine's tape.
String class representing a formal string (sequence of symbols) over an alphabet.