clara

http://www.clara-rules.org/
2019-09-10T14:12:20.009400Z

Hi. Im having a play around with Clara and seeing if it’ll fit our use case. One of which is to know which Rule(s) failed. I can see the inspect function gives loads of nice info for all the activations; what could I do if i wanted to know which Rules were not triggered and why?

2019-09-10T14:18:58.009800Z

@mbragg I think that will be a bit of a challenge with a forward-chaining approach to rules

2019-09-10T14:19:11.010100Z

if you have more specific questions - you can model that as rules and queries

2019-09-10T14:19:37.010900Z

but just to find out something like “what was missing that you would have needed to reach certain goals/conclusions” is more of a backwards chaining strength (ie goal-driven) I’d say

2019-09-10T14:19:56.011300Z

• clara is based around the rete algo which is a forward-chaining (ie data-driven) approach Good references for further reading: 1) https://pdfs.semanticscholar.org/54af/b81b814acea73450430b4dabd0fc5c13732a.pdf 2) http://iips.icci.edu.iq/images/exam/artificial-intelligence-structures-and-strategies-for--complex-problem-solving.pdf (section 8.2 Rule-Based Expert Systems)

2019-09-10T14:20:36.012100Z

you can make some progress of course with inspection - you can see what did happen, and subtract that from all the rules you know exists to find which were left out

2019-09-10T14:21:05.012600Z

you can also make more rules in some cases, perhaps even systematically (and programmatically) that try to capture the “negative” cases

2019-09-10T14:21:41.013300Z

eg. if I have a rule rule a => insert b, then also make a rule rule not(a) => insert z

2019-09-10T14:22:21.014Z

of course it can be more difficult than that with mult-condition joins, negation, and accumulators involved

2019-09-10T14:33:45.017900Z

Many thanks @mikerod That all makes sense. diffing the activated vs non-activated rules & using inspection does feel a little hacky, It seems like I should either re-think the problem and model it in a forward-chaining manner, or maybe not use clara and implement some sort of backward-chaining model. Thanks again!

1👍
devn 2019-09-10T18:33:47.019700Z

@mbragg at my previous gig, we found that doing what @mikerod mentioned was sufficient for our observability purposes. (Namely, we generated negative cases for certain types of rules, and created targeted queries to aid in observability.)

1👍
2019-09-10T18:42:50.021100Z

Thanks @devn yeah I’m having a think about that too