3 The cycle🔗ℹ

(make-engine #:rules rules) -> engine?

(engine-run! e #:max-cycles max) -> exact-nonnatural-integer?

One cycle collects every instantiation of every rule, fires exactly one, applies its actions, and repeats. The winner is chosen by the classic cascade: newest elements first (recency), then the most constants in the patterns (specificity), then declaration order. Ties keep enumeration order, so a program is deterministic given a deterministic assert order.

A right-hand side that changes nothing matches again next cycle; the #:max-cycles cap turns any such stall into a bounded, observable run instead of a hang.