Eliminating Redundant Rules - Gnorion/BizVR GitHub Wiki
Eliminating Redundant Rules
Here's a topic that will probably make your brain hurt> Given this set of 12 rules:
R1 DT1: if color in ['brown'..'violet'] then price is 5
R2 DT1: if color in ['red'..'teal'] and size = 'large' then price is 5
R3 DT1: if color = 'red' and shape = 'round' then price is 5
R4 DT1: if color = 'green' and size = 'small' and shape = 'square' then price is 10
R5 DT1: if color = 'green' and size = 'large' and shape = 'square' then price is 10
R6 DT1: if color = 'green' and size = 'large' and shape = 'oval' then price is 10
R7 DT1: if color = 'green' and size = 'large' and shape = 'square' then price is 10
R8 DT1: if color = 'green' and size = 'large' and shape = 'oblong' then price is 10
R9 DT1: if color = 'green' and size = 'large' and shape = 'triangle' then price is 10
R1 DT2: if color in ['brown'..'violet'] then price is 5
R2 DT2: if color = 'green' and size = 'small' or = 'large' and shape = 'square' then price is 10
R3 DT2: if color = 'green' and size = 'large' and shape = 'oval' or = 'oblong' or = 'triangle' then price is 10
Can they be expressed in fewer rules?
VV says these 12 rules can be replaced by just three:
if color in ['brown'..'violet'] then price is 5
if color = 'green' and size = 'small' or = 'large' and shape = 'square' then price is 10
if color = 'green' and size = 'large' and shape = 'oval' or = 'oblong' or = 'triangle' then price is 10
Do you agree?