zebra-puzzle

Prolog: Murder Mystery

做~自己de王妃 提交于 2020-12-15 01:59:28
问题 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

Prolog: Murder Mystery

狂风中的少年 提交于 2020-12-15 01:55:15
问题 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

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

Solving a puzzle in Prolog about time constraints

家住魔仙堡 提交于 2020-03-03 07:35:27
问题 Stuck on a Prolog problem. I know the answer (because I did it on paper first), but I cannot figure out how to get Prolog to come up with the answer. Problem: Bill eats a snack every night, having a different fruit and different nuts each night. From the statements below, identify what Bill had for a snack for each weeknight last week. a) The apple was eaten later in the week than the mango. b) The banana was eaten later in the week than both the almonds and peanuts, but earlier in the week

Solving Caliban problems with prolog

我的未来我决定 提交于 2020-01-05 18:57:26
问题 I'm working on solving a logic puzzle using prolog for school. Here's the clues: Brown, Clark, Jones and Smith are 4 substantial citizens who serve their community as achitect, banker, doctor and lawyer, though not necessarily respectively. Brown, who is more conservative than Jones but more liberal than Smith, is a better golfer than the men who are younger than he is and has a larger income than the men who are older than Clark. The banker, who earns more than the architect, is neither the

Solving Einstein Riddle in Prolog

雨燕双飞 提交于 2020-01-02 05:48:18
问题 I am trying to solve Einstein Riddle in Prolog. I am having a difficulty with the program I wrote, the basic method was to add all constraints and let Prolog figure out the only possible solutions. The problem is that Prolog finds 0 solutions. I have isolated the constraint that makes the program go from a given solution to no solutions, but I don't understand why. /*There are five houses*/ exists(A, list(A,_,_,_,_)). exists(A, list(_,A,_,_,_)). exists(A, list(_,_,A,_,_)). exists(A, list(_,_,

Einstein Riddle using Prolog

余生长醉 提交于 2019-12-31 03:17:08
问题 I'm trying to solve the Einstein riddle using Prolog. When I'm trying to run by houses(Hs), it shows No. Task is The Brit lives in the red house. The Swede keeps dogs as pets. The Dane drinks tea. The green house is on the immediate left of the white house. The green house's owner drinks coffee. The owner who smokes Pall Mall rears birds. The owner of the yellow house smokes Dunhill. The owner living in the center house drinks milk. The Norwegian lives in the first house. The owner who smokes

Prolog riddle solving

六眼飞鱼酱① 提交于 2019-12-25 04:48:10
问题 The statement : Four couples in all Attended a costume ball. 2 The lady dressed as a cat Arrived with her husband Matt. 3 Two couples were already there, One man dressed like a bear. 4 First to arrive wasn't Vince, But he got there before the Prince. 5 The witch (not Sue) is married to Chuck, Who was dressed as Donald Duck. 6 Mary came in after Lou, Both were there before Sue. 7 The Gipsy arrived before Ann, Neither is wed to Batman. 8 If Snow White arrived after Tess, Then how was each