Question #147334
) We have the following set of information about a computer program, find the mistake in the program using Rules of Inferences.
i. Either a variable is not declared or there is a syntax error in the fifth line.
ii. If there is a syntax error in the fifth line, then there is a missing semicolon or there is a mistake in variable name.
iii. There is not a missing semicolon.
iiii. There is a mistake in variable name.
1
Expert's answer
2020-11-30T21:12:53-0500

Let

p = a variable is not declared

q = there is a syntax error in the fifth line

r = there is a missing semicolon

s = there is a mistake in variable name


Then we can translate given sentences as:

(1) pqp \lor q

(2) q(rs)q \to (r\lor s)

(3) ¬r\neg r

(4) ss


By disjunction introduction ii can be written as:

qrq \to r (5)


Combining (3) and (5) we have

qrq \to r

¬r\neg r

_______

¬q\neg q (by modus tollens) (6)


Combining (1) and (6) we have

pqp \lor q

¬q\neg q

________

pp (by disjunctive syllogism) (7)


By combining (7) and (4) we have:

(psp\land s ) — a variable is not declared AND there is a mistake in variable name


Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!
LATEST TUTORIALS
APPROVED BY CLIENTS