pub struct EngineUtils;Expand description
Engine helper utilities
Implementations§
Source§impl EngineUtils
impl EngineUtils
Sourcepub fn load_program(
engine: &mut PrologEngine,
program: &str,
) -> Result<(), Vec<String>>
pub fn load_program( engine: &mut PrologEngine, program: &str, ) -> Result<(), Vec<String>>
Load a Prolog program from a string with better error reporting
Parses a multi-line Prolog program and adds clauses to the engine. Provides line-by-line error reporting for debugging.
Sourcepub fn batch_query(
engine: &mut PrologEngine,
queries: &[&str],
) -> Vec<(String, Result<Vec<Substitution>, String>)>
pub fn batch_query( engine: &mut PrologEngine, queries: &[&str], ) -> Vec<(String, Result<Vec<Substitution>, String>)>
Execute multiple queries and collect results
Runs a batch of queries against the engine and collects all results. Useful for testing or running multiple related queries.
Sourcepub fn analyze_database(engine: &PrologEngine) -> DatabaseAnalysis
pub fn analyze_database(engine: &PrologEngine) -> DatabaseAnalysis
Get detailed statistics about the engine’s database
Analyzes the clauses in the engine to provide insights about the program structure, complexity, and characteristics.
Sourcepub fn extract_query_variables(query: &str) -> Vec<String>
pub fn extract_query_variables(query: &str) -> Vec<String>
Extract variable names from a query string
Parses a query string to find all variable names (uppercase identifiers). This is useful for determining which variables to display in results.
Auto Trait Implementations§
impl Freeze for EngineUtils
impl RefUnwindSafe for EngineUtils
impl Send for EngineUtils
impl Sync for EngineUtils
impl Unpin for EngineUtils
impl UnwindSafe for EngineUtils
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more