logical-and(a, b,[,c,d,e])
Group |
Boolean AND operation. Returns true if a and b and all other (non-empty) parameters are true, false otherwise.
Description of Parameters
Parameter |
Description |
a |
Value. |
b |
Value. |
c |
(optional) Value. |
d |
(optional) Value. |
e |
(optional) Value. |
Hint: There is a difference between parameters a and b and the parameter group c, d and e. The logical connective AND with a variable number of parameters needs a rule for unused parameters. Since an AND operation needs at least two parameters, a and b need to have a Boolean value, so they are not optional. If a or b have no assigned values (no value), they will be assigned the value false. For the optional parameters c to e, an unassigned value is interpreted as the parameter not being used. Unused parameters have to be interpreted as true for the AND operation to return the logically correct result, meaning parameters c to e will be interpreted as true if they have no assigned value.
Solution: Make sure that all parameters that should be used have a valid Boolean value (true or false), since no value is interpreted as the parameter not being used and will, therefore, for parameters c to e lead to an internal assignment of the value true to an unused parameter (and false for parameters a and b).
Examples
Parameter a |
Parameter b |
Parameter c |
Parameter d |
Parameter e |
Result |
false |
|||||
true |
false |
false |
|||
false |
true |
false |
|||
true |
true |
true |
|||
true |
true |
true |
true |
||
true |
true |
false |
false |
||
true |
true |
true |
true |
true |
true |