Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0001980Core InformUnderstandingpublic2016-12-14 09:022016-12-15 11:49
Reportermattweiner 
Assigned To 
PrioritynormalSeverityseriousReproducibilityalways
StatusnewResolutionopen 
PlatformMacintoshOSEl CapitanOS Version10.11.6
Product Version6M62 
Target VersionFixed in Version 
Summary0001980: [things inside] token breaks when second noun is ambiguous
DescriptionWhen processing a "take [things inside] of [something]" command, when the second noun is ambiguous, the parser automatically selects a thing to serve as the first noun without regard for whether it matches the typed command. This leads to spurious "You can't see any such thing" messages and other odd behavior.
Minimal Source Text To Reproduce
Shrine is a room. A blue pedestal is in Shrine. A bust of Venus is on the blue pedestal. A red pedestal 
is in Shrine. A bust of Cupid is on the red pedestal.

test basic with "take cupid from pedestal/take venus from pedestal/red/take venus from pedestal/blue".


test bust with "take bust from pedestal/red/i".

test me with "test basic/put venus on blue pedestal/test bust/put cupid on red pedestal/trace 6/test 
basic/put venus on blue pedestal/test bust".
Additional InformationOutput without the traces:

Shrine
You can see a blue pedestal (on which is a bust of Venus) and a red pedestal (on which is a bust of Cupid) here.

>test me
(Testing.)

>[1] test basic
(Testing.)

>[2] take cupid from pedestal
You can't see any such thing.

>[3] take venus from pedestal
Which do you mean, the blue pedestal or the red pedestal?

>[4] red
You can't see any such thing.

>[5] take venus from pedestal
Which do you mean, the blue pedestal or the red pedestal?

>[6] blue
Taken.

>[7] put venus on blue pedestal
You put the bust of Venus on the blue pedestal.

>[8] test bust
(Testing.)

>[9] take bust from pedestal
Which do you mean, the blue pedestal or the red pedestal?

>[10] red
Taken.

>[11] i
You are carrying:
  a bust of Cupid

>[12] put cupid on red pedestal
You put the bust of Cupid on the red pedestal.

In 6G60 "take cupid from pedestal" yields "Which do you mean, the blue pedestal or the red pedestal?" I haven't been able to test this in any 6L version.

From the traces, it looks to me as though the parser is automatically settling on Venus for the multi-inside token, and then rejecting it because it doesn't match the typed command "Cupid." It's only coincidence that "take bust from pedestal" works; on the first pass the parser automatically fills in Venus and disambiguates on "pedestal"; then if we enter "red" it processes "take bust from red pedestal," which doesn't require disambiguation on the second noun and so avoids this bug.

...from the trace of "take cupid from pedestal"

