Logical Operators

logical-expression:
        expression && expression
        expression and expression
        expression || expression
        expression or expression
        ! expression
        not expression

EDEN operates in 3-value logic (true, false and @). Any non-zero value means true; zero means false. In addition to the lazy operators (as in C, left-to-right evaluation, the second operand is evaluated only if necessary), eager operators - and, or, not - are also defined. Notice that the truth tables for the lazy and the corresponding eager operators are not identical.

@ && @ = @@ and @ = @@ || @ = @@ or @ = @
@ && F = @@ and F = @@ || F = @@ or F = @
@ && T = @@ and T = @@ || T = @@ or T = @
F && @ = FF and @ = @F || @ = @F or @ = @
F && F = FF and F = FF || F = FF or F = F
F && T = FF and T = FF || T = TF or T = T
T && @ = @T and @ = @T || @ = TT or @ = @
T && F = FT and F = FT || F = TT or F = T
T && T = TT and T = TT || T = TT or T = T
! @ = Tnot @ = @
! F = Tnot F = T
! T = Fnot T = F

Truth Tables for operators: &&, and, ||, or, !, not.


[BACK] [FORWARD] [HOME] [UP] [HELP]