Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
methodcaller solution in Clear category for Boolean Algebra by karlian
from operator import methodcaller
class Operations:
conjunction = lambda x, y: x and y
disjunction = lambda x, y: x or y
implication = lambda x, y: y if x else True
exclusive = lambda x, y: (x or y) and not (x and y)
equivalence = lambda x, y: (x and y) or not (x or y)
boolean = lambda x, y, operation: methodcaller(operation, x, y)(Operations)
May 22, 2022