You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
sicp-all-tasks/sicp/4_002e43

18 lines
779 B

Exercise 4.43: Use the amb evaluator to
solve the following puzzle:253
Mary Ann Moore’s father has a yacht and so has each of his four friends:
Colonel Downing, Mr. Hall, Sir Barnacle Hood, and Dr. Parker. Each of the
five also has one daughter and each has named his yacht after a daughter of one
of the others. Sir Barnacle’s yacht is the Gabrielle, Mr. Moore owns the
Lorna; Mr. Hall the Rosalind. The Melissa, owned by Colonel Downing, is named
after Sir Barnacle’s daughter. Gabrielle’s father owns the yacht that is named
after Dr. Parker’s daughter. Who is Lorna’s father?
Try to write the program so that it runs efficiently (see Exercise 4.40).
Also determine how many solutions there are if we are not told that Mary Ann’s
last name is Moore.