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 goal;
26pub mod search;
27pub mod backward_engine;
28pub mod query;
29pub mod grl_query;
30pub mod expression;
31pub mod rule_executor;
32pub mod unification;
33pub mod conclusion_index;
34pub mod aggregation;
35pub mod proof_tree;
36pub mod explanation;
37pub mod disjunction;
38pub mod nested;
39pub mod optimizer;
40
41// Re-export main types
42pub use goal::{Goal, GoalStatus, GoalManager};
43pub use search::{SearchStrategy, SearchResult, Solution};
44pub use backward_engine::{BackwardEngine, BackwardConfig};
45pub use query::{QueryResult, ProofTrace};
46pub use grl_query::{GRLQuery, GRLQueryParser, GRLQueryExecutor, GRLSearchStrategy, QueryAction};
47pub use expression::{Expression, ExpressionParser};
48pub use rule_executor::{RuleExecutor};
49pub use unification::{Bindings, Unifier};
50pub use conclusion_index::{ConclusionIndex, IndexStats};
51pub use aggregation::{AggregateFunction, AggregateQuery, parse_aggregate_query, apply_aggregate};
52pub use proof_tree::{ProofNode, ProofTree, ProofNodeType, ProofStats};
53pub use explanation::{ExplanationBuilder, Explanation, ExplanationStep, StepResult};
54pub use disjunction::{Disjunction, DisjunctionResult, DisjunctionParser};
55pub use nested::{NestedQuery, Query, NestedQueryResult, NestedQueryParser, NestedQueryEvaluator, NestedQueryStats};
56pub use optimizer::{QueryOptimizer, OptimizerConfig, OptimizationStats, JoinOptimizer};