rust_rule_engine/backward/
mod.rs

1//! # Backward Chaining Module
2//!
3//! Goal-driven reasoning system for rust-rule-engine.
4//! This module is only available when the `backward-chaining` feature is enabled.
5//!
6//! ## Overview
7//!
8//! Backward chaining works by starting from a goal and working backwards
9//! to find rules and facts that can prove that goal.
10//!
11//! ## Example
12//!
13//! ```ignore
14//! use rust_rule_engine::backward::*;
15//!
16//! let bc_engine = BackwardEngine::new(kb);
17//! let result = bc_engine.query("User.IsVIP == true", &facts)?;
18//!
19//! if result.provable {
20//!     println!("Goal is provable!");
21//!     println!("Proof: {:?}", result.proof_trace);
22//! }
23//! ```
24
25pub mod aggregation;
26pub mod backward_engine;
27pub mod conclusion_index;
28pub mod disjunction;
29pub mod explanation;
30pub mod expression;
31pub mod goal;
32pub mod grl_query;
33pub mod nested;
34pub mod optimizer;
35pub mod proof_tree;
36pub mod query;
37pub mod rule_executor;
38pub mod search;
39pub mod unification;
40
41// Re-export main types
42pub use aggregation::{apply_aggregate, parse_aggregate_query, AggregateFunction, AggregateQuery};
43pub use backward_engine::{BackwardConfig, BackwardEngine};
44pub use conclusion_index::{ConclusionIndex, IndexStats};
45pub use disjunction::{Disjunction, DisjunctionParser, DisjunctionResult};
46pub use explanation::{Explanation, ExplanationBuilder, ExplanationStep, StepResult};
47pub use expression::{Expression, ExpressionParser};
48pub use goal::{Goal, GoalManager, GoalStatus};
49pub use grl_query::{GRLQuery, GRLQueryExecutor, GRLQueryParser, GRLSearchStrategy, QueryAction};
50pub use nested::{
51    NestedQuery, NestedQueryEvaluator, NestedQueryParser, NestedQueryResult, NestedQueryStats,
52    Query,
53};
54pub use optimizer::{JoinOptimizer, OptimizationStats, OptimizerConfig, QueryOptimizer};
55pub use proof_tree::{ProofNode, ProofNodeType, ProofStats, ProofTree};
56pub use query::{ProofTrace, QueryResult};
57pub use rule_executor::RuleExecutor;
58pub use search::{SearchResult, SearchStrategy, Solution};
59pub use unification::{Bindings, Unifier};