1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#![allow(dead_code)]
#![forbid(unsafe_code)]
//! The Phreak algorithm is a Rule matching algorithm, based upon the Rete algorithm, as described
//! in the paper "Production Matching for Large Learning Systems" by Robert B. Doorenbos,
//! January 31, 1995, CMU-CS-95-113
//!
//! The algorithm is used to match facts against a number of rules to see if any combination
//! triggers the rule. A rule is called a production, and when a combination of facts matches the
//! rule, it is called an activation.
//!
//! The phreak algorithm is implemented by the Drools project. We are not trying to create a java
//! to rust port, but instead we are building an algorithm from scratch with the ideas from the
//! Drools documentation.
//!
//! We aim to use only safe rust code.
//!
//! We are trying to obtain a good performance by focusing on the following concepts:
//!  - Lazy evaluation
//!
//!    The fastest code is code you don't execute.
//!
//!  - Cache friendly evaluation
//!
//!    By grouping data evaluation, we try to optimize cache usage for the CPU.
//!
//!  - Minimize data allocations
//!
//!    Allocations are slow, so they should be avoided. We use the rust ownership model to safely
//!    pass around data instead of passing on copies.
//!
pub use crate::core::Phreak;

#[macro_use]
extern crate serde;

pub mod traits;
pub mod condition;
pub mod memory;
pub mod jointest;
pub mod segment;
pub mod actions;
pub mod betanode;
pub mod core;

mod token;
pub mod nodes;
pub mod datastructs;
pub mod predicates;