Prolog: Murder Mystery

时光毁灭记忆、已成空白 提交于 2020-12-15 01:53:34

问题


I found the following murder mystery puzzle. Since I don't know much about Prolog except the basics, I cannot really evaluate the solution, however, it didn't seem particularly nice to me. My solution is not enough to generate the correct answers so I'm looking for some pointers as to how to get there or if it's at all possible to get there with my approach. Here's the puzzle just in case the link goes down:

jean was killed on Tuesday; the only suspects are:

   Luc, Paul, Alain, Bernard and Louis.

The rules to follow are:

1) The murderer is somebody who has a motive to kill jean, who owns a gun, and who does not have an alibi for Tuesday.

2) An alibi provided by a person who is not trustworthy is not accepted.

3)Somebody has a motive to kill jean if he has a special interest in killing jean or he wants revenge.

4)Somebody has a special interest in killing jean is he is the beneficiary of jean’s fortune, or if he owns money to jean, or if jean surprised him committing a crime.

Here are the facts established by the investigation:

Luc has an alibi for Tuesday given by Bernard

Paul has an alibi for Tuesday given by Bernard

Louis has an alibi for Tuesday given by Luc

Alain has an alibi for Thursday given by Luc

Alain is not a trustworthy person

Paul wants to take revenge on Jean

Luc wants to take revenge on Jean

Bernard is the beneficiary of Jean’s fortune

Jean is the beneficiary of Louis’s fortune

Louis owns money to Jean

Luc owns money to Jean

Jean has seen Alain committing a crime

Luc owns a gun

Louis owns a gun

Alain owns a gun

I want to find Have Prolog solve the murder mystery, by using the facts and the rules to answer the question: Who killed jean?

来源:https://stackoverflow.com/questions/65272839/prolog-murder-mystery

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!