3 ms·
> conditional logic Conditional logic can be expressed in terms of arithmetic: if c then t else f = c*t + (1-c)*f You can also do boolean logic: NOT y =
by moonchild 6y ago
> conditional logic
Conditional logic can be expressed in terms of arithmetic:
if c then t else f = c*t + (1-c)*f
You can also do boolean logic:
NOT y = 1 - y
x AND y = x * y
x OR y = (x + y) - (x * y)
(Where 1 indicates truth and 0 falsity.)
What you can't do, however, is conditional execution, as this would leak information. Which doesn't limit the capabilities of the system in principle, but does in practice because this harms performance. E.G. ‘select count(*) from users where name = bob’ will be much slower with HFE than with a traditional database because there will be no possibility of using precalculated indices.
- h0l0cube 6y agoAh yes, I was thinking it was possible to execute both computations and take the one you need. 'Conditional execution' was more what I meant.