The picture was generated by AI using the description "A school girl wearing an orange blazer which has a pink badge on the pocket. The girl is wearing a turquoise hat and a khaki scarf. Her skirt is black"
SCHOOL COLOURS
TELL ME, PROFERROR PINHOLE, WHICH SCHOOL DOES YOUR DAUGHTER ALICE GO TO.
LET ME THINK.
IS IT THE ONE WITH THE ORANGE HAT AND THE TURQUOISE SCARF?
OR WITH THE KHARKI BLAZER AND THE ORANGE EMBLEM?
OR WITH THE PINK BLAZER AND THE ORANGE SCARF?
OR WITH THE KHARKI SCARF AND PINK EMBLEM?
OR WITH THE KHAKI HAT AND TURQUOISE EMBLEM?
I FEAR I CANNOT RECOLLECT.
GOOD HEAVENS. PROFESSOR, HOWEVER MANY SCHOOLS ARE THERE?
JUST FOUR AND I HAVE ONE DAUGHTER AT EACH.
BETH GOES TO ST GERTRUDE'S
CLARE WEARS A TURQUIOSE HAT AND
DEBBIE WEARS A KHARKI EMBLEM.
ST ETHELREDA'S FLAUNTS A PINK SCARF,
ST FAITH'S AN ORANGE BLAZER AND
ST IDA'S A PINK HAT.
ANE WHOSE ARE THOSE CLOTHES FLUNG DOWN ON THE FLOOR OVER THERE?
THE TURQUOISE HAT AND THE KHARKI BLAZER BELONG TO DIFFERENT GIRLS.
AS FOR THE TURQUOISE BLAZER, WELL I THINK YOU MIGHT WORK THAT OUT FOR YOURSELF."
Author Martin Hollis
Published in the New Scientist
More information about TANTALIZE - a heuristic problem solver written in CODIL
Try and solve the puzzle yourself before seeing how TANTALIZE solves it.
The TANTALIZE APPLICATION is told that the problem involves lists of items which need to be fitted together (REQUIREMENTS), and that it should trace the route it uses to solve the task.
REQUIREMENTS.
TRACE.
END.
Tantalizer request the names of the sets to be considered
SELECT = ?
HATS & SCARVES & EMBLEMS & DAUGHTERS & SCHOOLS
TYPE IN HATS
SELECT NAME = ?
This creates a set of HATS which contains four members such as HAT = ORANGE
The process is repeated for SCARVES, EMBLEMS, DAUGHTERS & SCHOOLS
HAT: ORANGE & KHAKI & TURQUOISE & PINK
TYPE IN SCARVES
SELECT NAME = ?
SCARF: TUREQUOISE & ORANGE & KHAKI & PINK
TYPE IN EMBLEMS
SELECT NAME = ?
EMBLEM: ORANGE & PINK & TURQUOISE & KHAKI
TYPE IN DAUGHTERS
SELECT NAME = ?
DAUGHTER: ALICE & BESS & CLAIRE & DEBBIE
TYPE IN SCHPPLS
SELECT NAME = ?
SCHOOL: ST GERTRUDE & ST ETHELDREDA & ST FAITH & ST IDA
The next step is to type in the statements which are stated to be true.
TYPE IN REQUIREMENTS
HAT = ORANGE; SCARF = TURQUOISE.
BLAZER = KHARKI; EMBLEM = ORANGE.
BLAZER = PINK; SCARF = ORANGE.
SCARF = KHAKI; EMBLEM = PINK.
HAT = KHAKI; EMBLEM = TURQUOISE.
DAUGHTER = BESS; SCHOOL = ST GERTRUDE.
DAUGHTER = CLAIRE; HAT - TURQUOISE.
DAUGHTER = DEBBIE; EMBLEM = KHAKI.
SCHOOL = ST ETHELDREDA; SCARF = PINK.
SCHOOL = ST FAITH; BLAZER = ORANGE.
SCHOOL = ST IDA; HAT = PINK.
END.
The next step is to type in the statements which are stated to be false.
DESCRIBE ILLEGAL CONDITIONS
HAT = TURQUOISE; BLAZER - KHAKI.
END.
The goal is set to find the situation when all four daughters have been allocated schools
TYPE IN GOAL
DAUGHTER (NUMBER) = 4.
END.
At this point the TANTALIZE package has all it needs to correctly link the HATS & SCARVES & EMBLEMS & DAUGHTERS & SCHOOLS sets. In effect the CODIL items are organised to produce what could be considered, in stored program computer terminology to be a program (set) which generates the answer. In the process the REQUIREMENTS and ILLEGAL CONDITIONS are sorted, using a simple learning routine, in order to generate the answer in a minimum number of steps. Because TRACE is defined TANTALIZE displays the changes to the FACTS (CODIL's short term memory).
The trace produced by TANTALIZE is reproduced below with 2 changes from the original listing. The item number (in red) represents the position of the CODIL item in the FACTS and the indentation on the display. Ii addition, to emphasise where the search has backtracked the items in the final answer are highlighted,
01 SOLUTION FOUND = 0
02 TRACE
03 START SELECT = HATS
04 HAT = TURQUOISE
05 SCARF - BLUE
06 BLAZER - ORANGE
07 EMBLEM - KHAKI
06 BLAZER = TURQUOISE
07 EMBLEM = KHAKI
05 SCARF - KHAKI
06 BLAZER = ORANGE
07 EMBLEM = PINK
08 DAUGHTER = CLARE
The first school is quickly identified with minimal backtracking because the first selected SCARF was wrong.
09 SCHOOL = ST FAITH
10 HAT = PINK
11 SCARF = PINK
12 BLAZER = KHARKI
13 EMBLEM = ORANGE
14 DAUGHTER = BESS
14 DAUGHTER = ALICE
12 BLAZER = TURQUOISE
13 EMBLEM = KHAKI
14 DAUGHTER = DEBBIE
11 SCARF = ORANGE
12 BLAZER = PINK
13 EMBLEM =KHAKI
14 DAUGHTER = DEBBIE
15 SCHOOL = ST IDA
The second school also involved some backtracking because the first selected SCARF was wrong.
16 HAT = KHAKI
17 SCARF = PINK
18 BLAZER = KHAKI
18 BLAZER = TURQUOISE
19 EMBLEM = TURQUOISE
20 DAUGHTER = BESS
20 DAUGHTER = ALIC E
21 SCHOOL = ST ETHELDREADA
The third school only involve in minor backtracks because the number of available option is small.
22 HAT = ORANGE
23 SCARF = TURQUOISE
24 BLAZER =KHAKI
25 EMBLEM = ORANGE
26 DAUGHTER = BESS
27 SCHOOL = ST GERTRUDE
No backtracking is involved for the fourth school as there was no alternative options.
01 SOLUTION FOUND = 1
THE FOLLOWING REPRESENTS A SOLUTION OF TANTALIZER NO 226
01 SOLUTION FOUND = 1
02 TRACE
03 START SELECT = HATS
04 HAT = TURQUOISE
05 SCARF - KHAKI
06 BLAZER = ORANGE
07 EMBLEM = PINK
08 DAUGHTER = CLARE
09 SCHOOL = ST FAITH
10 HAT = PINK
11 SCARF = ORANGE
12 BLAZER = PINK
13 EMBLEM =KHAKI
14 DAUGHTER = DEBBIE
15 SCHOOL = ST IDA
16 HAT = KHAKI
17 SCARF = PINK
18 BLAZER = TURQUOISE
19 EMBLEM = TURQUOISE
20 DAUGHTER = ALICE
21 SCHOOL = ST ETHELDREADA
22 HAT = ORANGE
23 SCARF = TURQUOISE
24 BLAZER =KHAKI
25 EMBLEM = ORANGE
26 DAUGHTER = BESS
27 SCHOOL = ST GERTRUDE
The above is a simple listing of the FACTS (CODIL's short term memory) and the TANTALIZE package had no facility for formatting the answer. However for problems of this kind there would have been no problem in displaying the answer as a table:
| HAT | SCARF | BLAZER | EMBLEM | DAUGHTER | SCHOOL |
1 | TURQUOISE | KHAKI | ORANGE | PINK | CLAIRE | ST FAITH |
2 | PINK | ORANGE | PINK | KHAKI | DEBBIE | ST IDA |
3 | KHAKI | PINK | TURQUISE | TURQUOISE | ALICE | ST ETHELDREDA |
4 | ORANGE | TURQUOISE | KHAKI | ORANGE | BESS | ST GERTRUDE |
After displaying the answer the system continues looking in case there are two answers, This involves some major backtracking - but no further answer is found..
06 BLAZER = TURQUOISE
07 EMBLEM = PINK
08 DAUGHTER = CLAIRE
05 SCARF = ORANGE
06 BLAZER = PINK
07 EMBLEM = KHAKI
SOUUTION FOUND = 1
In batch mode the problem took 57 seconds to solve.
No comments:
Post a Comment