% problem-set/puzzles/carroll/boys.ver1.in % created : 07/09/86 % revised : 07/12/88 % description: % % This run solves a puzzle called "The School Boys" using binary and UR- % resolution. % % The School Boys % % "All the boys, in a certain school, sit together in one % large room every evening. They are of no less than five % nationalities - English, Scotch, Welsh, Irish, and German. % One of the Monitors (who is a great reader of Wilkie Col- % lins' novels) is very observant and takes MS. notes of % almost everything that happens, with the view of being a % good sensational witness, in case any conspiracy to commit a % murder should be afoot. The following are some of his % notes: % % (1) Whenever some of the English boys are singing "Rule, % Britannia," and some not, some of the Monitors are wide % awake; % % (2) Whenever some of the Scotch are dancing reels, and some % of the Irish fighting, some of the Welsh are eating % toasted cheese; % % (3) Whenever all the Germans are playing chess, some of the % Eleven are not oiling their bats; % % (4) Whenever some of the Monitors are asleep, and some not, % some of the Irish are fighting. % % (5) Whenever some of the Germans are playing chess, and % none of the Scotch are dancing reels, some of the Welsh % are not eating toasted cheese. % % (6) Whenever some of the Scotch are not dancing reels, and % some of the Irish are not fighting, some of the Germans % are playing chess; % % (7) Whenever some of the Monitors are awake, and some of % the Welsh are eating toasted cheese, none of the Scotch % are dancing reels; % % (8) Whenever some of the Germans are not playing chess, and % some of the Welsh are not eating toasted cheese, none % of the Irish are fighting; % % (9) Whenever all of the English are singing "Rule, Britan- % nia," and some of the Scotch are not dancing reels, % none of the Germans are playing chess; % % (10) Whenever some of the English are singing "Rule, Britan- % nia,", and some of the Monitors are asleep, some of the % Irish are not fighting; % % (11) Whenever some of the Monitors are awake, and some of % the Eleven are not oiling their bats, some of the % Scotch are dancing reels; % % (12) Whenever some of the English are singing "Rule, Britan- % nia," and some of the Scotch are not dancing reels, ... % % Here the MS. breaks off suddenly. The problem is to com- % plete the sentence, if possible." % - Lewis Carroll % representation: % % Declarative version. Originally created by E. Lusk, and used hyper- % resolution and weights. The solution is clause 114 of the output % file, "-Some_monitors_are_not_awake" set(binary_res). set(UR_res). list(axioms). -Some_English_sing | -Some_English_sing_not | Some_monitors_are_awake. -Some_Scotch_dance | -Some_Irish_fight | Some_Welsh_eat. -Some_Germans_play | Some_Germans_play_not | Some_of_the_eleven_are_not_oiling. -Some_monitors_are_awake | -Some_monitors_are_not_awake | Some_Irish_fight. -Some_Germans_play | Some_Scotch_dance | Some_Welsh_eat_not. -Some_Scotch_dance_not | -Some_Irish_fight_not | Some_Germans_play. -Some_monitors_are_awake | -Some_Welsh_eat | -Some_Scotch_dance. -Some_Germans_play_not | -Some_Welsh_eat_not | -Some_Irish_fight. -Some_English_sing | Some_English_sing_not | - Some_Scotch_dance_not | -Some_Germans_play. -Some_English_sing | -Some_monitors_are_not_awake | Some_Irish_fight_not. -Some_monitors_are_awake | -Some_of_the_eleven_are_not_oiling | Some_Scotch_dance. end_of_list. list(sos). Some_English_sing_not | Some_English_sing. Some_monitors_are_not_awake | Some_monitors_are_awake. Some_Scotch_dance | Some_Scotch_dance_not. Some_Irish_fight | Some_Irish_fight_not. Some_Welsh_eat | Some_Welsh_eat_not. Some_Germans_play | Some_Germans_play_not. Some_English_sing. Some_Scotch_dance_not. end_of_list.