Module backward

Module backward 

Source
Expand description

Backward chaining (goal-driven reasoning) - requires ‘backward-chaining’ feature

§Backward Chaining Module

Goal-driven reasoning system for rust-rule-engine. This module is only available when the backward-chaining feature is enabled.

§Overview

Backward chaining works by starting from a goal and working backwards to find rules and facts that can prove that goal.

§Example

use rust_rule_engine::backward::*;

let bc_engine = BackwardEngine::new(kb);
let result = bc_engine.query("User.IsVIP == true", &facts)?;

if result.provable {
    println!("Goal is provable!");
    println!("Proof: {:?}", result.proof_trace);
}

Re-exports§

pub use goal::Goal;
pub use goal::GoalStatus;
pub use goal::GoalManager;
pub use search::SearchStrategy;
pub use search::SearchResult;
pub use search::Solution;
pub use backward_engine::BackwardEngine;
pub use backward_engine::BackwardConfig;
pub use query::QueryResult;
pub use query::ProofTrace;
pub use grl_query::GRLQuery;
pub use grl_query::GRLQueryParser;
pub use grl_query::GRLQueryExecutor;
pub use grl_query::GRLSearchStrategy;
pub use grl_query::QueryAction;
pub use expression::Expression;
pub use expression::ExpressionParser;
pub use rule_executor::RuleExecutor;
pub use unification::Bindings;
pub use unification::Unifier;
pub use conclusion_index::ConclusionIndex;
pub use conclusion_index::IndexStats;
pub use aggregation::AggregateFunction;
pub use aggregation::AggregateQuery;
pub use aggregation::parse_aggregate_query;
pub use aggregation::apply_aggregate;
pub use proof_tree::ProofNode;
pub use proof_tree::ProofTree;
pub use proof_tree::ProofNodeType;
pub use proof_tree::ProofStats;
pub use explanation::ExplanationBuilder;
pub use explanation::Explanation;
pub use explanation::ExplanationStep;
pub use explanation::StepResult;
pub use disjunction::Disjunction;
pub use disjunction::DisjunctionResult;
pub use disjunction::DisjunctionParser;

Modules§

aggregation
Aggregation support for backward chaining queries
backward_engine
Backward chaining engine implementation
conclusion_index
Conclusion Index for efficient rule lookup in backward chaining
disjunction
Disjunction (OR) support for backward chaining queries
explanation
expression
Expression AST for backward chaining queries
goal
Goal system for backward chaining
grl_query
GRL Query Syntax Implementation
proof_tree
query
Query interface for backward chaining
rule_executor
Rule execution for backward chaining
search
Search strategies for backward chaining
unification
Unification module for backward chaining