Solution to a) We have the following set of information about a computer program, find the mistake … - Sikademy
Author Image

Archangel Macsika

a) 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. iv. There is a mistake in variable name.

The Answer to the Question
is below this banner.

Can't find a solution anywhere?

NEED A FAST ANSWER TO ANY QUESTION OR ASSIGNMENT?

Get the Answers Now!

You will get a detailed answer to your question or assignment in the shortest time possible.

Here's the Solution to this Question

In this form the premise (iv) implies the conclusion: "There is a mistake in variable name".


I think in the premise (iv) is omitted "not", that is


iv. There is not a mistake in variable name.


Then using the rule of Conjunction Introduction to (iii) and (iv), we conclude that "There is not a missing semicolon and there is not a mistake in variable name".


Next using de Morgan's law \neg p\land \neg q=\neg(p\lor q) we have "It is not true that there is a missing semicolon or there is a mistake in variable name"


Then using to (ii) and "It is not true that there is a missing semicolon or there is a mistake in variable name" the rule of Modus tollens we conclude  "There is not a syntax error in the fifth line".


Finally, using to (i) and "There is not a syntax error in the fifth line" the rule of Disjunctive Syllogism, we conclude that "A variable is not declared".


Therefore, in this case the mistake in the program is the following: "A variable is not declared".


Related Answers

Was this answer helpful?

Join our Community to stay in the know

Get updates for similar and other helpful Answers

Question ID: mtid-5-stid-8-sqid-3508-qpid-2207