Any way to expose the forward chaining rules firing process?

98 views
Skip to first unread message

Yuyu Xu

unread,
Jul 5, 2012, 8:00:25 PM7/5/12
to py...@googlegroups.com
Hey,

I've been reading pyke for sometime and am wondering is there's any way to log or print out the forward chaining rules firing process.

For example,
Inside example.krb, there's a rule
test_rule
  foreach
    test.word($w1)
    test.word($w2)
  assert
    test.connectTwo($w1, $w2)


I want to have the print out like:
test.word("hello")
test.word("world")
firing test_rule, asserting:
test.connectTow("hello", "world")


And you can turn on/off the print out or log by engine.get_rb('example').enableLog()

Appreciate it if someone can point me to the right place in the code to make these changes.
Or other ways to debug forward chaining rules would be also good.

Thanks

Reply all
Reply to author
Forward
0 new messages