Checking the rules for redundancies - Gnorion/BizVR GitHub Wiki

Checking the rules for redundancies

Consider this decision table:

image

Are four rules actually required? Can we express the same logic in fewer rules? Notice that there are only two values assigned to price.

It turns out that two rules are sufficient:

image

if color is red and size is small or large then price is 5
if color is blue or green and shape is round then price is 10

The validation engine will analyse your rules and identify when compression is possible.

In this example:

image

(eliminate R3) because R1 [0..500] is more general than R3 [450..495]  
(eliminate R4) because R1 [0..500] is more general than R4 [40..50]    
(merge R1 with R2) because [600..700] or [0..500] can be combined as [0..500],[600..700]
(merge R5 with R1+R2) because [600..700] or [0..500] or [800..900] can be combined as [0..500],[600..700],[800..900]
(eliminate R7): because R8: >70 is more general than  >900 
(merge R8 with R2+R1+R5): because [600..700] or [0..500] or [800..900] or >70 can be combined as  [0..500],[600..700],[800..900],>70

what's left:

if x in [600..700] or in [0..500] or in [800..900] or > 70 then w is 1 
R6 : if x < 0 then w is 2  

These expressions can be further simplified to the following

R1 DT01 if x >= 0 then w = 1
R2 DT01 if x < 0 then w=2