Upcoming SlideShare
×

# Prolog

1,278 views
1,214 views

Published on

Published in: Technology
0 Likes
Statistics
Notes
• Full Name
Comment goes here.

Are you sure you want to Yes No
• Be the first to comment

• Be the first to like this

Views
Total views
1,278
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
6
0
Likes
0
Embeds 0
No embeds

No notes for slide

### Prolog

1. 1. Prolog 应 用及相关  工具  实例  应用  资料
2. 2. Prolog 开发 工具
3. 3. ......
4. 4. 推荐 SWI-Prolog( 开源 )  http://www.swi-prolog.org/ GNU-Prolog( 开源 )  http://www.gprolog.org/ Visual Prolog( 商业 )  http://www.visual-prolog.com/ Amzi!( 商业 )  http://www.amzi.com/更多工具及其比较：http://en.wikipedia.org/wiki/Comparison_of_Prolog_implementations
5. 5. 简单 ？强 大！
6. 6. Hanoi in Javapublic class Test { private static void emitStep(int source, int dest) { System.out.println(source + " -> " + dest); } static class Step { Step(int n, int s, int d, int t) { this.n = n; source = s; dest = d; temp = t; } int n, source, dest, temp; } private static void hanoi(int n, int source, int dest, int temp) { java.util.Stack<Step> steps = new java.util.Stack<Step>(); steps.add(new Step(n, source, dest, temp)); while (steps.empty() == false) { Step step = steps.pop(); if (step.n == 1) { emitStep(step.source, step.dest); continue; } steps.push(new Step(step.n - 1, step.temp, step.dest, step.source)); steps.push(new Step(1, step.source, step.dest, 0)); steps.push(new Step(step.n - 1, step.source, step.temp, step.dest)); } } public static void main(String[] args) { hanoi(3, 1, 3, 2); }}
7. 7. Hanoi in Prologmove(1,X,Y,_):-write(Move top disk from ),write(X),write( to ), write(Y), nl.move(N,X,Y,Z):-N>1,M is N-1,move(M,X,Z,Y),move(1,X,Y,_),move(M,Z,Y,X). 30 行 2 行
8. 8. 简单 的例子
9. 9. “ 复杂 ”的例子word(d,o,g). word(r,u,n). word(t,o,p).word(f,i,v,e). word(f,o,u,r). word(l,o,s,t).word(m,e,s,s). word(u,n,i,t).word(b,a,k,e,r). word(f,o,r,u,m). word(g,r,e,e,n). word(s,u,p,e,r).word(p,r,o,l,o,g).word(v,a,n,i,s,h). word(w,o,n,d,e,r). word(y,e,l,l,o,w). solution(L1,L2,L3,L4,L5,L6,L7,L8,L9,L10,L11,L12,L13,L14,L15,L16).
10. 10. 应用
11. 11. 编 程启发思维 Prolog 的逻辑编程思想新语 言设计 eg: Joe Armstrong —— Erlang算法新解 汉诺塔、着色问题、八数码问题、 N 后问题 ...
12. 12. Prolog 应 用自然语 言处 理 NLP Techniques in Prolog by Patrick Blackburn and Kristina Striegnitz http://cs.union.edu/~striegnk/courses/nlp-with-prolog/html/机器定理证 明 加法、微分、化简、方程 ...专 家系统 医疗诊断系统、投资风险分析系统、家具设 计系统 ...
13. 13. NLPThe man bites the dog.
14. 14. NLP与 / 或解析树
15. 15. 专 家系统
16. 16. Prolog 相关
17. 17. 趋势 Google TrendsTIOBE Jan 2013
18. 18. 相关语 言进 展包含 Prolog 逻辑编程特性，但不支持 Prolog 语法 。  Mercury: http://www.mercury.cs.mu.oz.au/index.html  Mozart: http://www.mozart-oz.org/包含 Prolog 逻辑编程特性，同时支持 Prolog 语法 。  Ciao: http://www.clip.dia.fi.upm.es/Software  Logtalk: http://logtalk.org/
19. 19. 组织 和会议ALP(Association for Logic Programming) 逻辑编程协会 http://www.logicprogramming.org/ICLP(International Conference on Logic Programming) 逻辑编程国际会议 http://www.iclp2014.net/ Shanghai, China, Oct, 2014.
20. 20. 学习书 籍入门  "Programming In Prolog". William F. Clocksin and Christopher S. Mellish. Springer-Verlag, 2003 (5th ed).  "Prolog Programming for Artificial Intelligence". Ivan Bratko. Addison-Wesley, 2001 (3rd ed).高级  "The Art of Prolog: Advanced Programming Techniques". Leon Sterling and Ehud Shapiro. MIT Press, 1994 (2nd ed).  "The Craft of Prolog". Richard A. OKeefe. MIT Press, 1990.
21. 21. 在线资 料 笨办 法学 Prolog by 泰安小码农 — 轻 松入门 —http://fengdidi.github.com/blog/2011/11/15/di-0zhang-wei- shi-yao-yao-xue-xi-prolog/ Adventure in Prolog  by Amzi! Inc. —— 语 法大全http://www.amzi.com/AdventureInProlog/advfrtop.htm prolog :- tutorial by J.R.Fisher —— 经 典实 例http://www.csupomona.edu/~jrfisher/www/prolog_tutorial/c ontents.html
22. 22. 相关 文献 Visual Prolog 的搜索控制机制分析 , 雷英杰 , 王宝树 , 赵晔 , 王涛，计算机科学， 2005 Vol.32 基于 Prolog 的某型直升机故障诊断专家系统的研究 , 刘卓， 南京大学， 2012 一个动物识别专家系统在 PROLOG 下的实现，夏明华，成 都信息工程学院学报， 2003 Vol.18 Use of Prolog for developing a new programming language, JL Armstrong, SR Virding, MC Williams - C. Moss and, 1992
23. 23. 谢谢 ！