Part 21 of 39

The Compound Rule

By Madhav Kaushish · Ages 10+

Glagalbagal's rule tablets were as precise as he could make them. Seventy-one tablets, each with a condition and an action, each condition defined in terms of exact fields and comparisons. On the sixth day before his departure, the testing continued.

The Lambing Problem

Blortz presented a scenario: "The count at Location 2 dropped by twelve compared to last month."

Krothva checked the rule tablets. Tablet 1 applied: the drop exceeded ten. She prepared to dispatch a pterodactyl.

Blortz: Wait. The drop happened because it is lambing season. Twelve ewes are in the birthing pen and have been temporarily removed from the main count. They are not lost. They will return next month with lambs.

Krothva looked at Blortz, then at Tablet 1. The tablet said nothing about lambing season. It said: if the count drops by ten or more, send a pterodactyl. The count had dropped by twelve. The condition was met.

Glagalbagal: I need to add a condition. The rule should not fire during lambing season.

He re-carved Tablet 1:

If the monthly count at any location is ten or more animals fewer than the count at the same location in the immediately preceding month, AND it is NOT lambing season, send a carrier pterodactyl to Glagalbagal.

This was no longer a simple rule. It required checking two conditions — the count drop AND the season — and combining them. Glagalbagal had already solved this problem, though he did not immediately recognise it. In Part 16, he had defined AND, OR, and NOT operations on black and white pebbles for the monthly reports. The same operations worked here.

The condition "count dropped by ten or more" could be evaluated to a black pebble (yes) or white pebble (no). The condition "it is lambing season" could also be evaluated to a black or white pebble. The compound condition "count dropped AND NOT lambing season" was a Boolean expression — exactly the kind of thing his truth tables already handled.

The Evaluation Procedure

Glagalbagal formalised the process. For any compound rule, a velociraptor would:

  1. Evaluate each individual condition separately, placing a black (yes) or white (no) pebble in a small basket for that condition.
  2. Apply the Boolean operations (AND, OR, NOT) to the condition baskets, following the truth tables from Part 16.
  3. If the final result is black (yes), execute the action. If white (no), do nothing.

He rewrote several rule tablets using this format. Tablet 1 became:

Condition A: The monthly count at any location is ten or more fewer than the preceding month. Condition B: It is lambing season. Action condition: A AND (NOT B). Action: Send pterodactyl.

Tablet 3 (predator sighting) acquired its own compound version:

Condition A: A predator was sighted. Condition B: The herd count at that location exceeds fifty. Action condition: A AND B. Action: Move herd to backup area.

The reasoning behind Tablet 3's revision was Qveshna's. She had pointed out, via a curt pterodactyl message, that moving a small herd was more disruptive than the predator itself. Below fifty animals, the standard response was to post extra sentries, not relocate. Above fifty, the herd was too valuable to risk.

The Default

Blortz raised the question that had been nagging since Part 20.

Blortz: What does the velociraptor do when a situation arises and no rule's action condition evaluates to black?

Glagalbagal's initial answer was "nothing." If no rule applied, the velociraptor should continue with routine operations and wait for the next month's evaluation.

Blortz: And if the situation is genuinely urgent but falls outside every rule? A flash flood that destroys the feed storage, for instance. None of your seventy-one tablets mention floods.

Glagalbagal: I cannot anticipate every possible disaster.

Blortz: Precisely. So you need a rule for the absence of rules.

Glagalbagal added what he called Tablet Zero — a default rule that applied when no other rule's condition was met:

If no other rule tablet's action condition evaluates to black, AND the situation involves a loss of animals, property, or critical supplies, send a carrier pterodactyl to Glagalbagal describing the situation in full. Do not take independent action.

Tablet Zero was deliberately conservative. It did not tell the velociraptors to solve the problem — that required judgment they did not have. It told them to report and wait. The worst outcome was a two-week delay while the pterodactyl reached the Temple of Brvjanka and returned. The alternative — a velociraptor making an improvised decision about a flood — was worse.

A velociraptor evaluating condition baskets — small baskets with black and white pebbles representing individual conditions, feeding into a Boolean operation that produces a single result pebble

The Truth Table Review

Before departing, Glagalbagal held what he called the Tablet Review — a full day in which every rule was tested against every combination of conditions that could apply simultaneously.

For Tablet 1 (the revised version), the combinations were:

Count dropped by 10+, not lambing season: send pterodactyl. Correct. Count dropped by 10+, lambing season: do nothing. Correct — the drop is expected. Count did not drop by 10+, not lambing season: do nothing. Correct. Count did not drop by 10+, lambing season: do nothing. Correct.

Four combinations, four outcomes, all verified. This was the same truth-table approach from Part 16, but applied to business decisions rather than abstract pebble operations.

For rules with three conditions, there were eight combinations. For four conditions, sixteen. The number doubled with each new condition. A rule with six conditions would require sixty-four rows in the truth table — verifiable, but tedious. A rule with ten conditions would require over a thousand rows. Glagalbagal noted, with some discomfort, that the number of possible combinations grew far faster than the number of conditions.

Blortz: Your rules are individually simple. But the interactions between them are not.

Glagalbagal: Each rule is independent. It checks its own conditions and takes its own action.

Blortz: And if Tablet 1 and Tablet 3 both evaluate to black simultaneously? The count dropped AND a predator was sighted? One says send a pterodactyl. The other says move the herd. Do both happen? In what order? What if one action interferes with the other?

Glagalbagal had not considered this. His rules were designed as if each one operated in isolation. But the real world could trigger multiple rules at once, and the actions they prescribed might interact in ways he had not anticipated.

That was a problem for tomorrow — or, more accurately, for one day before his departure. He could feel the Grothian Desert already.