1. Consider these lines of code from a C program:
if (!(x != 1 && x*y < 0) && (x == 1 || y/x
Express the code in this statement as a compound statement using the logical
connectives ¬, , , , and these predicates:
: x = 1
Q(x,y): x*y < 0
R(x,y): y/x ≥ 5
W(z): “ z is assigned to printf ”
x and y are integers and z is a Boolean variable (with values True and False)
b. Use the laws of propositional logic to simplify the statement by expressing it in a
c. Translate the answer in part (b) back into C codes.
Given: Prove → ∨ using the Proof by Contradiction method.
[Hint: Use a combination of Equivalence Laws and Rules of Inference to solve this