序言,exshell,已知谓词?
prolog, exshell, known predicate?
我正在尝试使用从 https://www.cs.unm.edu/~luger/ai-final/code/PROLOG.exshell_full.html 获得的代码在 Gprolog 下使用 ExShell 实现专家系统。但是,我不断收到错误消息:
uncaught exception: error(existence_error(procedure,known/2),solve/0)
我唯一需要更改的是第 334-335 行:
write_premise(not Premise) :-
!, write(' '), write(not),write(' '), write(Premise),nl.
到
write_premise(\+ Premise) :-
!, write(' '), write(\+),write(' '), write(Premise),nl.
我正在使用他们的汽车诊断示例来测试它。我不确定我是否可以做些什么来解决这个问题,或者是否有人知道我可以从哪里获取可以与 gprolog 一起使用的 ExShell 的源代码。
您需要使用指令将 know/2
谓词声明为动态谓词:
:- dynamic(know/2).
我正在尝试使用从 https://www.cs.unm.edu/~luger/ai-final/code/PROLOG.exshell_full.html 获得的代码在 Gprolog 下使用 ExShell 实现专家系统。但是,我不断收到错误消息:
uncaught exception: error(existence_error(procedure,known/2),solve/0)
我唯一需要更改的是第 334-335 行:
write_premise(not Premise) :-
!, write(' '), write(not),write(' '), write(Premise),nl.
到
write_premise(\+ Premise) :-
!, write(' '), write(\+),write(' '), write(Premise),nl.
我正在使用他们的汽车诊断示例来测试它。我不确定我是否可以做些什么来解决这个问题,或者是否有人知道我可以从哪里获取可以与 gprolog 一起使用的 ExShell 的源代码。
您需要使用指令将 know/2
谓词声明为动态谓词:
:- dynamic(know/2).