gpt4 book ai didi

prolog - 如何在 Prolog 中取反

转载 作者:行者123 更新时间:2023-12-04 05:20:16 25 4
gpt4 key购买 nike

我是 PROLOG 的新手,正处于 this page 练习的最开始阶段.鉴于规则父(X,Y)和男性(X),我试图将规则母亲(X,Y)定义为

mother(X, Y) :-
not(male(X)),
parent(X, Y).

但是,在 GNU Prolog 中,我收到以下错误:
| ?- mother(lina, julia).
uncaught exception: error(existence_error(procedure,not/1),mother/2)
| ?-

最佳答案

\+/1是“否定”的 ISO Prolog 谓词。请注意,“否定”在这里表示此时不可证明。

您可以引用this excellent answer由@false 提供有关该主题的更多信息

关于prolog - 如何在 Prolog 中取反,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10141600/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com