Jump to content

AND / OR logic in conditions


Recommended Posts

It's been a long while since looking at this so I just wanted to confirm.

If I would like A & (B OR C)         This expands to

(A & B )OR (A & C)

But I'm not clear if the below designation represents the above:

A  (AND)

B  (OR)

A  (And)

C (?)

Link to comment
Share on other sites

You mean for the condition system?  You need the conjunctive normal form... The wikipedia page does as good a job as anyone will do in explaining it.

For your A & (B | C) example, you get:

A (AND)

B (OR)

C (AND; though the very last one is a "don't care")

 

It quickly gets hairier... and in such cases thinking of the negation of your condition is often simpler.

 

Link to comment
Share on other sites

11 hours ago, xkkmEl said:

You mean for the condition system?  You need the conjunctive normal form... The wikipedia page does as good a job as anyone will do in explaining it.

For your A & (B | C) example, you get:

A (AND)

B (OR)

C (AND; though the very last one is a "don't care")

 

It quickly gets hairier... and in such cases thinking of the negation of your condition is often simpler.

 

Yep--that's it. Thank you. I'm steeped in the math way to resolve these so will have to adjust. I'll check out the wiki !

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...