For Inform, a phrase is an arbitrary set of words, so it does not try to conjugate them (it doesn’t realise that your phrase is a verb with a subject and an object).
In addition to what has bee said above, I think it’s also possible just to add a not, like in conventional programming languages.
if not (x attacks y):
I believe the parentheses are mandatory not to confuse Inform. And it’s not really natural-language-ish, but sometimes that’s OK, right?
I just tested to be sure and it does seem to work, but only with the parentheses, as I said.
If I understand correctly, it’s not defined in the Standard Rules, but directly in Inform’s syntax. (See <s-condition-atomic> in Syntax.preform).
The PDF describing the English syntax says about it:
The syntax for the logical operation “not” is more complicated, because it only sometimes work by simply preceding the text with “not”. Consider this, for instance:
if not we are carrying the torch, ...
(and the it goes on on explaining why it’s complicated.)
Thanks everyone for the discussion. It gave me a lot of stuff to try. I was embarrassed to admit I thought of a solution like Zed’s, but it didn’t seem super-elegant.
It doesn’t need to be, of course. It just needs to be clear.
Oops … I didn’t quite mean it that way. I was actually relieved to see that this was probably the best solution given the situation. With Inform’s natural language, it feels like there should be something snazzy. It makes me feel better about other times my Inform code didn’t quite read like poetry. I suppose we should save the poetry for the game text.
I7 does offer a way to associate neatly conjugatable and negatable verbs with a condition.
Combat relates a person (called p1) to a person (called p2) when p1 is alice and p2 is the player.
The verb to attack means the combat relation.
alice is a person.
alice is in the lab.
bob is a person.
bob is in the lab.
when play begins:
if alice is attacking the player, say "Et tu, Alice?";
if alice does not attack the player, say "Thanks, Alice.";
if bob is not attacking the player, say "help!";