pub struct MemoizedInferenceEngine { /* private fields */ }Expand description
Memoized inference engine with query caching
Implementations§
Source§impl MemoizedInferenceEngine
impl MemoizedInferenceEngine
Sourcepub fn new(cache: Arc<CacheManager>) -> Self
pub fn new(cache: Arc<CacheManager>) -> Self
Create a new memoized inference engine
Sourcepub fn with_limits(
max_depth: usize,
max_solutions: usize,
cache: Arc<CacheManager>,
) -> Self
pub fn with_limits( max_depth: usize, max_solutions: usize, cache: Arc<CacheManager>, ) -> Self
Create with custom inference limits
Sourcepub fn query(
&self,
goal: &Predicate,
kb: &KnowledgeBase,
) -> Result<Vec<Substitution>>
pub fn query( &self, goal: &Predicate, kb: &KnowledgeBase, ) -> Result<Vec<Substitution>>
Query with memoization
Sourcepub fn prove(
&self,
goal: &Predicate,
kb: &KnowledgeBase,
) -> Result<Option<Proof>>
pub fn prove( &self, goal: &Predicate, kb: &KnowledgeBase, ) -> Result<Option<Proof>>
Prove with memoization
Sourcepub fn cache_stats(&self) -> CombinedCacheStats
pub fn cache_stats(&self) -> CombinedCacheStats
Get cache statistics
Sourcepub fn clear_cache(&self)
pub fn clear_cache(&self)
Clear the cache
Auto Trait Implementations§
impl Freeze for MemoizedInferenceEngine
impl !RefUnwindSafe for MemoizedInferenceEngine
impl Send for MemoizedInferenceEngine
impl Sync for MemoizedInferenceEngine
impl Unpin for MemoizedInferenceEngine
impl !UnwindSafe for MemoizedInferenceEngine
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more