On Tue, Jan 09, 2018 at 06:42:23PM +0100, Martin Mares wrote:
Hello!
Variants we thought about when an undefined attribute is to be read:
1 the filter fails with an error. 2 the value is set to default (zero or whatever) and then used 3 it is propagated as undefined until any comparison/match happens, then the comparison/match is always false
In the Sherlock Holmes search engine, we used a different solution, which could be applicable to BIRD filters, too.
We added an undefined value to all types, including the boolean type. This leads to trivial tri-state logic, which can be modelled in this way: 1=true, -1=false, 0=undefined; AND is MIN, OR is MAX. Arithmetic operators with at least one undefined input yield undefined output. Relational operators with at least one undefined input yield an undefined boolean. Functions can handle undefined values as they wish.
Hello Thanks for suggestion, this seems like an elegant solution. Assuming NOT is NEG and conditionals fail for non-true. Note that this is not Boolean algebra (as law of excluded middle is not satisfied), but De Morgan algebra, so perhaps we could also rename boolean datatype to de_morgan datatype ;-) . -- Elen sila lumenn' omentielvo Ondrej 'Santiago' Zajicek (email: santiago@crfreenet.org) OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, wwwkeys.pgp.net) "To err is human -- to blame it on a computer is even more so."