pub struct TensorLogicStore<S: BlockStore> { /* private fields */ }Expand description
Storage manager for TensorLogic IR
Stores terms, predicates, and rules as content-addressed blocks
Implementations§
Source§impl<S: BlockStore> TensorLogicStore<S>
impl<S: BlockStore> TensorLogicStore<S>
Sourcepub async fn store_term(&self, term: &Term) -> Result<Cid>
pub async fn store_term(&self, term: &Term) -> Result<Cid>
Store a term and return its CID
Sourcepub async fn store_predicate(&self, predicate: &Predicate) -> Result<Cid>
pub async fn store_predicate(&self, predicate: &Predicate) -> Result<Cid>
Store a predicate and return its CID
Sourcepub async fn get_predicate(&self, cid: &Cid) -> Result<Option<Predicate>>
pub async fn get_predicate(&self, cid: &Cid) -> Result<Option<Predicate>>
Retrieve a predicate by CID
Sourcepub async fn store_rule(&self, rule: &Rule) -> Result<Cid>
pub async fn store_rule(&self, rule: &Rule) -> Result<Cid>
Store a rule and return its CID
Sourcepub fn infer(&self, goal: &Predicate) -> Result<Vec<Substitution>>
pub fn infer(&self, goal: &Predicate) -> Result<Vec<Substitution>>
Run inference query on the knowledge base
Sourcepub async fn store_proof(&self, proof: &Proof) -> Result<Cid>
pub async fn store_proof(&self, proof: &Proof) -> Result<Cid>
Store a proof and return its CID
Sourcepub fn verify_proof(&self, proof: &Proof) -> Result<bool>
pub fn verify_proof(&self, proof: &Proof) -> Result<bool>
Verify that a proof is valid against the current knowledge base
Sourcepub fn kb_stats(&self) -> KnowledgeBaseStats
pub fn kb_stats(&self) -> KnowledgeBaseStats
Get knowledge base statistics
Auto Trait Implementations§
impl<S> !Freeze for TensorLogicStore<S>
impl<S> RefUnwindSafe for TensorLogicStore<S>where
S: RefUnwindSafe,
impl<S> Send for TensorLogicStore<S>
impl<S> Sync for TensorLogicStore<S>
impl<S> Unpin for TensorLogicStore<S>
impl<S> UnwindSafe for TensorLogicStore<S>where
S: RefUnwindSafe,
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