Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000079Core InformModel worldpublic2010-06-20 16:522010-07-01 23:07
Assigned Tograham 
Platformx86OSWindowsOS Version7
Product Version6E59 
Target VersionFixed in Version6E72 
Summary0000079: "[a list of ...]" lists the wrong objects when kind negation is involved
DescriptionThe code below prints "yourself, a plate, a cupboard and a baseball" - a list of all things in the game.
Minimal Source Text To Reproduce
Kitchen is a room.

A closed openable container called a cupboard is in Kitchen.

A baseball is in the cupboard.
A dish is kind of thing.
The player carries a plate. The plate is a dish.

When play begins: say "in the cupboard (not dishes): [a list of things in the cupboard which are 
not dishes]."
Additional InformationThe intended effect is to print a list of all non-dish things inside the cupboard: "a baseball".

If we use this description in a list, we can see from the predicate calculus that I7 actually interprets it as asking for a list of all things inside the cupboard-which-is-not-a-dish: [ thing(x) & NOT[ dish('cupboard') NOT] & is('cupboard', ContainerOf(x)) ]

However, the baseball is the only thing inside the cupboard, so we should still see "a baseball". The culprit is the condition generated inside the objectloop for the "[a list of...]" phrase:

    if (((subst__v ofclass K2_thing) && ~~((O30_cupboard ofclass K32_dish)) && (O30_cupboard == ContainerOf(subst__v))))

Under Inform 6's precedence rules, ~~ binds more loosely than &&, so the condition is parsed as:

    if (subst__v ofclass K2_thing && ~~(O30_cupboard ofclass K32_dish && O30_cupboard == ContainerOf(subst__v)))

Since the negated part is never true, every thing ends up marked for listing.
TagsNo tags attached.
Effect(serious/mild) Game compiles but misbehaves
Attached Files

- Relationships

-  Notes
graham (administrator)
2010-06-20 17:19

An impeccably diagnosed bug. Fixed.

(Though "a list of things in the cupboard which are not dishes" actually doesn't do what you think, because it associates not being a dish with the cupboard, not the things. So the correct result of this is the list of things in the cupboard.)

- Issue History
Date Modified Username Field Change
2010-06-20 16:52 jmcgrew New Issue
2010-06-20 16:52 jmcgrew Reporter jmcgrew => Al
2010-06-20 16:52 jmcgrew Status new => confirmed
2010-06-20 17:19 graham Note Added: 0000103
2010-06-20 17:19 graham Status confirmed => resolved
2010-06-20 17:19 graham Resolution open => fixed
2010-06-20 17:19 graham Assigned To => graham
2010-06-30 18:07 jmcgrew Fixed in Version => 6E72
2010-07-01 23:07 jmcgrew Status resolved => closed

Copyright © 2000 - 2010 MantisBT Group
Powered by Mantis Bugtracker