Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000942Core InformUnderstandingpublic2012-07-16 18:562014-05-07 07:33
Reporterzarf 
Assigned Tograham 
PrioritynormalSeveritymildReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version6G60 
Target VersionFixed in Version6L02 
Summary0000942: "Understand property as describing" does not tolerate overlapping property names
DescriptionIn the test case below, the game accept "x light", "x light cube", "x blue", "x light blue cube", and other combinations of those words.

However, "x dark", "x green", "x dark green", "x green ball", and such combinations all fail to parse -- the game responds "You can't see any such thing."

The problem is that the generated parse_name routine does this:

if ((Kind_GPR_44() == GPR_NUMBER) && (self.p56_color == parsed_number)) { ... }

The GPR routine has no notion of disambiguation; it just looks at words one at a time. It happens to think that "dark" refers to dark blue, and "green" refers to light green; neither of those words can ever refer to dark green.

This can't be fixed by writing a smarter GPR routine. Ideally, the parse_name routine should call a *specific* parsing routine that checks only for the words matching self.p56_color. (This would be faster, as well.)
Minimal Source Text To Reproduce
"Test Case" by Andrew Plotkin.

The Kitchen is a room.

Color is a kind of value. The colors are light blue, dark blue, light green, dark green.

Understand "light", "blue" as light blue.
Understand "light", "green" as light green.
Understand "dark", "blue" as dark blue.
Understand "dark", "green" as dark green.

A shape is a kind of thing.
A shape has a color.
Understand the color property as describing a shape.
Before printing the name of a shape:
	say "[the color of the item described] ".

The cube is a light blue shape in the Kitchen.
The ball is a dark green shape in the Kitchen.
TagsNo tags attached.
Effect(serious/mild) Game compiles but misbehaves
Attached Files

- Relationships

-  Notes
(0001712)
zarf (developer)
2012-07-16 19:00

The author has a couple of ways to work around this, none ideal.

1:

Understand "light", "blue" as a shape when the color of the item described is light blue.
Understand "dark", "green" as a shape when the color of the item described is dark green.
[...etc...]

Tedious, and generates inefficient code.

2:

Divide the property into two properties (hue and brightness). This is okay for static properties, but when objects start changing color, you have to be careful to set both properties in sync, which is tedious.
(0002574)
graham (administrator)
2014-03-17 02:13

This now works, calling a form of specific parsing routine along the lines suggested by Zarf.

- Issue History
Date Modified Username Field Change
2012-07-16 18:56 zarf New Issue
2012-07-16 19:00 zarf Note Added: 0001712
2012-07-19 15:18 EmacsUser Status new => confirmed
2014-03-17 02:13 graham Note Added: 0002574
2014-03-17 02:14 graham Status confirmed => resolved
2014-03-17 02:14 graham Resolution open => fixed
2014-03-17 02:14 graham Assigned To => graham
2014-05-07 07:32 jmcgrew Fixed in Version => 6L02
2014-05-07 07:33 jmcgrew Status resolved => closed


Copyright © 2000 - 2010 MantisBT Group
Powered by Mantis Bugtracker