#6 plan enumeration is broken

hg-pyke
closed-fixed
pyke (39)
5
2008-01-07
2008-01-02
Kevin Quick
No

Enumeration of plans within a context appears to be broken (for a bc rule) if the clauses include python clauses and/or kb fact assertions.

For example:

some_rule:
use result($foo)
when
fact.first($foo)
check 0 < len($foo)
compute($foo)
return $$()

compute_rule:
use compute($foo)
...

In the above, the _plan.py file will attempt to reference context['plan#3'] for some_rule, but the _bc.py file defines it as plan#1.

Discussion

  • Logged In: YES
    user_id=301752
    Originator: NO

    I can not reproduce this error. I tried your example and it works for me. If you still encounter this error after updating to svn revision 55 (or later), please file a new bug report.

     
    • status: open --> closed-works-for-me
     
  • Kevin Quick
    Kevin Quick
    2008-01-06

    Logged In: YES
    user_id=6133
    Originator: YES

    Sorry, I should have actually tried to reproduce this using my minimal example but I just extracted the latter from the larger rulebase I was working with.

    In going back and re-examining this in the context of that rulebase, I have discovered the actual problem: two rules with the same name. I'm re-opening this bug report with the suggestion that it should be illegal (a compilation error) to have two rules with identical names in the same rulebase.

     
  • Kevin Quick
    Kevin Quick
    2008-01-06

    • status: closed-works-for-me --> open-works-for-me
     
  • Logged In: YES
    user_id=301752
    Originator: NO

    Good point. Fixed in svn rev57, will be included in alpha2 release.

     
    • status: open-works-for-me --> closed-fixed