Suppose we have a cat which is supposed to react to (and destroy) the most interesting thing in its environment. There are several ways we could approach this problem, but for the sake of demonstration, let's have it follow a rulebook to figure out which thing it most wants to interact with. We will then return the chosen object as "the object produced by the cat behavior rules".
Test me with "z / z / open bag / z / z".
You can see a cat, a bowl (in which is a quantity of cream), a ball of wool and a newspaper here.
The cat laps up the cream.
Good thing you have no use for the quantity of cream yourself.
The cat makes the ball of wool into a useless tangle which must be discarded.
Good thing you have no use for the ball of wool yourself.
> open bag
You open the bag, revealing catnip.
The cat frolics with the catnip until nothing remains of it.
Good thing you have no use for catnip yourself.
The cat bats playfully at the newspaper until all the nasty boring articles are destroyed.
Good thing you have no use for the newspaper yourself.
The cat looks miffed at the lack of ready entertainment, and glares at you with yellow eyes as though wondering whether your pants leg is good for claw-sharpening.
We include the if rule succeeded… condition here because nothing will be returned if the cat's search failed (as for instance in the result of the final rule).
Naturally, if we wanted we could equally well ask "if rule failed…".