Prolog
https://en.wikipedia.org/wiki/Prolog
Prolog is a general-purpose language associated with and .
Prolog has its roots in , a , and unlike many other , Prolog is : the program logic is expressed in terms of relations, represented as facts and . A computation is initiated by running a query over these relations.
Prolog是一种通用目的的 逻辑编程 语言, 与人工智能 和 计算语言学有关。
Prolog源于一阶逻辑,一种形式逻辑学,所以和其他很多编程语言不通。 其实 声明式的, 程序逻辑被以关系表达, 表述为 fact 和 rule。
使用查询,触发程序的计算,计算的目标在这些关系中搜索答案。
学习
http://www.learnprolognow.org/lpnpage.php?pageid=online
http://www.cnblogs.com/zhanjindong/p/3329647.html
http://www.learnprolognow.org/slides/official/LPNchapter1.pdf
demo
苏格拉底三段论:
是人就会死,苏格拉底是人
结论:苏格拉底会死
知识库:
die(X):-person(X).
person(socrates).
查询语句:
die(socrates).
线上运行环境:
https://swish.swi-prolog.org/