Rule Machine: Showing False in condition, yet true overall

Trying to figure out why this is evaluating as true. I can report that "Thermostat Override" is off as it shows in the conditions, yet the rule is coming up True.

This is one of many rules that behave as described. As you can see I am processing 6 variables, so I have 16 different rules to handle a variety of situations (for math majors out there, its really 4 variables...all rules share the truth of HSM=Disarmed and FR Deck=Off).

As I play with the configurations I am getting multiple true rules when it should only be 1 at a time.

Is it because the first 3 conditions evaluate the rule to be true.

The reason is the fact that rules are evaluated strictly left to right. Once it got to the OR and that which was before the OR was true, that was enough for the rule to be true. (see the documentation here: Rule MachineĀ® Introduction):

It's easy to work around this. One way would be to put all of your AND parts before any OR part. Another way would be to use parens to group parts together (select complex rule for parens to be available).

I great big 'd'oh' to me. They should all be 'AND' clauses. Thanks Bruce. As I noted, just built 16 of these, while sitting in front of TV. Going blind in there. That's why books have editors! Will update all to AND clauses. Gee, as I have lots of true when it should be false, I have to review to see if I made this same mistake a lot.

Only give me money IF you owe me AND you want to OR I say so. :sunglasses:

Hmmm, that's actually false...

1 Like

16 rules, 5 Boolean operators each. 2 misses. Looking better. Thanks!

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.