Currently (0.3.9), Clafer assumes 0 as a value for missing values, which is ok when doing addition (sum) but not multiplication (product).
For example,
a -> integer ? = 2
b -> integer ? = 3
c -> integer ? = a + b // possible values are 0, 2, 3, or 5
d -> integer ? = a * b // possible values are 0, 0, 0, or 6
That is because when a and b are not present, their values are assumed to be 0, which makes the result of multiplication 0 as well.
What should be the correct possible values for d: 1, 2, 3, 6 or 0, 2, 3, 6?
In general, instead of assuming a neutral element, the missing clafer should not be omitted in the formula as follows:
one a && one b then a + b remains as is
one a && no b then a + b is simplified to a
no a && one b then a + b is simplified to b
no a && no b then ?
Currently (0.3.9), Clafer assumes 0 as a value for missing values, which is ok when doing addition (
sum) but not multiplication (product).For example,
That is because when
aandbare not present, their values are assumed to be 0, which makes the result of multiplication 0 as well.What should be the correct possible values for
d:1, 2, 3, 6or0, 2, 3, 6?In general, instead of assuming a neutral element, the missing clafer should not be omitted in the formula as follows:
one a && one bthena + bremains as isone a && no bthena + bis simplified toano a && one bthena + bis simplified tobno a && no bthen ?