Skip to content

Mountainash Rules

An intelligent textbook for the mountainash-rules vectorized backend-agnostic business rules engine.

Open textbook

Chapters

  1. Foundation Concepts
  2. Match Strategies
  3. Dimension Model
  4. Dimension Compiler
  5. Expression Rules Engine
  6. Expression Engine Results
  7. Accumulator Compiler
  8. Accumulator Engine
  9. Lattice Structures and Results

Key Topics

  • Dimension model -- Dimension class with 11 MatchStrategy types and DimensionRole enum for declarative, Pydantic-validated rule table structure
  • Expression rules engine -- single-pass vectorized evaluation pipeline with DimensionCompiler, context extraction, and backend-agnostic operation
  • Accumulator engine -- prime encoding for combination identity, lattice building phases (partition, anchor, expand, frontier filter), and accumulated aggregates
  • Ternary logic evaluation -- three-valued semantics (TRUE/FALSE/UNKNOWN) with specificity scoring, survivor ranking, and best-match selection
  • Backend portability -- rules evaluated as tabular data using mountainash expressions, portable across Polars, Narwhals, and Ibis backends