View the step-by-step solution to:

Question

can you guys solve the question 4 from the assignment 253-p2- equivalence.pdf that I uploaded.

here is the

question:

(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.

  1. (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,
  2. Because F(True,False) is not equal to G(True,False), the
  3. propositional functions F and G are not equivalent.
  4. For a Python function F, its name can be obtained with F.__name__.
  5. (ii) Write functions for the left and right side of associative laws and distribu- tive laws:
  6. • associative_or_left, associative_or_right
  7. • 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)

• are_equivalent2(absorption1,left)

• are_equivalent2(absorption2,left)

Recently Asked Questions

Why Join Course Hero?

Course Hero has all the homework and study help you need to succeed! We’ve got course-specific notes, study guides, and practice tests along with expert tutors.

-

Educational Resources
  • -

    Study Documents

    Find the best study resources around, tagged to your specific courses. Share your own to gain free Course Hero access.

    Browse Documents
  • -

    Question & Answers

    Get one-on-one homework help from our expert tutors—available online 24/7. Ask your own questions or browse existing Q&A threads. Satisfaction guaranteed!

    Ask a Question
Ask Expert Tutors You can ask 0 bonus questions You can ask 0 questions (0 expire soon) You can ask 0 questions (will expire )
Answers in as fast as 15 minutes