in, during, in the presence of, and when

These rule conditions always trip me up, so I tried a little experiment:

[code]“Uncertainty Principle”

The catbox is a room.

The cat is an animal in the catbox.

[
Every turn in the catbox:
say “This only compiles for actions, not Every Turn rules.”
]

Every turn during the Entire Game:
say “It is known that the entire game is happening.”

Every turn when jumping:
say “It is known that you are jumping.”

[
Every turn in the presence of the cat:
say “This also works for actions only.”
]

Every turn in the catbox when jumping:
say “It is known that you are in the catbox when jumping.”

Every turn when jumping in the catbox:
say “It is known that you are jumping in the catbox.”

Every turn when in the catbox and jumping:
say “It is known that you in the catbox and jumping.”

[
Every turn during the Entire Game when jumping:
say “This does not compile, and the error message is particularly unhelpful.”
]

Every turn when jumping during the Entire Game:
say “It is known that you are jumping during the Entire Game.”

Every turn when jumping in the presence of the cat:
say “It is known that you are jumping in the presence of the cat.”

Every turn in the presence of the cat when jumping:
say “It is known in the presence of the cat that you are jumping.”

[
Every turn during the Entire Game in the catbox:
say “This fails to compile with another unhelpful message.”
]

[
Every turn in the catbox during the Entire Game:
say “This is restricted to actions, even though ‘Every turn in the catbox when jumping’ is allowed.”
][/code]
The result is not as I expected. Maybe if I reread the documentation I’d have gotten a hint of this, but it’s certainly not intuitive: “in” and “in the presence of” require that an action be involved in the condition, although the action needn’t always be mentioned before the preposition.

“During” is even tricker. It doesn’t require an action, but it can’t be used before “when.”

Part of this starts to make sense as I think about rulebooks. The default basis of a rulebook is an action, so the syntax of [rulebook] [action] [when clause] makes sense to a certain degree. That explains some of the problems with “during,” except it doesn’t. Does “Every turn when jumping during the Entire Game” just ignore the word “when?” Does “in the catbox when jumping” count as an action description?

Why can’t “during X” be interpreted as “when X is happening” in every case? Changing any “whens” after the first one to “and” doesn’t seem like a difficult or ambiguous parsing. And why are “in X” and “in the presence of Y” restricted to actions? Can’t they always be reparsed as “when the location is X” and “when the player can see Y?” Is it because they must refer to the actor and not the player? It seems to me that interpreting “the actor” as “the player” in every case where someone else is not in the middle of an action would be perfectly safe. How is it any safer to assume that they refer to an action that is mentioned after them?

“Every turn when in the catbox” compiles, as does “Every turn when in the catbox during the Entire Game.” Could it just be that you need a “when” or a “during,” and you can’t put the “when” after the “during”? I haven’t tested most of these combinations, though.

This looks to me to be documentedish in 18.6, though from a quick scan of that I wouldn’t have expected “Every turn in the presence of the cat when jumping” to compile. Maybe someone who can decipher the Backus-Naur form can elaborate.