Book contents¶
This book explains how to define, evaluate and combine tabular rules with Mountainash Rules. It begins with the shared rule model, covers each engine's public API, and then examines implementation and extension.
Read the shared foundations first, then follow the part for the engine you need. The implementation chapters explain how those public workflows are built and extended.
Shared foundations¶
- Two Rule Engines, One Shared Model — Column-wise evaluation, rule tables, contexts and DataFrame backends; individual rule matching compared with compatible rule combinations.
- The Shared Rule Model: Tables, Contexts and Dimensions — Dimension definitions, field mappings, types, roles and validation; metadata in YAML; expression and relation APIs.
- Matching Concepts: Strategies, Unknowns and Wildcards — Matching outcomes, comparison strategies and the treatment of unrestricted conditions and missing values.
The Expression Rules Engine¶
- Using the Expression Rules Engine — Engine construction, context evaluation, rule survival, specificity and the basic result interface.
- Expression Engine Hit Policies, Results and Explanations — Selecting among matches, inspecting decisions, explaining comparisons, and filtering or reselecting results.
- Expression Engine Batch Evaluation — Evaluating a table of requests, preserving context identity, reading per-context results, and understanding chunking and backend boundaries.
The Accumulator Engine¶
- Using the Accumulator Engine — Building compatible rule combinations, declaring aggregates and applying contexts through a worked example.
- Accumulator Lattices, Results and Routing — Inspecting combinations and provenance, routing contexts, and saving or loading lattices.
Implementation and extension¶
- Inside the Expression Rules Engine — Dimension compilation, context binding, matching, ranking and selection.
- Inside the Exact Accumulator — Source validation, normalized predicates, disjoint cells, bounded narrow state, numeric-1 folds, and strict artifact restoration.
- Extending and Maintaining Both Engines — Public boundaries, filter contracts, and the exact accumulator's source-to-runtime obligations.