Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000322Core InformRules and rulebookspublic2010-10-03 15:392010-10-28 00:31
ReporterRon Newcomb 
Assigned Tograham 
PrioritynormalSeveritymildReproducibilityalways
StatusclosedResolutionfixed 
PlatformPPCOSMac OS XOS Version10.4
Product Version6E72 
Target VersionFixed in Version6F95 
Summary0000322: Rule-ordering weirdness
DescriptionApologies for the vague summary, but I didn't know what else to say. In the code below, the two rules are "equally specific" with each other when it doesn't look like they should be at all. Both rules have the same condition on them, but one of them has an additional condition on top of that. But they are ordered, and run, as if they are "equally specific", producing incorrect game results.

Minimal Source Text To Reproduce
"asdf" by Ron Newcomb

For printing a parser error when the best match is at least the first word:
	say "I only understood you as far as '[the best match]'. I don't know the word '[first word]'. 
(foobar is nothing: [foobar].)"

For printing a parser error when the best match is at least the first word and the foobar is not nothing:
	
say "I only understood you as far as '[the best match]' ([foobar]). I don't know the word '[first 
word]'."

To decide which snippet is the first word: (- 101 -).
To decide which snippet is the best match: (- 101 -).

The foobar is an object that varies.  foobar is yourself.

spot is room

Test me with "hi / asdf / what"
Additional Information! ----------------------------------------------------------------------------------------------------
! Rules in rulebook: for Printing a parser error (B93_for_printing_a_parser_er)
! ----------------------------------------------------------------------------------------------------
! Rule 1/2 ! For printing a parser error when the best match is at least the first word:
! === which is equally specific with ===
! Rule 2/2 ! For printing a parser error when the best match is at least the first word and the foobar is not nothing:
! ----------------------------------------------------------------------------------------------------
! No specific request
! For printing a parser error when the best match is at least the first word:
[ R_739 ;
   if (((((( 101 >= 101 )))))) { ! Runs only while condition holds
   if (debug_rules) DB_Rule(R_739, 739);
      ! phrase 1
      ! [1: say ~I only understood you as far as '[the best match]'. I don't know the word '[first word]'. (foobar is nothing: [foobar].)~]
      say__p=1;ParaContent(); print (PrintText) SC_13; ParaContent(); print (PrintSnippet) 101 ; ParaContent(); print (PrintText) SC_14; ParaContent(); print (PrintSnippet) 101 ; ParaContent(); print (PrintText) SC_15; ParaContent(); print (PrintShortName) (Global_Vars-->9); ParaContent(); print (PrintText) SC_16; new_line; .L_Say5; .L_SayX5;
      RulebookSucceeds(); rtrue;
   } ! Runs only while condition holds
   else if (debug_rules > 1) DB_Rule(R_739, 739, true);
   rfalse;
];
! No specific request
! For printing a parser error when the best match is at least the first word and the foobar is not nothing:
[ R_740 ;
   if ((((((( 101 >= 101 ))) && (((~~(((Global_Vars-->9) == nothing))))))))) { ! Runs only while condition holds
   if (debug_rules) DB_Rule(R_740, 740);
      ! phrase 1
      ! [1: say ~I only understood you as far as '[the best match]' ([foobar]). I don't know the word '[first word]'.~]
      say__p=1;ParaContent(); print (PrintText) SC_13; ParaContent(); print (PrintSnippet) 101 ; ParaContent(); print (PrintText) SC_17; ParaContent(); print (PrintShortName) (Global_Vars-->9); ParaContent(); print (PrintText) SC_18; ParaContent(); print (PrintSnippet) 101 ; ParaContent(); print (PrintText) SC_19; new_line; .L_Say6; .L_SayX6;
      RulebookSucceeds(); rtrue;
   } ! Runs only while condition holds
   else if (debug_rules > 1) DB_Rule(R_740, 740, true);
   rfalse;
];
! ----------------------------------------------------------------------------------------------------
TagsNo tags attached.
Effect(serious/mild) Game compiles but misbehaves
Attached Files

- Relationships

-  Notes
(0000672)
jmcgrew (administrator)
2010-10-03 17:51

Law III.5.2 of sorting rulebooks states that "A more specific condition under '...when...' beats a less specific one [...] Inform judges how specific they are by counting the clauses found in them." Perhaps that part isn't working for activities?
(0000682)
graham (administrator)
2010-10-10 07:12

Complicated, but basically an oversight. I've fixed this, and it now sorts as Ron expected.

- Issue History
Date Modified Username Field Change
2010-10-03 15:39 Ron Newcomb New Issue
2010-10-03 17:51 jmcgrew Note Added: 0000672
2010-10-03 17:51 jmcgrew Severity serious => mild
2010-10-03 17:51 jmcgrew Status new => acknowledged
2010-10-03 21:59 jmcgrew Steps to Reproduce Updated View Revisions
2010-10-03 22:03 jmcgrew Status acknowledged => confirmed
2010-10-10 07:12 graham Note Added: 0000682
2010-10-10 07:12 graham Status confirmed => resolved
2010-10-10 07:12 graham Resolution open => fixed
2010-10-10 07:12 graham Assigned To => graham
2010-10-25 21:14 jmcgrew Fixed in Version => 6F95
2010-10-28 00:31 jmcgrew Status resolved => closed


Copyright © 2000 - 2010 MantisBT Group
Powered by Mantis Bugtracker