Skip to content

Chapters

This textbook is organized into 11 chapters covering the mountainash-rules vectorized, backend-agnostic business rules engine. Chapters progress from foundational concepts through the dimension model, expression rules engine, hit-policy selection semantics, and batch evaluation, then into the accumulator engine, culminating in lattice structures and result handling.

Chapter List

  • Chapter 1: Foundation Concepts — Ternary logic, sentinel values, vectorized evaluation, and the core abstractions underpinning the rules engine.
  • Chapter 2: Match Strategies — The MatchStrategy enum and all 12 strategy types for comparing dimension values against context, including the exact-key partition router and the per-row/context-level regex split.
  • Chapter 3: Dimension Model — The Dimension class, DimensionRole enum, DataType enum with temporal sentinels, YAML round-trip, DimensionsMetadata collection, field resolution, and validation.
  • Chapter 4: Dimension Compiler — Translating dimension metadata into backend-agnostic expression templates for rule evaluation, including the shared in-band set-wildcard sentinel.
  • Chapter 5: Expression Rules Engine — The ExpressionRulesEngine class and its single-pass vectorized evaluation pipeline.
  • Chapter 6: Hit Policies — The HitPolicy enum, SelectionInfo, cardinality application, and post-hoc policy re-selection over evaluation results.
  • Chapter 7: Expression Engine Results — The RuleResult class with survivor accessors, specificity filtering, explainability, and the engine-level ExplainResult.
  • Chapter 8: Batch Evaluation — Scoring many contexts against the rules table in one vectorized pass with evaluate_batch and BatchRuleResult.
  • Chapter 9: Accumulator Compiler — Compatible and coalesce expression compilation, including set-membership/set-exclusion support, for the accumulator lattice builder.
  • Chapter 10: Accumulator Engine — Prime number encoding, lattice building phases, apply-phase caching, and the frontier filter algorithm.
  • Chapter 11: Lattice Structures and Results — The Lattice class with save/load persistence, AccumulatorResult, the LatticeIndex ternary-partition router, and end-to-end workflows.