Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000686Core InformSource text and punctuationpublic2011-07-02 18:072014-05-07 07:33
ReporterEmacsUser 
Assigned Tograham 
PrioritynormalSeverityseriousReproducibilityalways
StatusclosedResolutionnot fixable 
Platformx86OSMac OS XOS Version10.6
Product Version6G60 
Target VersionFixed in Version6L02 
Summary0000686: Umbrella issue: ni misses an alternative parsing of the source text
DescriptionSeveral variations on this theme are summarized in the attached source.

This report was originally just the first case; its description read:

- - - -
On the last line of the attached source the ni parser tries to match the first baz with foo and fails, but it does not try an alternative parsing—matching the second baz instead—which would succeed. The same issue seems to be at work in bugs 0000500 (``when'' wrongly matched), 0000574 (``by'' wrongly matched), 0000684 (``of'' wrongly matched), and maybe 0000599 (``in'' wrongly matched). This report might be a duplicate of any one of them.
- - - -
Minimal Source Text To Reproduce
[0000686: ``baz'' misinterpreted; brackets are a workaround: ``(bar one baz)''.]
There is a room.
To decide what number is foo (X - a number) baz (Y - a number): decide on zero.
To decide what number is bar (X - a number) baz: decide on zero.
When play begins:
	showme foo bar one baz baz two.
[In the sentence 'showme foo bar one baz baz two'  , I was expecting to read a number, but instead found 
some text that I couldn't understand - 'bar one'.
	I was trying to match this phrase:
		foo (bar one - number) baz (baz two - number) 
	This was what I found out:
		bar one = something unrecognised
		baz two = something unrecognised]

[``foo'' misinterpreted; brackets are a workaround: ``(foo yourself)''.]
There is a room.
To decide what number is foo (P - a person): decide on zero.
To decide whether foo (P - a room): decide no.
When play begins:
	if foo yourself is zero:
		do nothing.
[In the sentence 'if foo yourself is zero begin'  , I was expecting to read a description of rooms, but 
instead found some text that I couldn't understand - 'yourself is zero'.
	I was trying to match this phrase:
		foo (yourself is zero - room) 
	This was what I found out:
		yourself is zero = something unrecognised]

