Questions tagged [zebra-puzzle]

A Zebra-puzzle is a combinatorial logic puzzle. Also known as Einstein's riddle, Caliban's problem, Five Houses Puzzle.

A Zebra-puzzle is a combinatorial logic puzzle. Also known as Einstein's riddle, Caliban's problem, Five Houses Puzzle.

112 questions
1
vote
2 answers

Writing a simple "process of elimination" Prolog code using DCGs

I have simplified a more complex problem to the following: there are three houses on a street with three different colours (no colour repeated); red, blue, green. Write a program using DCGs to simulate all permutations/possibilities. My code won't…
user137379
  • 51
  • 3
1
vote
1 answer

Unsure of why code snippet works/what it's doing with logic riddle

I was looking through some prolog examples and stumbled upon…
user1066886
  • 202
  • 3
  • 12
1
vote
1 answer

prolog get syntax error when increase stack size

Trying to solve the puzzle task with prolog and got some problems. 1002 Stack Overflow. Re-configure with Setup if necessary. So, I've tried to increase stack size in setup and run program again. But it causes the other error: Syntax error on…
Anastasia S
  • 149
  • 2
  • 13
1
vote
1 answer

Riddle with GNU Prolog, similar to Einstein Riddle

I am a complete beginner to programming and have to create and solve a riddle in Prolog using GNU Prolog, similar to the Einstein riddle, albeit less sophisticated. I have been trying to create a riddle for the items contained within the following…
1
vote
1 answer

Solving Caliban problems with prolog

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,…
user1822789
  • 45
  • 2
  • 6
1
vote
2 answers

Solving a Logic Puzzle in Prolog

I'm learning Prolog, but I got stuck with this problem and I really don't know how to finish it. I thought that I was right in my code, but I keep getting warnings in Sictus, and I don't know where my mistake is. Here's the problem: /* File: …
1
vote
1 answer

How to model Einstein's Riddle in a Constraint Satisfaction manner (Prolog)

My IA assignment is to solve the Einstein Problem. I must solve it using a CSP model in Prolog. I am not given the model, but only the problem and some input data. My solution must be a general one, I mean, for some input data I must offer a…
Mihai Bairac
  • 11
  • 1
  • 5
1
vote
3 answers

Prolog Logic Test Example

I have a test coming up on Prolog and I can't really grasp the basic ideas of it. I kind of understand some of the examples I have been going through, but I can't sit down and know off hand how to solve a specific problem. Our professor gave us some…
William Hoskins
  • 305
  • 5
  • 17
0
votes
2 answers

Advice on solving zebra type puzzle

I need your help in solving the following problem: There're 3 girls (Ann,Susan,Alice) who need to choose what color shoes and dress to wear. There're 3 possible colors for shoes and dresses: white, blue and green. Main conditions: Ann hates…
Luke
  • 37
  • 9
0
votes
0 answers

How to look at multiple constraints together in python-constraint library

I have been practicing using the python constraint library by solving logic puzzles with it. I've found it an absolute joy to work with, but I'm stuck on a relatively simple puzzle. I can solve it programatically, but the goal is to solve it using…
0
votes
2 answers

Using Prolog to solve The Jindosh Riddle from Dishonored 2

I am playing the game Dishonored 2 There is a puzzle in the game, see the picture below (no spoilers). Riddle Naturally I wanted to solve this using Prolog. I have looked around and other people have made Prolog programs to solve the riddle, but I…
CricGuru
  • 5
  • 1
0
votes
1 answer

I cannot sort variables according to their given numbers (zebra problem)

` import itertools def imright(h1, h2): "House h1 is immediately right of h2 if h1-h2 == 1." return h1-h2 == 1 def nextto(h1, h2): "Two houses are next to each other if they differ by 1." return abs(h1-h2) == 1 def…
0
votes
2 answers

Prolog logic task

the rules are five students won five different places in five different disciplines - Alex, Bob, John, Deo, Sam. The language student placed higher than Bob as much as Bob placed higher than the law student. The IT student placed three spots…
user19258905
0
votes
1 answer

Can't figure out how to get logical answer I'm looking for in Prolog

I'm trying to learn swi-prolog and I'm struggling with the following question. The question goes: Vanessa, Mary and Penny study chemistry, biology and math, in countries Spain, Portugal, Venezuela. It is known, that Vanessa is not studying in Spain,…
0
votes
0 answers

Logical task about children

A family has 5 children. Their ages: 4, 5, 6, 7 and 8 years old. Their names: Rose, Becca, Iona, Stu, Rob. Each of them has a talent: piano, math, violin, literature, computer. I need to find out each child's age and talent, if the following facts…
Yuki
  • 1
  • 1