Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Lambda solution in Clear category for Boolean Algebra by sMiTeOne
OPERATIONS = {
"exclusive": lambda x, y: x ^ y,
"conjunction": lambda x, y: x & y,
"disjunction": lambda x, y: x | y,
"implication": lambda x, y: (1 ^ x) | y,
"equivalence": lambda x, y: int(x == y),
}
def boolean(x, y, operation):
return OPERATIONS.get(operation)(x, y)
Feb. 15, 2022