[0000500: ``when'' misinterpreted; brackets are not a workaround]
There is a room.
The of course rules are a rule based rulebook.
Of course for the can't exit when not inside anything rule: rule succeeds.
[You wrote 'Of course for the can't exit when not inside anything rule', but the description of the thing(s) 
to which the rule applies ('the can't exit') did not make sense. This is a rule based rulebook, so that 
should have described a rule.]

[0000574: ``by'' misinterpreted; brackets are not a workaround]
The Rocky Promontory by the Waterfall is a room.
Instead of going in the Rocky Promontory by the Waterfall: do nothing.
[In the sentence 'Instead of going in the Rocky Promontory by the Waterfall', Rocky Promontory by the 
Waterfall seems to be intended as something the player might be going by, but this has the wrong kind: 
a room rather than a thing.]

[0000876: ``in'' misinterpreted; brackets are not a workaround]
There is a room.
An attempt is a kind of object.  
An attempt can be failed, successful, in progress, or untried. 
An attempt is usually in progress.
[You wrote 'An attempt is usually in progress': but something described only by its kind should not be 
given a specific place or role in the world, to avoid ambiguity. For instance, suppose 'car' is a kind. 
Then we are not allowed to say 'a car is in the garage': there's too much risk of confusion between whether 
an individual (but nameless) car is referred to, or whether cars are generically to be found there. Sentences 
of this form are therefore prohibited, though more specific ones like 'a car called Genevieve is in the 
garage' are fine, as is the reverse, 'In the garage is a car.']

[0000599: ``in'' misinterpreted; brackets are a workaround: ``(closing arguments)'']
There is a room.
When play begins:
	let closing arguments be {1, 2};
	sort closing arguments in random order.
[In the sentence 'sort closing arguments in random order', I was expecting to read a description of values, 
but instead found some text that I couldn't understand - 'order'.
	I was trying to match this phrase:
		a/-- random (order - description of values) 
	This was what I found out:
		order = something unrecognised]

[0000684: ``of'' misinterpreted; brackets are a workaround: ``(the location of yourself)'']
There is a room.
When play begins:
	let the place be a random room which is adjacent to the location of yourself.
[In the sentence 'let the place be a random room which is adjacent to the location of yourself', I was 
expecting to read a description of directions, but instead found some text that I couldn't understand 
- 'which is adjacent to the location'.
	I was trying to match this phrase:
		room (which is adjacent to the location - direction) from/of (yourself - room) 
	This was what I found out:
		which is adjacent to the location = something unrecognised
		yourself = a person]

[0000888: ``of'' misinterpreted; brackets are a workaround: ``(description of numbers)'']
There is a room.
The interesting collection is a description of numbers that varies.
[You wrote 'The interesting collection is a description of numbers that varies'  : but this is the wrong 
way around if you want to specify a property, like saying that '10 is the score of the platinum pyramid', 
which is poor style. (Though sweet are the uses of adversity.)]

[0000861: ``inside'' misinterpreted; brackets are not a workaround, but an article is: ``the inside'']

There is a room.
A direction can be planar.
Up, down, inside, and outside are not planar.
[You wrote 'Up, down, inside, and outside are not planar': but this seems to refer to something whose 
name begins with a comma, which is forbidden. Perhaps you used a comma in punctuating a sentence? Inform 
generally doesn't like this because it reserves commas for specific purposes such as dividing rules or 
'if' phrases.]

[~1241: ``from'' misinterpreted; brackets are not a workaround]
X is a room. North is Y.
When play begins:
    try going the best route from X to Y.
[You wrote 'try going the best route from X to Y'  , but 'going the best route from X to Y' is not an 
action I can try. This looks as if it might be because it contains something of the wrong kind. My best 
try involved seeing if 'the best route' could be an object, which might have made sense, but it turned 
out to be something unrecognised.
	I was trying to match one of these phrases:
		1. try (going the best route from x to y - an action) 
		2. try (going the best route from x to y - stored action) 
	This was what I found out:
		going the best route from X to Y = something unrecognised]

[~1307 from 0000763: ``with'' misinterpreted; brackets are not a workaround]
There is a room.
Barring it with is an action applying to two objects.
The carry out barring it with rulebook has default success.
[You wrote 'The carry out barring it with rulebook has default success': but this looked to me as if 
it might be trying to create something which has certain properties, and that made no sense on investigation. 
This sometimes happens if a sentence uses 'with' a little too liberally, or to specify a never-declared 
property. For instance, 'An antique is a kind of thing with an age.' would not be the right way to declare 
the property 'age' (because it does not tell Inform what kind of value this would be). Instead, try 'An 
antique is a kind of thing. An antique has a number called age.' It would then be all right to say 'The 
Louis Quinze chair is an antique with age 241.'
	(It may help to know that I am reading the primary verb here as 'has', not 'carry'.)]

[0000991: ``to'' misinterpreted; brackets are not a workaround]
Lab is a room.
Connecting to relates one room to one room.  The verb to connect to (he connects to, they connect to, 
he connected to, it is connected to, he is connecting to) implies the connecting to relation.
[You wrote 'The verb to connect to (he connects to, they connect to, he connected to, it is connected 
to, he is connecting to) implies the connecting to relation'  : but new verbs can only be defined in 
terms of existing relations, all of which have names ending 'relation': thus '...implies the possession 
relation' is an example of a valid definition, this being one of the relations built into Inform.]

[0001159: ``to'' misinterpreted (this usage of ``to'' is a little obscure; see WI 7.8); brackets are not 
a workaround]
There is a room.
Here is a box.
Before doing something other than examining or locking to the box:
	do nothing.
Additional InformationThe other source text parsing umbrella issues are listed as related.
Tagsumbrella
Effect(serious) Compiler rejects valid code
Attached Files

- Relationships
parent of 0000500closedgraham A rule has "when" in its name, causing spurious syntax errors. 
parent of 0000599closedgraham Lists starting with the name of an action that takes a noun cannot be sorted in random order. 
parent of 0000861closedgraham Spurious errors when declaring either/or properties on the inside direction 
parent of 0000888closedgraham Inform refuses to create global variables holding a "description of K" 
parent of 0000991closedgraham can't define a relation with "to" 
related to 0000898closedgraham Umbrella issue: Inform allows duplicate names, but will only try one meaning when parsing the source text. 
related to 0000905closedgraham Compiler assumes one interpretation for ambiguous source text 

-  Notes
(0001605)
EmacsUser (manager)
2012-03-12 17:53

The boundaries for being ``related to'' this umbrella issue are growing somewhat fuzzy; apologies if reports have been excessively linked.
(0001632)
NYKevin (reporter)
2012-03-30 16:09

Does this count?

----
2 + 2 is a room.
When play begins:
Now the player is in 2 + 2;
----

If you comment out the entire "When play begins" rule, it compiles, so NI is implicitly giving its approval to the first line. Furthermore, what if it looked perfectly innocuous, but some extension had happened to define a matching phrase? cf.:

----
Include Basic Screen Effects by Emily Short.
The chosen letter is a room.
When play begins:
Now the player is in the chosen letter.
----

OTOH one might argue that if objects like this are to be allowed, NI will never be able to parse anything correctly, so it should be disallowed for the good of the language.

I'm not sure which to side with...

What we *really* need, IMAO, is proper (or indeed any) namespace support.

Anyway, this looks a lot like bugs 613 and 576, so I wasn't sure whether to file a new bug or comment on one of them (which one?), so I just brought it here. Sorry for the inconvenience.
(0001634)
EmacsUser (manager)
2012-03-30 22:28

I've tried to reorganize a bit. There are really two things happening. In the bugs now linked here, ni commits to one of several possible parse trees too early, and therefore misses a valid parse. In the bugs now linked to 0000898, it (mostly) pursues the right parse tree, but looks up a mismatched meaning for a name.
(0002546)
graham (administrator)
2014-03-09 16:06

I'm resolving the two "umbrella issues" relating to ambiguous source text because they don't in fact have any unified underlying cause, only what looks like a common symptom: most of the issues beneath them have now been fixed, but on a case by case basis.

- Issue History
Date Modified Username Field Change
2011-07-02 18:07 EmacsUser New Issue
2011-07-02 18:07 EmacsUser Relationship added related to 0000500
2011-07-02 18:07 EmacsUser Relationship added related to 0000574
2011-07-02 18:08 EmacsUser Relationship added related to 0000684
2011-07-02 18:08 EmacsUser Relationship added related to 0000599
2011-07-02 18:08 EmacsUser Relationship added related to 0000576
2011-07-02 18:08 EmacsUser Relationship added related to 0000613
2011-07-02 18:09 EmacsUser Description Updated View Revisions
2011-07-03 18:09 jmcgrew Status new => confirmed
2011-08-10 21:04 EmacsUser Note Added: 0001241
2011-08-10 21:05 EmacsUser Note Edited: 0001241 View Revisions
2011-10-02 14:36 EmacsUser Note Added: 0001307
2011-10-02 14:55 EmacsUser Note Edited: 0001307 View Revisions
2012-02-06 11:33 EmacsUser Relationship added related to 0000861
2012-03-05 12:31 EmacsUser Relationship added related to 0000876
2012-03-12 17:51 EmacsUser Relationship added related to 0000880
2012-03-12 17:53 EmacsUser Note Added: 0001605
2012-03-20 12:07 EmacsUser Relationship added related to 0000888
2012-03-30 16:09 NYKevin Note Added: 0001632
2012-03-30 22:16 EmacsUser Relationship deleted related to 0000576
2012-03-30 22:16 EmacsUser Relationship deleted related to 0000613
2012-03-30 22:16 EmacsUser Relationship deleted related to 0000880
2012-03-30 22:21 EmacsUser Summary ni misses an alternative parsing of the source text => Umbrella issue: ni misses an alternative parsing of the source text
2012-03-30 22:21 EmacsUser Description Updated View Revisions
2012-03-30 22:21 EmacsUser Steps to Reproduce Updated View Revisions
2012-03-30 22:21 EmacsUser Additional Information Updated View Revisions
2012-03-30 22:22 EmacsUser Note Deleted: 0001241
2012-03-30 22:22 EmacsUser Note Deleted: 0001307
2012-03-30 22:28 EmacsUser Note Added: 0001634
2012-03-30 22:32 EmacsUser Tag Attached: umbrella
2012-03-31 20:01 jmcgrew Relationship added related to 0000898
2012-04-02 11:59 EmacsUser Relationship replaced parent of 0000500
2012-04-02 12:00 EmacsUser Relationship replaced parent of 0000574
2012-04-02 12:00 EmacsUser Relationship replaced parent of 0000876
2012-04-02 12:00 EmacsUser Relationship replaced parent of 0000599
2012-04-02 12:00 EmacsUser Relationship replaced parent of 0000684
2012-04-02 12:00 EmacsUser Relationship replaced parent of 0000888
2012-04-02 12:01 EmacsUser Relationship replaced parent of 0000861
2012-04-12 13:56 EmacsUser Relationship added related to 0000905
2012-07-01 11:45 EmacsUser Additional Information Updated View Revisions
2012-08-13 15:48 EmacsUser Relationship added parent of 0000991
2012-08-13 15:50 EmacsUser Steps to Reproduce Updated View Revisions
2012-09-27 14:04 EmacsUser Steps to Reproduce Updated View Revisions
2013-02-14 09:32 EmacsUser Relationship added parent of 0001079
2013-02-14 09:36 EmacsUser Steps to Reproduce Updated View Revisions
2013-02-15 10:36 EmacsUser Steps to Reproduce Updated View Revisions
2013-02-15 10:36 EmacsUser Relationship deleted parent of 0001079
2013-12-25 15:52 EmacsUser Relationship added parent of 0001159
2013-12-25 16:36 EmacsUser Steps to Reproduce Updated View Revisions
2014-03-09 16:05 graham Relationship deleted parent of 0000574
2014-03-09 16:06 graham Relationship deleted parent of 0000684
2014-03-09 16:06 graham Relationship deleted parent of 0000876
2014-03-09 16:06 graham Relationship deleted parent of 0001159
2014-03-09 16:06 graham Note Added: 0002546
2014-03-09 16:06 graham Status confirmed => resolved
2014-03-09 16:06 graham Resolution open => not fixable
2014-03-09 16:06 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