1. ã¯ããã«
ããã°ã©ãã³ã°èšèªã®äžã§ããPrologã¯ç¬ç¹ãªååšæãæã¡ãå€ãã®æè¡è ãåŠçãäžåºŠã¯ååãèããããšãããã§ããããããããå®éã«ãã®æ©èœãç¹åŸŽãé åã«è§Šããããšãããæ¹ã¯å°ãªããããããŸããããã®èšäºã§ã¯ãPrologã®åºæ¬ãããå®éã®ãããžã§ã¯ãã§ã®æåäºäŸãŸã§ãç¶²çŸ çã«ã玹ä»ããŸãã
1.1 Prologã®ç¹åŸŽãšé å
Prologã¯ãè«çåããã°ã©ãã³ã°èšèªãšããŠç¥ããããã®ååã¯ãProgramming in Logicããã掟çããŠããŸãã以äžã¯ãPrologã®äž»ãªç¹åŸŽãšé åã«ãªããŸãã
ç¹åŸŽ | 詳现 |
---|---|
è«çåããã°ã©ãã³ã° | äºå®ãã«ãŒã«ãå®çŸ©ããããã«åºã¥ããŠè³ªåãæšè«ãè¡ãããšãã§ããŸãã |
ããã¯ãã©ããã³ã°æ©èœ | 解ã®åè£ãæ¢çŽ¢ããé©åãªçããèŠã€ããããã®èªåçãªææ³ãæäŸããŸãã |
æè»æ§ | ç¥èè¡šçŸãAIåéã§ã®å©çšãåŸæã§ãè€éãªåé¡ãå¹ççã«åŠçããããšãã§ããŸãã |
ãã®ãããªç¹åŸŽãæã€Prologã¯ãç¹å®ã®åé¡é åã«ãããŠéåžžã«ãã¯ãã«ã§ãããšãšãã«ãæ°ããããã°ã©ãã³ã°ã®èŠç¹ãæäŸããŠãããŸãã
1.2 ãã®èšäºã®å¯Ÿè±¡èªè
æ¬èšäºã¯ãPrologã«åããŠè§Šããæ¹ãããããŸã§èããããšã¯ããããã©å®éã«ã©ã®ãããªãã®ãªã®ããç¥ããããšããæ¹ãäž»ãªã¿ãŒã²ãããšããŠããŸãããŸããå ·äœçãªãããžã§ã¯ãã®äºäŸãéããŠãPrologã®å¯èœæ§ãå¿çšæ¹æ³ãç解ãããæ¹ã«ãããããã§ãã
æè¡çãªæ·±ãéšåã«è§Šããããšã¯é¿ããŠãããããããèšèãšäŸãçšããŠè§£èª¬ããŠãããŸããããã«ãããèªè ã®æ¹ã ãPrologã®é åãšå¯èœæ§ãååã«æãåããããšãç®æããŠããŸãã
2. Prologã®åºç€ç¥è
å€ãã®ããã°ã©ã èšèªãååšããäžãPrologã¯ãã®ãŠããŒã¯ãªç¹æ§ããäžéç®ç«ã€ååšã§ãããããããã®å®æ ãæŽå²ããããŠåºæ¬çãªä»çµã¿ãç解ããããšã§ãPrologã®é åã䜿çšã·ãŒã³ãããæ確ã«ãªããŸãã
2.1 Prologã®æŠèŠãšæŽå²
Prologã¯ã1970幎代åé ã«ãã©ã³ã¹ã§éçºãããããã°ã©ãã³ã°èšèªã§ããå ã ã¯èªç¶èšèªåŠçã®ããã®ããŒã«ãšããŠèããããŠããŸãããããã®åŸãç¥èè¡šçŸãæšè«ã¿ã¹ã¯ã«éåžžã«é©ããŠããããšãçºèŠãããŸããã
ç¹ã«ã人工ç¥èœç 究ã®äžã§ãã®èœåã泚ç®ããããšãã¹ããŒãã·ã¹ãã ãç¥èããŒã¹ã®æ§ç¯ã«å©çšãããããã«ãªããŸããããã®èæ¯ãããPrologã¯AIã®çºå±ãšãšãã«ãã®å°äœã確ç«ããŠãããŸããã
2.2 ç¥èè¡šçŸãšæšè«ã®åºæ¬
Prologã®æ倧ã®ç¹åŸŽã¯ãè«ççãªç¥èè¡šçŸãšããã«åºã¥ãæšè«èœåã«ãããŸããèšèªèªäœããäºå®ãã«ãŒã«ãå®çŸ©ããã®ã«é©ããŠããããããã®æ å ±ãåºã«ããŠè€éãªè³ªåã«çããããšãã§ããŸãã
äŸãã°ãããåç©ãé³¥ã§ããå Žåããã®åç©ãé£ã¶ããšãæšè«ãããšãã£ãã·ã³ãã«ãªç¥èããPrologã§ã¯ç°¡åã«è¡šçŸã§ããŸããããã«ãããå ·äœçãªããŒã¿ã ãã§ãªããæœè±¡çãªã«ãŒã«ãé¢ä¿ãããã°ã©ã å ã«çµã¿èŸŒãããšãã§ããŸãã
2.3 Prologã®åºæ¬ææ³ãšæ§é
Prologã®åºæ¬çãªææ³ã¯ãäºå®ãã«ãŒã«ã質åã®3ã€ã®èŠçŽ ããæãç«ã£ãŠããŸãã
èŠçŽ | 説æ |
---|---|
äºå® | å ·äœçãªæ å ±ãããŒã¿ãå®çŸ©ããŸããäŸ:ã倪éã¯äººéã§ããããšããæ å ±ã |
ã«ãŒã« | ããæ¡ä»¶äžã§ã®æ¯ãèããé¢ä¿ãå®çŸ©ããŸããäŸ:ãå šãŠã®äººéã¯çç©ã§ããããšããã«ãŒã«ã |
質å | äºå®ãã«ãŒã«ã«åºã¥ããŠæ å ±ãååŸããããã®ã¯ãšãªãäŸ:ã倪éã¯çç©ã§ãããïŒããšãã質åã |
ãã®3ã€ã®èŠçŽ ãçµã¿åãããããšã§ãPrologã«ã¯ç¬ç¹ãªããã°ã©ã ã®æ§é ã圢æãããŸããããã«ãããä»ã®ããã°ã©ã èšèªãšã¯ç°ãªãæèãã¢ãããŒãã§åé¡ã解決ããããšãå¯èœãšãªããŸãã
3. Prologãããžã§ã¯ãå®äŸ1: æšè«ããŒã¹ã®ã·ã§ããã³ã°ã¢ã·ã¹ã¿ã³ã
è¿å¹Žãã·ã§ããã³ã°ã®é åã«ãããŠã人工ç¥èœæè¡ã®å°å ¥ãé²ããããŠããŸããç¹ã«Prologãå©çšããæšè«ããŒã¹ã®ã·ã§ããã³ã°ã¢ã·ã¹ã¿ã³ãã¯ã賌買çµéšãäžå±€åäžãããããã®ææãªæè¡ãšããŠæ³šç®ãããŠããŸãã
3.1 ãããžã§ã¯ãã®èæ¯ãšç®ç
ãªã³ã©ã€ã³ã·ã§ããã³ã°ãæ¥åžžåããäžãæ¶è²»è ã¯å€çš®å€æ§ãªååã®äžããæé©ãªãã®ãéžã³åºãã®ãé£ãããªã£ãŠããŸãããã®èª²é¡ã«å¯ŸããŠãæšè«ããŒã¹ã®ã·ã§ããã³ã°ã¢ã·ã¹ã¿ã³ãã¯ããŠãŒã¶ãŒã®éå»ã®è³Œå ¥å±¥æŽã奜ã¿ãããã«ã¯è³ªåå¿çãéããŠãæãé©ããååãæšèŠããæ©èœãæã£ãŠããŸãã
3.2 å®è£ ã®ãã€ã³ã
ãã®ã·ã§ããã³ã°ã¢ã·ã¹ã¿ã³ãã®äžå¿ãšãªãã®ã¯ãPrologã®æšè«ãšã³ãžã³ã§ãããŠãŒã¶ãŒããã®è³ªåã奜ã¿ãäºå®ãšããŠããŒã¿ããŒã¹ã«æ ŒçŽãããããåºã«ã«ãŒã«ãé©çšããŠæšèŠååãå°ãåºããŸãã
äŸãã°ããŠãŒã¶ãŒãéå»ã«ãšã³ãã¬ã³ããªãŒãªååãå€ãè³Œå ¥ããŠããå Žåãã·ã¹ãã ã¯ããã®ãŠãŒã¶ãŒã¯ç°å¢ã«åªããååã奜ãããšããäºå®ãçæããŸããããã«åºã¥ããŠãæ°ããååã®äžããç°å¢ã«åªãããã®ãæšèŠãããšããæµãã§ãã
å®è£ èŠçŽ | 詳现 |
---|---|
ãŠãŒã¶ãŒããŒã¿ããŒã¹ | ãŠãŒã¶ãŒã®è³Œå ¥å±¥æŽã奜ã¿ãæ ŒçŽããéšåãPrologã®äºå®ãšããŠå©çšãããŸãã |
æšè«ã«ãŒã« | ãŠãŒã¶ãŒã®ããŒã¿ãåºã«ååãæšèŠããããã®ã«ãŒã«ãäŸ: ãç°å¢ã«åªããååã奜ããŠãŒã¶ãŒã«ã¯ããšã³ãã¬ã³ããªãŒãªæ°ååãæšèŠãããã |
質åå¿çæ©èœ | ãŠãŒã¶ãŒã®çŽæ¥ã®è³ªåã«å¿ããŠãé©åãªååãæšèŠããæ©èœã |
3.3 æåäºäŸã®èŠå ãšåŠã³
ãã®ãããžã§ã¯ããæåããèŠå ã¯ãPrologã®é«åºŠãªæšè«èœåãšãŠãŒã¶ãŒäžå¿ã®ã¢ãããŒãã«ãããŸãããåŸæ¥ã®æšèŠã·ã¹ãã ãšç°ãªãããŠãŒã¶ãŒã®ããŒãºãæ·±ãç解ããããšã§ãããããŒãœãã©ã€ãºãããã·ã§ããã³ã°äœéšãå®çŸããããšãã§ããŸããã
ãã®ãããžã§ã¯ãããåŠã¹ãããšã¯å€ã ãããŸãããç¹ã«æè¡ãšãŠãŒã¶ãŒããŒãºã®çµã³ã€ãã®éèŠæ§ãåèªèããããšãã§ããŸãããŸããæ°ããæè¡ã®å°å ¥ã¯ããããã©ã®ããã«æŽ»çšããããæåã®éµãšãªãããšã瀺ããŠããŸãã
4. Prologãããžã§ã¯ãå®äŸ2: ãªã³ã©ã€ã³åç©é€šã®ã¬ã€ãããã
ããžã¿ã«æè¡ã®é²å±ã¯ãäŒçµ±çãªåç©é€šäœéšãå€é©ããŠããŸããç¹ã«Prologãå©çšãããªã³ã©ã€ã³åç©é€šã®ã¬ã€ããããã¯ã蚪åè ã«æ·±ãç¥èãèå³ãæã£ãŠãããããã®æ°ããæ段ãšããŠæ³šç®ãããŠããŸãã
4.1 ãããžã§ã¯ãã®èæ¯ãšç®ç
æ°åã³ãããŠã€ã«ã¹ã®åœ±é¿ã§ãå€ãã®åç©é€šãäžæçã«ééããããªã³ã©ã€ã³ã§ã®å±ç€ºãæ±ããããããã«ãªããŸããããã®äžã§ãåç©é€šã®å±ç€ºç©ãæŽå²ã«é¢ããç¥èãæ·±ãäŒãã蚪åè ã®é¢å¿ãåŒãã€ããããã®æ°ããæ¹æ³ãå¿ èŠãšãããŸããã
ãã®ããŒãºã«çãã圢ã§ããªã³ã©ã€ã³åç©é€šã®ã¬ã€ãããããéçºãããŸããããã®ãããã¯ã蚪åè ã®è³ªåã«çããã ãã§ãªããé¢é£ããå±ç€ºç©ãèæ¯æ å ±ãæäŸããããšã§ãäžæ®µãšãªãããªåç©é€šäœéšãå®çŸããŠããŸãã
4.2 å®è£ ã®ãã€ã³ã
ã¬ã€ããããã®é åã¯ãPrologã®æšè«ãšã³ãžã³ã掻çšããæ å ±æäŸèœåã«ãããŸãã蚪åè ãããå±ç€ºç©ã«é¢ãã質åããããšããããã¯é¢é£ããäºå®ãèæ¯æ å ±ãããŒã¿ããŒã¹ããåŒãåºããé©åãªåçãçæããŸãã
ããã«ã蚪åè ã®è³ªåå±¥æŽãé¢å¿ãåºã«ã次ã«èŠãã¹ãå±ç€ºç©ãããŒããææ¡ããããšãå¯èœã§ãããã®ãããªã¢ãããŒãã«ããããªã³ã©ã€ã³ã§ãçŸå°ã®åç©é€šåæ§ã®æ å ±éãšæ·±ã¿ãæã£ãäœéšãå¯èœãšãªããŸããã
å®è£ èŠçŽ | 詳现 |
---|---|
質åå¿çæ©èœ | 蚪åè ã®è³ªåã«å¿ããŠãé¢é£ããå±ç€ºç©ãèæ¯æ å ±ãæäŸããæ©èœã |
æšèŠã·ã¹ãã | 蚪åè ã®èå³ã質åå±¥æŽãåºã«ã次ã«èŠãã¹ãå±ç€ºç©ãææ¡ããæ©èœã |
4.3 æåäºäŸã®èŠå ãšåŠã³
ãã®ãããžã§ã¯ããæåããèŠå ãšããŠã蚪åè äžå¿ã®ã¢ãããŒããšPrologã®é«ãç¥èè¡šçŸã»æšè«èœåã®çµã¿åãããæããããŸãããªã³ã©ã€ã³ãšããæ°ããç°å¢ã§ã®åç©é€šäœéšãå®çŸãããããæè¡ãšå 容ã®äž¡æ¹ã§ã®é©æ°ãæ±ããããŸããã
ãã®ãããžã§ã¯ãããåŸãããåŠã³ã¯ãæ°ããç°å¢äžã§ã質ã®é«ãæ å ±æäŸãäœéšãå®çŸããããšããæè¡ãšé©åãªèšèšã«ãã£ãŠå¯èœã§ãããšããããšã§ãããŸããäŒçµ±çãªé åã§ãã£ãŠããæè¡ã®é©åãªæŽ»çšã«ãã£ãŠæ°ãã䟡å€ãçã¿åºãããšãã§ããããšã瀺ããŠããŸãã
5. Prologãããžã§ã¯ãå®äŸ3: ã¹ããŒãããŒã ã®èªåå¶åŸ¡
è¿å¹Žã®ã¹ããŒãããŒã ã®æ®åã«äŒŽãã家ã®äžã®ããã€ã¹ãããè³¢ããèªåã§å¶åŸ¡ããããã®æè¡ãæ±ããããŠããŸããPrologã掻çšããã¹ããŒãããŒã ã®èªåå¶åŸ¡ã·ã¹ãã ã¯ããã®åãã®æåç·ã«äœçœ®ããŠããŸãã
5.1 ãããžã§ã¯ãã®èæ¯ãšç®ç
ã¹ããŒãããŒã æè¡ã®èåŸã«ã¯ãäœæ°ã®å¿«é©ãããšãã«ã®ãŒå¹çã®æé©åãšãã£ãç®çããããŸããããããå€ãã®ããã€ã¹ãã»ã³ãµãŒãå¹æçã«å¶åŸ¡ããããã«ã¯ãé«åºŠãªè«çåŠçãæšè«èœåãå¿ èŠã§ãã
ãã®åé¡ã解決ãããããPrologãå©çšããèªåå¶åŸ¡ã·ã¹ãã ãéçºãããŸããããã®ã·ã¹ãã ã¯ãã»ã³ãµãŒããã®æ å ±ããŠãŒã¶ãŒã®èšå®ãããšã«ã家ã®äžã®ããã€ã¹ãé©åã«å¶åŸ¡ããŸãã
5.2 å®è£ ã®ãã€ã³ã
Prologã®äž»èŠãªç¹åŸŽã§ãããç¥èè¡šçŸãšæšè«æ©èœã¯ãã¹ããŒãããŒã ã®èªåå¶åŸ¡ã«ãããŠéåžžã«æçšã§ããããšãã°ãçªã®ã»ã³ãµãŒãéšãæç¥ããå Žåãèªåçã«çªãéãããšãã£ãããžãã¯ãç°¡åã«å®è£ ããããšãã§ããŸãã
ããã«ãPrologã掻çšããããšã§ããŠãŒã¶ãŒã®å¥œã¿ãéå»ã®è¡åå±¥æŽãèæ ®ããäŸãã°ç §æã®æãããéšå±ã®æž©åºŠãåçã«èª¿æŽãããšãã£ãé«åºŠãªå¶åŸ¡ãå¯èœãšãªããŸãã
å®è£ èŠçŽ | 詳现 |
---|---|
ã»ã³ãµãŒæ å ±ã®åã蟌㿠| åçš®ã»ã³ãµãŒããã®æ å ±ããªã¢ã«ã¿ã€ã ã§ååŸããé©åãªå¶åŸ¡ãè¡ããŸãã |
åçãªå¶åŸ¡ | ãŠãŒã¶ãŒã®å¥œã¿ãè¡åå±¥æŽãåºã«ãããã€ã¹ã®å¶åŸ¡ãåçã«èª¿æŽããæ©èœã |
5.3 æåäºäŸã®èŠå ãšåŠã³
ãã®ãããžã§ã¯ãã®æåã¯ãPrologã®é«ãç¥èè¡šçŸèœåãšæšè«èœåããããŠãŠãŒã¶ãŒäžå¿ã®ã¢ãããŒãã®çµã¿åããã«ãããã®ã§ããã¹ããŒãããŒã ã®èªåå¶åŸ¡ã«ãããŠã¯ãåã«ããã€ã¹ãå¶åŸ¡ããã ãã§ãªããäœæ°ã®å¿«é©ããå®å šæ§ãæ倧åããããšãéèŠã§ãã
ãã®ãããžã§ã¯ãããåŸãããåŠã³ãšããŠã¯ãæ°ããæè¡ãå°å ¥ããéã«ããã®æè¡ã®ç¹æ§ãæ倧éã«æŽ»çšãããŠãŒã¶ãŒã®ããŒãºãæåŸ ãæºããããšã®éèŠæ§ãæããããŸãã
6. Prologã掻çšããããã®ãã³ã
Prologã¯ãç¹ã«ç¥èè¡šçŸãæšè«ã¿ã¹ã¯ã«é©ãã匷åãªèšèªã§ãããããããã®ç¬ç¹ãªææ³ãæŠå¿µã¯ãåããŠã®æ¹ã«ãšã£ãŠã¯é£ããæãããããããŸããããã®ã»ã¯ã·ã§ã³ã§ã¯ãPrologãå¹æçã«æŽ»çšããããã®ãã³ããããŒã«ã玹ä»ããŸãã
6.1 ãããžã§ã¯ãéå§æã®ãã€ã³ã
æ°ãããããžã§ã¯ããéå§ããéããŸãæ確ãªç®çãèšå®ããããšãéèŠã§ããPrologã¯ãã®ç¹æ§ãçãããé åã§ã®å©çšãæãå¹æçã§ããäŸãã°ãæšè«ããŒã¹ã®ã¿ã¹ã¯ãç¥èããŒã¹ã®ã·ã¹ãã æ§ç¯ãªã©ãèããããŸãã
ãŸããPrologã®ç¬ç¹ãªç¹æ§ãææ³ãç解ããããã®åºç€çãªææããªãœãŒã¹ãçšæããããšããã¹ã ãŒãºãªéçºã®éµãšãªããŸãã
6.2 Prologã®ã©ã€ãã©ãªãšããŒã«çŽ¹ä»
Prologã«ã¯å€ãã®ã©ã€ãã©ãªãããŒã«ãååšãããããã掻çšããããšã§éçºã®å¹çã倧ããäžããããšãã§ããŸããç¹ã«ãSWI-Prologã¯ããªãŒãã³ãœãŒã¹ã®Prologç°å¢ãšããŠéåžžã«äººæ°ããããè±å¯ãªã©ã€ãã©ãªãããã¥ã¡ã³ããæäŸãããŠããŸãã
ã©ã€ãã©ãª/ããŒã«å | 説æ |
---|---|
SWI-Prolog | 人æ°ã®é«ããªãŒãã³ãœãŒã¹ã®Prologç°å¢ãå€ãã®ã©ã€ãã©ãªãããŒã«ãå«ãŸããŠããã |
Logtalk | ãªããžã§ã¯ãæåã®æŠå¿µãPrologã«åãå ¥ããããã®ããŒã«ã |
6.3 ãããã°ãšæé©åã®ã³ã
Prologã®ãããã°ã¯ãäžè¬çãªããã°ã©ãã³ã°èšèªãšã¯å°ãç°ãªãã¢ãããŒããå¿ èŠãšãªããŸãããŸãããã¬ãŒã¹ãå©çšããŠãããã°ã©ã ã®å®è¡éçšã詳现ã«è¿œãããšãã§ããŸããããã«ãããã©ã®éšåã§æšè«ãåæ¢ããã®ããã©ã®ã«ãŒã«ãé©çšãããã®ãã確èªããããšãã§ããŸãã
æé©åã®éã«ã¯ãã¯ãšãªã®å®è¡èšç»ãçµæã®ãã£ãã·ã¥ãå©çšããŠãå¹ççãªåŠçãå®çŸããããšãéèŠã§ãããŸããäžèŠãªã«ãŒã«ãè¿°èªãåé€ããããšã§ãããã°ã©ã ã®èªã¿èŸŒã¿ãå®è¡é床ãåäžãããããšãå¯èœã§ãã
7. ãŸãšã
æ¬èšäºãéããŠãPrologã®åºæ¬ããå¿çšã«è³ããŸã§ã®ããŸããŸãªæ å ±ãæäŸããŸããããã®åŒ·åãªããã°ã©ãã³ã°èšèªã¯ãå€å²ã«ããããããžã§ã¯ãã§ã®å¿çšãæåŸ ãããŠããŸãã
7.1 Prologã®å¯èœæ§ã®æ¡ãã
Prologã¯ãåŸæ¥ããç¥èè¡šçŸãæšè«ã¿ã¹ã¯ã«ãã®åãçºæ®ããŠããŸãããè¿å¹Žã§ã¯ãã·ã§ããã³ã°ã¢ã·ã¹ã¿ã³ãããªã³ã©ã€ã³åç©é€šã®ã¬ã€ãããããããã«ã¯ã¹ããŒãããŒã ã®èªåå¶åŸ¡ãšãã£ããæ¥åžžã®ç掻ã«é¢é£ããé åã§ããã®å¹æãèŠããŠããŸãããã®ãããªå®çšçãªã¢ããªã±ãŒã·ã§ã³ã®å¢å ã¯ãPrologã®å¯èœæ§ã®æ¡ããã瀺åããŠããŸãã
7.2 ä»åŸã®Prologã®å±æ
å é²çãªæè¡ãšããŠã®Prologã®å°äœã¯ãä»åŸãå€ãããªããšäºæž¬ãããŸããããããããã ãã§ãªããäžè¬ã®éçºè ãååŠè ã«ãšã£ãŠãã¢ã¯ã»ã¹ããããããã°ã©ãã³ã°èšèªãšããŠã®åŽé¢ã匷åããããšãæ±ããããŸããå ·äœçã«ã¯ããã質ã®é«ãããã¥ã¡ã³ãã®æäŸããå ¥éè åãã®ææã®æŽåãã³ãã¥ããã£ã®æŽ»æ§åãªã©ãèããããŸãã
ãŸããå®éã®ç£æ¥ã§ã®å©çšäŸãå¢ããããšã«ãããPrologã®å®çšçãªäŸ¡å€ãããæ確ã«ãªãã§ãããããã®ååã«äŒŽããããŸããŸãªã©ã€ãã©ãªãããŒã«ã®çºå±ãæåŸ ãããŸãã