who is lying? - by using Knowledge Base by resolution

163 Views Asked by At

I found this question online, and tryied to solve. However, I have trouble with the methods

Here question Three children Allison, Jack, and Frank were playing “hide and seek” game in an apartment. When the parents went back home they saw that the vase in the living room is broken. Three children are the suspects, one of them broke the vase, but all of them say they did not do it. Allison says that Jack was hiding in the living room but Frank was not there. Jack says he was hiding in the garden at that time and never entered into living room. Frank says Allison and Jack were not in the garden. You are asked to resolve this puzzle and find who is guilty while assuming only the guilty child does not tell the truth.

I want to construct the knowledge-base and find who is guilty by resolution. Could you help me?

2

There are 2 best solutions below

0
On

The (vase) killer is indeed...Jack! First we eliminate Frank as a potential suspect. If Frank is lying then both Alison and Jack were in the garden but then Allison would also be lying... a contradiction.

So Frank is telling the truth, i.e. Jack and Alison were not in the garden. But Jack says he was hiding in the garden and is thus lying which means he is the criminal we are after!

It seems your question is best suited for Stack Overflow though if you want an algorithmic response.

0
On

Allison and Jack's statements are contradictory, therefore one of them must be lying. Thus Frank is telling the truth (since there is only 1 liar). So Jack was in the garden, and was the lying, vase-breaking scoundrel.