Friday, May 24, 2013

Backward Chaining and Reactive Transitive Closures with Drools

I've made a small tutorial on Backward Chaining and Reactive Transitive Closures with Drools. The slides. The video (Don't forget to turn on Youtube HD settings):






2 comments:

  1. HI Mark,
    NIce tutorial.
    Apart from determining hierarchies as shown in your what are some real life use cases that are better addressed by backward chaining as opposed to forward chaining?

    ReplyDelete
  2. You can also use them to encapsulate a set of patterns, similar to how a method encapsulates a set of statemenents. Look at the queries here, such as look, exits, inventory;
    https://github.com/droolsjbpm/drools/blob/master/drools-examples/src/main/resources/org/drools/games/adventures/Queries.drl

    Which are then used in these reactive rules:
    https://github.com/droolsjbpm/drools/blob/master/drools-examples/src/main/resources/org/drools/games/adventures/Commands.drl

    Also a query can be used provide inferred information. If room A connects to room B, then room B connects to room A - but I don't want to repeat the second inferrable piece of information. This is achieved with the connect query, and again used in the set of commands.drl

    ReplyDelete