home *** CD-ROM | disk | FTP | other *** search
/ Acorn User 2 / AUCD2.iso / program / huprolog.arc / a next >
Text File  |  1995-02-08  |  3KB  |  103 lines

  1.  
  2. % THE UNDEVELOPED DATA IS IN "Tales".
  3.  
  4. episode :-      
  5.         tab(15),
  6.         write('" ALL AT SEA. "'),nl,
  7.         tab(15),
  8.         write('-------------------------.'),nl,nl.
  9.  
  10. /*
  11. In 1719, the year that "Robinson Crusoe" was first published, five 
  12. real-life shipwrecked mariners who had been marooned on distant islands
  13. were rescued and brought back to Britain. From the clues below, can you 
  14. work out each man's name, his rank and ship, which sea it was lost in, 
  15. and in which year he was marooned ?.
  16.  
  17. 1. Hugh Flint had served on a ship with a two-letter name.
  18.  
  19. 2. Ironically, it was because he stayed with his ship that captain John 
  20.    Moody wasn't drowned with his crew.
  21.  
  22. 3. The ship whose first mate was marooned for three years wasn't the 
  23.    Bristol Lass.
  24.  
  25. 4. The Gryphon went down in a Caribbean hurricane.
  26.  
  27. 5. Will Tweed of the Dog Star was shipwrecked before the able seaman but
  28.    after the man who survived the loss of his ship in the Timor Sea, who
  29.    wasn't Hugh Flint.
  30.  
  31. 6. It was in 1713 that one man was shipwrecked in the Indian Ocean.
  32.  
  33. 7. Both Ben Duncan, who was marooned on an island in the South Pacific, 
  34.    and the man shipwrecked in 1704 were ship's officers, unlike the man 
  35.    who survived the loss of the Alexander.
  36. */
  37.  
  38. group([ad1716,ad1713,ad1710,ad1707,ad1704]).
  39. group([ben,hugh,john,tom,will]).
  40. group([ab,captain,cook,mate1,mate2]).
  41. group([alexander,bristollass,dogstar,gryphon,stsimeon]).
  42. group([caribbean,indianocean,seaofjapan,southpacific,timorsea]).
  43.  
  44. c(captain,john).
  45. c(ad1716,mate1).
  46. c(gryphon,caribbean).
  47. c(will,dogstar).
  48. c(ad1713,indianocean).
  49. c(ben,southpacific).
  50.  
  51. i(hugh,alexander).
  52. i(hugh,gryphon).
  53. i(ad1716,bristollass).
  54. i(will,ab).
  55. i(will,timorsea).
  56. i(will,ad1716).
  57. i(will,ad1713).
  58. i(will,indianocean).
  59. i(will,ad1704).
  60. i(ab,ad1704).
  61. i(ab,ad1707).
  62. i(timorsea,ad1716).
  63. i(ab,timorsea).
  64. i(timorsea,hugh).
  65. i(ben,ad1704).
  66. i(ben,ab).
  67. i(ben,alexander).
  68. i(ben,cook).
  69. i(ad1704,ab).
  70. i(ad1704,cook).
  71. i(ad1704,alexander).
  72. i(alexander,captain).
  73. i(alexander,mate1).
  74. i(alexander,mate2).
  75.  
  76. % The following data has to be reconsidered due to an 
  77. % "Insufficient data." signal which will be evident where only
  78. % the simple facts above are offered. 
  79.  
  80. %  Will Tweed was shipwrecked before the ab.
  81. %  The ab was NOT shipwrecked in 1716.
  82. %  Will Tweed was shipwrecked before the ab.
  83. %  Will Tweed was shipwrecked after the Timor Sea man.
  84. %  Hence Will was not shipwrecked in 1704, 1713 or 1716.
  85. %  Hence Will was shipwrecked in 1707 or 1710.
  86. %  The ab was shipwrecked in either 1707 or 1710, or 1713.
  87. %  The Timor Sea man was shipwrecked in 1704 or 1707.
  88.  
  89. % Constructions to deal with the newly developed data could take 
  90. % the form:            
  91.  
  92.  do :-
  93.     i(timorsea,ad1704),     % Then c(timorsea,ad1707) obtains. 
  94.     bar(c(will,ad1710)),   
  95.     assert(c(will,ad1710)),  
  96.     fail.
  97.  
  98.  do :-
  99.     i(timorsea,ad1707),     % Then c(timorsea,ad1704) obtains. 
  100.     bar(c(will,ad1707)),
  101.     assert(c(will,ad1707)),
  102.     fail.
  103.