[line 4 * multiinside 'from' noun -> Remove]
 [Trying look-ahead]
   [NounDomain called at word 4
   seeking definite object
...
[DSA on the blue pedestal with reason = 0 p1 = 0 p2 = 0]
    Trying the blue pedestal (582010) at word 4
    Matched (1)
    Match with quality 1
    Match added to list
[DSA on the bust of Venus with reason = 0 p1 = 0 p2 = 0]
    Trying the bust of Venus (582042) at word 4
[DSA on the red pedestal with reason = 0 p1 = 0 p2 = 0]
    Trying the red pedestal (582074) at word 4
    Matched (1)
    Match with quality 1
    Match added to list
[DSA on the bust of Cupid with reason = 0 p1 = 0 p2 = 0]
    Trying the bust of Cupid (582106) at word 4
   [ND made 2 matches]
   [Adjudicating match list of size 2 in context 0
   definite object
   Scoring match list: indef mode 0 type 0, satisfying 0 requirements:

     The blue pedestal (582010) in Shrine : 2176 points

     The red pedestal (582074) in Shrine : 2176 points
   Grouped into 2 possibilities by name:
   The blue pedestal (582010) --- group 1
   The red pedestal (582074) --- group 2
   Unable to choose best group, so ask player.]
 [Advanced to "noun" token: the blue pedestal]
 [line 4 token 1 word 2 : multiinside]
  [Object list from word 2]
  [Calling NounDomain on location and actor]
   [NounDomain called at word 2
   seeking definite object
[DSA on the bust of Venus with reason = 0 p1 = 0 p2 = 0]
    Trying the bust of Venus (582042) at word 2
   [ND made 0 matches]
  [token resulted in failure with error type 5]

from the trace of "take venus from pedestal"

[line 4 * multiinside 'from' noun -> Remove]
 [Trying look-ahead]
   [NounDomain called at word 4
   seeking definite object
...
   [Adjudicating match list of size 2 in context 0
   definite object
   Scoring match list: indef mode 0 type 0, satisfying 0 requirements:

     The blue pedestal (582010) in Shrine : 2176 points

     The red pedestal (582074) in Shrine : 2176 points
   Grouped into 2 possibilities by name:
   The blue pedestal (582010) --- group 1
   The red pedestal (582074) --- group 2
   Unable to choose best group, so ask player.]
 [Advanced to "noun" token: the blue pedestal]
 [line 4 token 1 word 2 : multiinside]
  [Object list from word 2]
  [Calling NounDomain on location and actor]
   [NounDomain called at word 2
   seeking definite object
[DSA on the bust of Venus with reason = 0 p1 = 0 p2 = 0]
    Trying the bust of Venus (582042) at word 2
    Matched (1)
    Match with quality 1
    Match added to list
   [ND made 1 matches]
  [ND returned the bust of Venus]
  [token resulted in success]
 [line 4 token 2 word 3 : 'from']
  [token resulted in success]
 [line 4 token 3 word 4 : noun]
  [Object list from word 4]
  [Calling NounDomain on location and actor]
   [NounDomain called at word 4
   seeking definite object
...
[DSA on the blue pedestal with reason = 0 p1 = 0 p2 = 0]
    Trying the blue pedestal (582010) at word 4
    Matched (1)
    Match with quality 1
    Match added to list
[DSA on the bust of Venus with reason = 0 p1 = 0 p2 = 0]
    Trying the bust of Venus (582042) at word 4
[DSA on the red pedestal with reason = 0 p1 = 0 p2 = 0]
    Trying the red pedestal (582074) at word 4
    Matched (1)
    Match with quality 1
    Match added to list
[DSA on the bust of Cupid with reason = 0 p1 = 0 p2 = 0]
    Trying the bust of Cupid (582106) at word 4
   [ND made 2 matches]
   [Adjudicating match list of size 2 in context 0
   definite object
   Scoring match list: indef mode 0 type 0, satisfying 0 requirements:

     The blue pedestal (582010) in Shrine : 2176 points

     The red pedestal (582074) in Shrine : 2176 points
   Grouped into 2 possibilities by name:
   The blue pedestal (582010) --- group 1
   The red pedestal (582074) --- group 2
   Unable to choose best group, so ask player.]
Which do you mean, the blue pedestal or the red pedestal?

From the trace for "take bust from pedestal":

[line 4 * multiinside 'from' noun -> Remove]
 [Trying look-ahead]
   [NounDomain called at word 4
   seeking definite object
...
[DSA on the blue pedestal with reason = 0 p1 = 0 p2 = 0]
    Trying the blue pedestal (581992) at word 4
    Matched (1)
    Match with quality 1
    Match added to list
[DSA on the bust of Venus with reason = 0 p1 = 0 p2 = 0]
    Trying the bust of Venus (582024) at word 4
[DSA on the red pedestal with reason = 0 p1 = 0 p2 = 0]
    Trying the red pedestal (582056) at word 4
    Matched (1)
    Match with quality 1
    Match added to list
[DSA on the bust of Cupid with reason = 0 p1 = 0 p2 = 0]
    Trying the bust of Cupid (582088) at word 4
   [ND made 2 matches]
   [Adjudicating match list of size 2 in context 0
   definite object
   Scoring match list: indef mode 0 type 0, satisfying 0 requirements:

     The blue pedestal (581992) in Shrine : 2176 points

     The red pedestal (582056) in Shrine : 2176 points
   Grouped into 2 possibilities by name:
   The blue pedestal (581992) --- group 1
   The red pedestal (582056) --- group 2
   Unable to choose best group, so ask player.]
 [Advanced to "noun" token: the blue pedestal]
 [line 4 token 1 word 2 : multiinside]
  [Object list from word 2]
  [Calling NounDomain on location and actor]
   [NounDomain called at word 2
   seeking definite object
[DSA on the bust of Venus with reason = 0 p1 = 0 p2 = 0]
    Trying the bust of Venus (582024) at word 2
    Matched (1)
    Match with quality 1
    Match added to list
   [ND made 1 matches]
  [ND returned the bust of Venus]
  [token resulted in success]
 [line 4 token 2 word 3 : 'from']
  [token resulted in success]
 [line 4 token 3 word 4 : noun]
  [Object list from word 4]
  [Calling NounDomain on location and actor]
   [NounDomain called at word 4
   seeking definite object
...
[DSA on the blue pedestal with reason = 0 p1 = 0 p2 = 0]
    Trying the blue pedestal (581992) at word 4
    Matched (1)
    Match with quality 1
    Match added to list
[DSA on the bust of Venus with reason = 0 p1 = 0 p2 = 0]
    Trying the bust of Venus (582024) at word 4
[DSA on the red pedestal with reason = 0 p1 = 0 p2 = 0]
    Trying the red pedestal (582056) at word 4
    Matched (1)
    Match with quality 1
    Match added to list
[DSA on the bust of Cupid with reason = 0 p1 = 0 p2 = 0]
    Trying the bust of Cupid (582088) at word 4
   [ND made 2 matches]
   [Adjudicating match list of size 2 in context 0
   definite object
   Scoring match list: indef mode 0 type 0, satisfying 0 requirements:

     The blue pedestal (581992) in Shrine : 2176 points

     The red pedestal (582056) in Shrine : 2176 points
   Grouped into 2 possibilities by name:
   The blue pedestal (581992) --- group 1
   The red pedestal (582056) --- group 2
   Unable to choose best group, so ask player.]
Which do you mean, the blue pedestal or the red pedestal?

from the trace for answering that question with "red"

>[23] red
  [token resulted in re-parse request]
[ "take" take / "bust" bust / "from" from / "red" red / "pedestal" pedestal ]
[Parsing for the verb 'take' (6 lines)]

[line 4 * multiinside 'from' noun -> Remove]
 [Trying look-ahead]
   [NounDomain called at word 4
   seeking definite object
...
[DSA on the blue pedestal with reason = 0 p1 = 0 p2 = 0]
    Trying the blue pedestal (581992) at word 4
[DSA on the bust of Venus with reason = 0 p1 = 0 p2 = 0]
    Trying the bust of Venus (582024) at word 4
[DSA on the red pedestal with reason = 0 p1 = 0 p2 = 0]
    Trying the red pedestal (582056) at word 4
    Matched (2)
    Match with quality 2
    Match added to list
[DSA on the bust of Cupid with reason = 0 p1 = 0 p2 = 0]
    Trying the bust of Cupid (582088) at word 4
   [ND made 1 matches]
 [Advanced to "noun" token: the red pedestal]
 [line 4 token 1 word 2 : multiinside]
  [Object list from word 2]
  [Calling NounDomain on location and actor]
   [NounDomain called at word 2
   seeking definite object
[DSA on the bust of Cupid with reason = 0 p1 = 0 p2 = 0]
    Trying the bust of Cupid (582088) at word 2
    Matched (1)
    Match with quality 1
    Match added to list
   [ND made 1 matches]
  [ND returned the bust of Cupid]
  [token resulted in success]
 [line 4 token 2 word 3 : 'from']
  [token resulted in success]
 [line 4 token 3 word 4 : noun]
  [Object list from word 4]
  [Calling NounDomain on location and actor]
   [NounDomain called at word 4
   seeking definite object
...
[DSA on the blue pedestal with reason = 0 p1 = 0 p2 = 0]
    Trying the blue pedestal (581992) at word 4
[DSA on the bust of Venus with reason = 0 p1 = 0 p2 = 0]
    Trying the bust of Venus (582024) at word 4
[DSA on the red pedestal with reason = 0 p1 = 0 p2 = 0]
    Trying the red pedestal (582056) at word 4
    Matched (2)
    Match with quality 2
    Match added to list
[DSA on the bust of Cupid with reason = 0 p1 = 0 p2 = 0]
    Trying the bust of Cupid (582088) at word 4
   [ND made 1 matches]
  [ND returned the red pedestal]
  [token resulted in success]
 [line 4 token 4 word 6 : END]
[Line successfully parsed]


TagsNo tags attached.
Effect(serious/mild) Game compiles but misbehaves
Attached Files

- Relationships

-  Notes
(0004632)
zarf (developer)
2016-12-14 23:26

I've always considered it a bug that "take X from Y" can produce an "You can't see any such thing" error when X is in scope. (Entirely aside from disambiguation.)
(0004633)
mattweiner (reporter)
2016-12-15 11:49
edited on: 2016-12-24 04:52

I suppose that for that sort of thing, a desirable solution might be along the lines of the "You can only do that to something animate" error that you get when the only thing that matches a [someone] token is inanimate--if something matches the [things inside] token, but isn't actually inside the matched second noun, generate a special error. I don't know how feasible that would be.

But in any case, that wouldn't help here, since the issue is that [2] "take cupid from pedestal" should succeed rather than generating an error of any sort.


- Issue History
Date Modified Username Field Change
2016-12-14 09:02 mattweiner New Issue
2016-12-14 23:26 zarf Note Added: 0004632
2016-12-15 11:49 mattweiner Note Added: 0004633
2016-12-24 04:52 mattweiner Note Edited: 0004633 View Revisions


Copyright © 2000 - 2010 MantisBT Group
Powered by Mantis Bugtracker