Posted by on 2017年3月19日

I.房子顺序（简称OH, Order of house, 以从左到右建立1D坐标系）：

$OH(a)=num$

II.房子颜色（简称CH, Colour of house）： ${CH}_1=$红，${CH}_2=$绿，${CH}_3=$白，${CH}_4=$黄，${CH}_5=$蓝；
III.主人国籍（简称NA, Nationality）: ${NA}_1=$英国，${NA}_2=$瑞典，${NA}_3=$丹麦，${NA}_4=$挪威，${NA}_5=$德国；
IV.喜爱的饮料（简称DR, Drink）: ${DR}_1=$茶，${DR}_2=$咖啡，${DR}_3=$牛奶，${DR}_4=$啤酒，${DR}_5=$水；
V.喜爱的烟品牌（简称BC, Brand of Cigarette）: ${BC}_1=$Pall Mall, ${BC}_2=$Dunhill, ${BC}_3=$Blends, ${BC}_4=$Bluemasters, ${BC}_5=$Prince;
VI.养的宠物（简称PE, Pets）: ${PE}_1=$狗，${PE}_2=$鸟，${PE}_3=$猫，${PE}_4=$马，${PE}_5=$鱼（题目问的是鱼，当然最后一个题干中未说明的未知宠物便是鱼。）

1. 英国人住在红色房子里；
2. 瑞典人养着狗；
3. 丹麦人爱喝茶；
4. 绿色房子在白色房子左边；
5. 绿色房子的主人爱喝咖啡；
6. 抽Pall Mall香烟品牌的人养鸟；
7. 黄色房子的主任抽Dunhills(喜路登)品牌香烟;
8. 位置在中间的房子的主任爱喝牛奶；
9. 挪威人住在第一幢房子里；
10. 抽Blend品牌香烟的人有个养猫的邻居；
11. 抽Blue Masters品牌香烟的人爱喝啤酒；
12. 养马的人住在抽Dunhill香烟品牌的人隔壁；
13. 德国人抽Prince品牌香烟；
14. 挪威人住在蓝色房子隔壁；
15. 抽Blend品牌香烟的人有个爱喝水的邻居；

$Cor(a,b)=1$

1. $Cor({NA}_1,{CH}_1)$;
2. $Cor({NA}_2,{PE}_1)$;
3. $Cor({NA}_3,{DR}_1)$;
4. $OH({CH}_2)=OH({CH}_3)-1$;
5. $Cor({CH}_2,{DR}_2)$;
6. $Cor({BC}_1,{PE}_2)$;
7. $Cor({CH}_4,{BC}_2)$;
8. $OH({DR}_3)=3$;
9. $OH({NA}_4)=1$ or $OH({NA}_4)=5$;
10. $OH({BC}_3)=OH({PE}_3)\pm 1$;
11. $Cor({BC}_4,{DR}_4)$;
12. $OH({PE}_4)=OH({BC}_2)\pm 1$;
13. $Cor({NA}_5,{BC}_5)$;
14. $OH({NA}_4)=OH({CH}_5)\pm 1$;
15. $OH({BC}_3)=OH({DR}_5)\pm 1$.

OH CH NA DR BC __1__ __2__ __3__ __4__ __5__ _____ ${CH}_5$ _____ _____ _____ ${NA}_4$ _____ _____ _____ _____ _____ _____ ${DR}_3$ _____ _____ _____ _____ _____ _____ _____ _____ _____ _____ _____ _____

OH CH NA DR BC __1__ __2__ __3__ __4__ __5__ _____ ${CH}_5$ ${CH}_2$ ${CH}_3$ _____ ${NA}_4$ _____ _____ _____ _____ _____ _____ ${DR}_3$ _____ _____ _____ _____ _____ _____ _____ _____ _____ _____ _____ _____

OH CH NA DR BC __1__ __2__ __3__ __4__ __5__ _____ ${CH}_5$ _____ ${CH}_2$ ${CH}_3$ ${NA}_4$ _____ _____ _____ _____ _____ _____ ${DR}_3$ ${DR}_2$ _____ _____ _____ _____ _____ _____ _____ _____ _____ _____ _____

$\rightarrow$$OH({CH}_1)=3$，同时得出
$\rightarrow$$OH({NA}_1)=3$

$\rightarrow$$OH({CH}_4)=1$

OH CH NA DR BC __1__ __2__ __3__ __4__ __5__ ${CH}_4$ ${CH}_5$ ${CH}_1$ ${CH}_2$ ${CH}_3$ ${NA}_4$ _____ ${NA}_1$ _____ _____ _____ _____ ${DR}_3$ ${DR}_2$ _____ ${BC}_2$ _____ _____ _____ _____ _____ ${PE}_4$ _____ _____ _____

$OH({DR}_4)=5$
$OH({BC}_4)=5$从而$\rightarrow$$OH({DR}_5)=1$

OH CH NA DR BC __1__ __2__ __3__ __4__ __5__ ${CH}_4$ ${CH}_5$ ${CH}_1$ ${CH}_2$ ${CH}_3$ ${NA}_4$ ${NA}_3$ ${NA}_1$ _____ _____ ${DR}_5$ ${DR}_1$ ${DR}_3$ ${DR}_2$ ${DR}_4$ ${BC}_2$ ${BC}_3$ _____ _____ ${BC}_4$ _____ ${PE}_4$ _____ _____ _____

$OH({NA}_5)=4$
$OH({BC}_5)=4$从而$\rightarrow$
$OH({NA}_2)=5$
$OH({BC}_1)=3$

OH CH NA DR BC __1__ __2__ __3__ __4__ __5__ ${CH}_4$ ${CH}_5$ ${CH}_1$ ${CH}_2$ ${CH}_3$ ${NA}_4$ ${NA}_3$ ${NA}_1$ ${NA}_5$ ${NA}_2$ ${DR}_5$ ${DR}_1$ ${DR}_3$ ${DR}_2$ ${DR}_4$ ${BC}_2$ ${BC}_3$ ${BC}_1$ ${BC}_5$ ${BC}_4$ ${PE}_3$ ${PE}_4$ ${PE}_2$ _____ ${PE}_1$

${CH}_2=$绿色房子
${NA}_5=$德国人
${DR}_2=$爱喝咖啡
${CI}_5=$爱抽Prince品牌香烟

OH CH NA DR BC __1__ __2__ __3__ __4__ __5__ ${CH}_2$ ${CH}_3$ ${CH}_1$ ${CH}_5$ ${CH}_4$ ${NA}_5$ ${NA}_2$ ${NA}_1$ ${NA}_3$ ${NA}_4$ ${DR}_2$ ${DR}_4$ ${DR}_3$ ${DR}_1$ ${DR}_5$ ${BC}_5$ ${BC}_4$ ${BC}_1$ ${BC}_3$ ${BC}_2$ _____ ${PE}_1$ ${PE}_2$ ${PE}_4$ ${PE}_3$

A more fruitful approach to logic was developed in the 1970s by Robert Kowalski at the University of Edinburgh, and soon this led to the collaboration with French researchers Alain Colmerauer and Philippe Roussel who created the successful logic programming language Prolog. Prolog uses a subset of logic (Horn clauses, closely related to "rules" and "production rules") that permit tractable computation. Rules would continue to be influential, providing a foundation for Edward Feigenbaum's expert systems and the continuing work by Allen Newell and Herbert A. Simon that would lead to Soar and their unified theories of cognition.

【欢迎关注微信公众号饱蠹阁BaoDuGe
[arrow_forms id='119']