Jokodo
Veteran Member
What's the cause for quantificational operators operating the way they do on empty lists?
Note that I'm asking for the cause, not the reason. If you wish, the implementation. I'm fully aware that any(<empty list>) should return FALSE and all(<empty list>) TRUE, not least because you want to make sure that ALL x: NOT x and NOT(ANY(x)) return the same value. But it doesn't seem to follow from how I would naively go about building those Quantifiers from unary or binary operators like NOT/AND/OR. If you think of ALL as a string of ANDs (a AND b AND c ...), it would seem more natural to end up casting an empty list to FALSE (just as a sequence of OR connectives for ANY).
Do those quantifiers explicitly treat empty lists separately to ensure consistent behaviour to specification (e. g. "IF list_is_empty(); then return TRUE; else apply_normal_logic(); FI" for ALL), or are they implemented in a way very different from what I'd naively expect?
Note that I'm asking for the cause, not the reason. If you wish, the implementation. I'm fully aware that any(<empty list>) should return FALSE and all(<empty list>) TRUE, not least because you want to make sure that ALL x: NOT x and NOT(ANY(x)) return the same value. But it doesn't seem to follow from how I would naively go about building those Quantifiers from unary or binary operators like NOT/AND/OR. If you think of ALL as a string of ANDs (a AND b AND c ...), it would seem more natural to end up casting an empty list to FALSE (just as a sequence of OR connectives for ANY).
Do those quantifiers explicitly treat empty lists separately to ensure consistent behaviour to specification (e. g. "IF list_is_empty(); then return TRUE; else apply_normal_logic(); FI" for ALL), or are they implemented in a way very different from what I'd naively expect?