The Smith family and their three children want ...
Move to
=> <=
Darueber Spitze
See also
Job-Shop Scheduling I
Job-Shop Scheduling II
Farmland Management
Smith Puzzle
Portfolio Management
Project Planning
Send More Money
IF Computer > IF/Prolog > Constraint Technology Package > Example Programs > Smith Puzzle

Smith Puzzle

MINERVA superseeded IF/Prolog. Please see http://www.ifcomputer.co.jp/MINERVA for details.

We discontinued to sell IF/Prolog Dec 31. 2003. For current customers, we continue to provide professional support for IF/Prolog until Dec 31, 2008.

The Smith family and their three children want to pay a visit but they do not all have the time to do so. Following are few hints who will go and who will not:

o If Mr Smith comes, his wife will come too. o At least one of their two sons Matt and John will come. o Either Mrs Smith or Tim will come, but not both. o Either Tim and John will come, or neither will come. o If Matt comes, then John and his father will also come.

The following query will solve the problem:

[user]  ?-  Mr_Smith_comes  =>  Mrs_Smith_comes,
|  Matt_comes  \/  John_comes  <=>  1,
|  Mrs_Smith_comes  #  Tim_comes  <=>  1,
|  Tim_comes  <=>  John_comes,
|  Matt_comes  =>  John_comes  /\  Mr_Smith_comes,
|  label(Mr_Smith_comes,  Mrs_Smith_comes,
|  Matt_comes,  John_comes,  Tim_comes]).

Mr_Smith_comes = 0 Mrs_Smith_comes = 0 Matt_comes = 0 John_comes = 1 Tim_comes = 1

yes

read on...
IF/Prolog by Siemens
Sprache
English
Japanese
German
Server
USA
Japan
Site Access
Local Index
Local Contents
Site Contents
Site Index
Printer Friendly
For imode
For PDA
Search
document: http://www.ifcomputer.co.jp/IFProlog/Constraints/ExamplePrograms/SmithPuzzle/home_de.html
published 2008/5/12 update 1996/12/10 (c) 1996-2006 IF Computer Japan
IF Computer 5-28-2 Sendagi, Bunkyo-ku Tel +81-3-5814-3352 info@ifcomputer.com
Customer Support Tokyo 113-0022 Japan   http://www.ifcomputer.com
scroll to top managed with ubiCMS