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

Archangel Macsika

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.

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

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) p \lor q

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

(3) \neg r

(4) s


By disjunction introduction ii can be written as:

q \to r (5)


Combining (3) and (5) we have

q \to r

\neg r

_______

\neg q (by modus tollens) (6)


Combining (1) and (6) we have

p \lor q

\neg q

________

p (by disjunctive syllogism) (7)


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

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


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-3504-qpid-2203