I ran into something that's almost completely confusing me, and since it seems like a good logic problem when it comes to algorithms, I thought I'd ask here as opposed to a language specific thing (and yes it's something I'm trying to program and no it's not class work).
Anyway the problem:
I have a number of flags which can hold boolean values. For each flag, I can hold true or false. Each flag can also hold "both", which means in logic "true or false". Now the problem involving these flags is this: What is the logic to express boolean logic regarding these flags?
Ordinarily this wouldn't be an issue, but there is an additional restriction: "or" can only be used as a top level condition. Which means:
is invalid, but:
is.
Any ideas?
It is not possible for anyone to acknowledge truth when their salary depends on them not doing it.
Anyway the problem:
I have a number of flags which can hold boolean values. For each flag, I can hold true or false. Each flag can also hold "both", which means in logic "true or false". Now the problem involving these flags is this: What is the logic to express boolean logic regarding these flags?
Ordinarily this wouldn't be an issue, but there is an additional restriction: "or" can only be used as a top level condition. Which means:
Code:
a=true and (b=false or b=true)
Code:
(a=true and b=false) or (a=true and b=true)
Any ideas?
It is not possible for anyone to acknowledge truth when their salary depends on them not doing it.