• # 如何在ISO Prolog中定义（和命名）相应的安全术语比较谓词？

Standard term order (ISO/IEC 13211-1 7.2 Term order) is defined over all terms — including variables. While there are good uses for this — think of the implementation of setof/3, this makes many otherwise clean and logical uses of the built-ins in 8.4 Term...
• # different / 2-是否存在纯粹的确定性定义？

different(Xs, Ys) :- member(X, Xs), non_member(X, Ys). different(Xs, Ys) :- member(Y, Ys), non_member(Y, Xs). While this definition using member/2 and non_member/2 is almost1 perfect from a declarative viewpoint, it produces redundant solution...
• # Prolog中的逻辑“不”是什么？

The problem that I face, is a bit trivial. I want to use logical not in Prolog, but it seems that not/1 is not the thing that I want: course(ai). course(pl). course(os). have(X,Y) :- course(X),course(Y),not(X = Y). 我查询： have(X,Y), write(X-Y), nl , fail. ...
• # 称谓平等/不平等

纯粹的Prolog程序以干净的方式区分术语的相等和不平等会导致执行效率低下;即使所有相关性条款都成立了。 关于SO的最新示例就是这个答案。在这个定义中，所有答案和所有失败都是正确的。考虑： ?- Es = [E1,E2], occurrences(E, Es, Fs). Es = Fs, Fs = [E, E], E1 = E2, E2 = E ; Es = [E, E2], E1 = E, Fs = [E], dif(E, E2) ; Es = [E1, E], E2 = E, Fs = [E], dif...

《从零开始开发BBS》课程上线啦，快来跟着我一步步搭建属于你的BBS吧。

9折优惠邀请码： ZHwfIjb1