Fork me on GitHub
#clara
<
2019-09-10
>
mbragg14:09:20

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?

mikerod14:09:58

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

mikerod14:09:11

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

mikerod14:09:37

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

mikerod14:09:56

• 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)

mikerod14:09:36

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

mikerod14:09:05

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

mikerod14:09:41

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

mikerod14:09:21

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

mbragg14:09:45

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!

devn18:09:47

@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.)

mbragg18:09:50

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