can you guys solve the question 4 from the assignment 253-p2- equivalence.pdf that I uploaded.
here is the
(4) It can be cumbersome to prove propositional equivalence. It is easier if we let a
computer do that. Write a script that contains the following:
(a) The function are_equivalent2 from class.
(b) Now do the same for propositional functions in three variables.
- (i) Write a function are_equivalent3(F,G) that for two propositional func- tions F and G in three propositional variables, that proves propositional equivalence of F and G or gives a counterexample. If F and G are equiva- lent, the truth table for the functions along with a conclusion should be printed. If F and G are not equivalent, a counterexample should be printed, for example,
- Because F(True,False) is not equal to G(True,False), the
- propositional functions F and G are not equivalent.
- For a Python function F, its name can be obtained with F.__name__.
- (ii) Write functions for the left and right side of associative laws and distribu- tive laws:
- • associative_or_left, associative_or_right
- • associative_and_left, associative_and_right1
• distributive_or_left, distributive_or_right
• distributive_and_left, distributive_and_right
(iii) With the function are_equivalent3 and the propositional functions from
above prove the associative and distributive laws.
(iv) With the function are_equivalent3 investigate whether there is a dis-
tributive laws for ⊕ and ∧. Submit the function calls for all your tries. (c) The following propositional functions:
• contrapositive_left(p,q) that returns p → q
• contrapositive_right(p,q) that returns ¬q → ¬p• absorption1(p,q) that returns p ∨ (p ∧ q)
• absorption2(p,q) that returns p ∧ (p ∨ q)
• left(p,q) that returns p.
(d) The function calls
• are_equivalent2(contrapositive_left,contrapositive_right)• are_equivalent2(absorption1,contrapositive_right)