|
MTMS main
Modern Turing Machine Simulator
|
Orchestrates configuration ingestion and state saves, abstraction layer bridging core computation with external interfaces (CLI/GUI). More...
#include <project.hpp>
Public Member Functions | |
| std::shared_ptr< TuringMachine > | get_machine () noexcept |
| Retrieves the pointer to the active Turing Machine instance. | |
| std::string_view | get_name () const noexcept |
| Retrieves the project's friendly configuration name. | |
| bool | has_active_machine () const noexcept |
| Checks if there is a valid Turing Machine instance active. | |
| bool | load_project (const std::filesystem::path &filepath) noexcept(false) |
| Parses a TM configuration file using toml++ and instantiates the TuringMachine. | |
| Project () noexcept | |
| bool | save_project (const std::filesystem::path &filepath) const noexcept(false) |
| Exports the current machine configuration snapshot back to a TOML file. | |
Private Member Functions | |
| bool | parse_metadata (const toml::table &config) noexcept |
| Extracts project identification block from TOML file. | |
Static Private Member Functions | |
| 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. | |
| 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). | |
| 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. | |
| 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. | |
| 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. | |
Private Attributes | |
| std::string | description_ |
| Project description block or summary. | |
| std::shared_ptr< TuringMachine > | machine_ |
| Active Turing Machine computation engine backend. | |
| std::string | name_ |
| Friendly identifier extracted from config metadata. | |
Orchestrates configuration ingestion and state saves, abstraction layer bridging core computation with external interfaces (CLI/GUI).
Definition at line 30 of file project.hpp.
|
inlinenoexcept |
Definition at line 33 of file project.hpp.
|
staticprivate |
Computes reaching pathways from the start state over the adjacency graph via DFS.
| start_state | The initial root label node token to start traversal. |
| graph | The static structural matrix tracker. |
Definition at line 203 of file project.cpp.
|
inlinenoexcept |
Retrieves the pointer to the active Turing Machine instance.
Definition at line 59 of file project.hpp.
References machine_.
Referenced by main().
|
inlinenoexcept |
Retrieves the project's friendly configuration name.
Definition at line 65 of file project.hpp.
References name_.
|
inlinenoexcept |
Checks if there is a valid Turing Machine instance active.
Definition at line 53 of file project.hpp.
References machine_.
| bool Project::load_project | ( | const std::filesystem::path & | filepath | ) |
Parses a TM configuration file using toml++ and instantiates the TuringMachine.
| filepath | Path to the target validation .toml file. |
Definition at line 265 of file project.cpp.
References Alphabet::contains().
Referenced by main().
|
staticprivate |
Validates and builds formal inclusion alphabets (Sigma and Gamma matrices).
| config | Reference to the parsed TOML table structure. |
| input_alpha | Output destination reference holding the parsed Sigma symbols subset. |
| tape_alpha | Output destination reference holding the parsed Gamma symbols subset. |
Definition at line 62 of file project.cpp.
References Symbol::get_char(), and kBlank.
|
privatenoexcept |
Extracts project identification block from TOML file.
| config | Reference to the loaded TOML table root structure. |
Definition at line 20 of file project.cpp.
|
staticprivate |
Parses and instantiates structural computational states from TOML configuration array.
| config | Reference to the parsed TOML table structure. |
| parsed_states | Target unique set to populate with active valid states. |
| initial_state | Output wrapper reference pointing to the set's verified initial state node. |
| state_map | Reference dictionary mapping text state keys to object values for sub-routine lookup. |
Definition at line 27 of file project.cpp.
|
staticprivate |
Decodes the matrix table containing legal execution step pathways.
| config | Reference to the parsed TOML table structure. |
| tape_count | Dimensional bounds required per sub-array alignment. |
| state_map | Internal registry to cross-reference mapped text nodes against objects. |
| machine | Shared pointer to the active Turing Machine instance to populate with transitions. |
| graph | Adjacency map tracker built to accelerate structural connectivity queries. |
Definition at line 107 of file project.cpp.
| bool Project::save_project | ( | const std::filesystem::path & | filepath | ) | const |
Exports the current machine configuration snapshot back to a TOML file.
| filepath | Output path footprint. |
Definition at line 331 of file project.cpp.
Referenced by main().
|
staticprivate |
Verifies structural integrity rules against isolated or broken nodes.
| parsed_states | Unique set containing every configured state object. |
| reachable | Evaluated cluster tracking every accessible node token. |
| graph | Structural adjacency map tracker. |
Definition at line 235 of file project.cpp.
|
private |
Project description block or summary.
Definition at line 70 of file project.hpp.
|
private |
Active Turing Machine computation engine backend.
Definition at line 68 of file project.hpp.
Referenced by get_machine(), and has_active_machine().
|
private |
Friendly identifier extracted from config metadata.
Definition at line 69 of file project.hpp.
Referenced by get_name().