VI. Friday Problems with Boolean Expressions and Predicates A. implication function ------------------------------------------ FOR YOU TO DO 1. Write a function, implies(b1, b2), that takes two bool arguments, b1 and b2, and returns True just when b1 implies b2. That is, it returns true just when either not b1 or b2 is True. ------------------------------------------ B. printing truth tables for arbitrary functions ------------------------------------------ FOR YOU TO DO 2. Write a procedure, print_truth_table(p), that takes a 2-argument Boolean predicate, p, as an argument, and prints a truth table for p that displays the value of p(b1, b2) for all pairs of Booleans b1 and b2. For example, print_truth_table(implies) would print on stdout: arg1\arg2 | True | False True | True | False False | True | True For another example, suppose we have: def notOrDM(b1, b2): return not (b1 or b2) == not b1 and not b2 Then print_truth_table(notOrDM) would print on stdout: arg1\arg2 | True | False True | True | True False | True | True ------------------------------------------ C. tautologies ------------------------------------------ FOR YOU TO DO 3. Write a function, is_tautology(p), that takes a 2-argument Boolean predicate, p, as an argument and returns True just when p is a tautology. That is is_tautology(p) returns True just when p(True,True), p(True, False), p(False, True), and p(False, False) are all True. ------------------------------------------