Ternary logic