This library contains a rule engine written in Ruby. It's based on the Rete algorithm and uses a DSL to express rules in a readable way.
Word of caution
This is complex and fragile machinery, and there may be subtle bugs that are only revealed with nontrivial usage. Be conservative with upgrades, test your rules extensively, and please report any behaviour that is not consistent with your expectations.
How to use this thing?
The tutorial should get you started nicely.
The Rete implementation in this library largely follows the outline presented in [Doorenbos, 1995].
- refactored compilation code
- data overlays
- DSL methods are removed from
Objectand are available by including
- fixed a bug in evaluation of
- massively rewritten rule activation; this simplifies development and debugging and opens the road for useful features such as fully reversible custom actions
- treat this as a major upgrade and test thoroughly
- introduced the
- fixed a bug with recursive generations of multiple facts
- fixed another NCC bug
- fixed cleanup of invalidated NCC branches
- fixed interaction of filters and optional nodes
- fixed the definition of
- preventing the feedback loop introduced in 0.0.7; experimental
- added a guard against introducing variables in neg clauses
- fixed execution context of simple action block (#7)
- fixed #4 once more, better
- fixed a bug with OptionalNode (#12)
- fixed behaviour of neg nodes; this will cause feedback loops when a gen action creates a fact that invalidates the action's condition
- fixed a bug caused by retracting facts from within a rule action (#4)
- fixed a bug with multiple
asserttests following the same node (#2)
- reintegrated RDF support
- collapsible filter matchers
- bug fixes
- initial repackaged release
- Fork it
- Create your feature branch (
git checkout -b my-new-feature)
- Commit your changes (
git commit -am 'Added some feature')
- Push to the branch (
git push origin my-new-feature)
- Create new Pull Request