19#include <toml++/toml.hpp>
20#include <unordered_map>
21#include <unordered_set>
23#define TOML_HEADER_ONLY 1
40 bool load_project(
const std::filesystem::path &filepath)
noexcept(
false);
47 [[nodiscard]]
bool save_project(
const std::filesystem::path &filepath)
const noexcept(
false);
65 [[nodiscard]] std::string_view
get_name() const noexcept {
return this->
name_; }
90 const toml::table &config,
91 std::set<State> &parsed_states,
93 std::unordered_map<std::string, State> &state_map
105 const toml::table &config,
121 const toml::table &config,
122 std::size_t tape_count,
123 const std::unordered_map<std::string, State> &state_map,
124 const std::shared_ptr<TuringMachine> &machine,
125 std::unordered_map<std::string, std::vector<std::string>> &graph
136 const std::string &start_state,
137 const std::unordered_map<std::string, std::vector<std::string>> &graph
148 const std::set<State> &parsed_states,
149 const std::unordered_set<std::string> &reachable,
150 const std::unordered_map<std::string, std::vector<std::string>> &graph
Represents the formal alphabet ( or ) of a Turing Machine.
Orchestrates configuration ingestion and state saves, abstraction layer bridging core computation wit...
std::string description_
Project description block or summary.
static bool validate_machine_structure(const std::set< State > &parsed_states, const std::unordered_set< std::string > &reachable, const std::unordered_map< std::string, std::vector< std::string > > &graph) noexcept(false)
Verifies structural integrity rules against isolated or broken nodes.
static bool parse_transitions(const toml::table &config, std::size_t tape_count, const std::unordered_map< std::string, State > &state_map, const std::shared_ptr< TuringMachine > &machine, std::unordered_map< std::string, std::vector< std::string > > &graph) noexcept(false)
Decodes the matrix table containing legal execution step pathways.
bool parse_metadata(const toml::table &config) noexcept
Extracts project identification block from TOML file.
static bool parse_alphabets(const toml::table &config, Alphabet &input_alpha, Alphabet &tape_alpha) noexcept(false)
Validates and builds formal inclusion alphabets (Sigma and Gamma matrices).
bool load_project(const std::filesystem::path &filepath) noexcept(false)
Parses a TM configuration file using toml++ and instantiates the TuringMachine.
static std::unordered_set< std::string > compute_reachability(const std::string &start_state, const std::unordered_map< std::string, std::vector< std::string > > &graph) noexcept(false)
Computes reaching pathways from the start state over the adjacency graph via DFS.
bool has_active_machine() const noexcept
Checks if there is a valid Turing Machine instance active.
std::string_view get_name() const noexcept
Retrieves the project's friendly configuration name.
std::shared_ptr< TuringMachine > machine_
Active Turing Machine computation engine backend.
static bool parse_states(const toml::table &config, std::set< State > &parsed_states, State &initial_state, std::unordered_map< std::string, State > &state_map) noexcept(false)
Parses and instantiates structural computational states from TOML configuration array.
std::shared_ptr< TuringMachine > get_machine() noexcept
Retrieves the pointer to the active Turing Machine instance.
bool save_project(const std::filesystem::path &filepath) const noexcept(false)
Exports the current machine configuration snapshot back to a TOML file.
std::string name_
Friendly identifier extracted from config metadata.
Represents a single state in the finite set of states (Q) of the Turing Machine.