在 C# 应用程序中,我想使用 Aleph 来构建理论。
以下在 SWI-Prolog 中起作用:
?- [aleph.pl]。 ?-working_directory(CDW,'C:/Users/admin/Desktop/inputFiles')。 ?- read_all(数据输入)。 ?-诱导。
但在 C# 中,这些命令不会:
if (!PlEngine.IsInitialized) { 字符串[] 参数 = { "-q" }; PlEngine.Initialize(参数); PlQuery.PlCall("咨询('C:/Users/admin/Desktop/Aleph_pack/Aleph.pl')"); PlQuery.PlCall("working_directory(CDW,'C:/Users/admin/Desktop/inputFiles')); PlQuery.PlCall("assert(read_all(datainput))"); //错误! PlQuery.PlCall("assert(induce)"); }
我收到以下错误 PlQuery.PlCall("assert(read_all(datainput))")
:
SwiPlCs.dll 中出现“SbsSW.SwiPlCs.Exceptions.PlException”类型的未处理异常 细节: SbsSW.SwiPlCs.Exceptions.PlException 未处理 H结果=-2146233088 Message=assert/1:无权修改静态过程“read_all/1” 定义在 c:/users/admin/desktop/aleph_pack/aleph.pl:8857
我该如何解决这个错误?