【发布时间】:2016-08-30 15:25:21
【问题描述】:
有没有办法动态查询 prolog 知识库?
我在文件 family.pl 中有序言逻辑(我在这里找到了一个示例 http://www.techytalk.info/prolog-programming-gprolog-linux/)。以下是它的内容:
mother_child(trude, sally).
father_child(tom, sally).
father_child(tom, erica).
father_child(mike, tom).
sibling(X, Y) :- parent_child(Z, X), parent_child(Z, Y).
parent_child(X, Y) :- father_child(X, Y).
parent_child(X, Y) :- mother_child(X, Y).
我希望能够在不进入 prolog 解释器的情况下进行查询。
这个命令对我不起作用:
swipl -f family.pl -g "father_child(Father, Child)"
谢谢
【问题讨论】:
标签: prolog swi-prolog