Merge gte/lte pairs on the identical subject into one BetweenChip,
regardless of which one appears first. A subject with only a gte, only
a lte, or more than one of either, is left as plain rules — folding
only ever removes exactly two entries and adds exactly one, never
guesses which of several candidates pairs with which.
Pairing happens in a PASS OF ITS OWN, before anything is written to
out: a single combined pass that pushed a lte immediately (because
it isn't itself a gte) and only later discovered, at its gte
partner's index, that the two pair up, would leave that lte in out
TWICE — once as the plain rule already pushed, once folded inside the
chip — so [lte(300), gte(100)] (partner before the gte that finds
it) silently produced three rules on unfold instead of two. Deciding
every pair up front means the emitting pass never has to un-push
something it already committed.
Merge
gte/ltepairs on the identical subject into oneBetweenChip, regardless of which one appears first. A subject with only agte, only alte, or more than one of either, is left as plain rules — folding only ever removes exactly two entries and adds exactly one, never guesses which of several candidates pairs with which.Pairing happens in a PASS OF ITS OWN, before anything is written to
out: a single combined pass that pushed alteimmediately (because it isn't itself agte) and only later discovered, at itsgtepartner's index, that the two pair up, would leave thatlteinoutTWICE — once as the plain rule already pushed, once folded inside the chip — so[lte(300), gte(100)](partner before thegtethat finds it) silently produced three rules on unfold instead of two. Deciding every pair up front means the emitting pass never has to un-push something it already committed.