HomeHome More SamplesMore Samples
///////////////////////////////////////////////////////////////////////////////
//
// Title: Breaking News
// Author: Faith Johnson
// Publication: Dell Logic Puzzles
// Issue: April, 1998
// Page: 9
// Stars: 1
// 
// The Daily Galaxy sent its four best reporters (Corey, Jimmy, Lois, and Perry) 
// to different locations (Bayonne, New Hope, Port Charles, and South Amboy) to 
// cover four breaking news events (30-pound baby, blimp launching, skyscraper 
// dedication, and beached whale). Their editor is trying to remember where each
// of the reporters is. Can you match the name of each reporter with the place 
// he or she was sent, and the event that each covered?
// 
// 1. The 30-pound baby wasn't born in South Amboy or New Hope.
// 2. Jimmy didn't go to Port Charles.
// 3. The blimp launching and the skyscraper dedication were covered, in some 
//    order, by Lois and the reporter who was sent to Port Charles.
// 4. South Amboy was not the site of either the beached whale or the skyscraper 
//    dedication.
// 5. Bayonne is either the place that Corey went or the place where the whale 
//    was beached, or both.
// 
///////////////////////////////////////////////////////////////////////////////
//
// query: 
//          all BreakingNews(location,story)
//
///////////////////////////////////////////////////////////////////////////////
//
// result:
//
// location = [ {Corey} Bayonne, {Jimmy} New_Hope, {Lois} South_Amboy, 
//              {Perry} Port_Charles]
// story    = [ {Corey} Baby, {Jimmy} Whale, {Lois} Blimp, {Perry} Skyscraper]    
//
///////////////////////////////////////////////////////////////////////////////

Reporters = Corey | Jimmy | Lois | Perry
Locations = Bayonne | New_Hope | Port_Charles | South_Amboy
News = Baby | Blimp | Skyscraper | Whale

Location = Reporters->>Locations
Story = Reporters->>News

pred BreakingNews(location::Location,story::Story) iff
{1} story(x1) = Baby & location(x1) <> South_Amboy & location(x1) <> New_Hope &
{2} location(Jimmy) <> Port_Charles &
{3} location(x3) = Port_Charles &
    (
    (story(Lois) = Blimp & story(x3) = Skyscraper) |
    (story(x3) = Blimp & story(Lois) = Skyscraper)
    ) &
{4} story(x4) = Skyscraper & story(y4) = Whale & 
    location(x4) <> South_Amboy & location(y4) <> South_Amboy &
{5} (Bayonne = location(Corey) | (Bayonne = location(x5) & story(x5) = Whale))









This page was created by F1toHTML