AttributeError:类Prolog没有“dynamic”属性

2024-04-25 11:46:31 发布

您现在位置:Python中文网/ 问答频道 /正文

我已经在ubuntu上安装了pyswip,并按照官方文档进行了安装。然而,我仍然得到一些问题,我找到了一些解决办法,其中一些,我仍然与更多的斗争。你知道吗

以下是我当前得到的代码和错误:

>>> from pyswip import Prolog, registerForeign, Variable, Functor
>>> registerForeign(ask_question,name='ask', arity=1)
1
>>> hypothesize = Functor("hypothesize",1)
>>> Test = Variable()
>>> assertz = Functor('assertz',1)
>>> Prolog.dynamic("yes/1, no/1")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: class Prolog has no attribute 'dynamic'

有什么想法吗?谢谢!你知道吗


Tags: no代码文档官方ubuntudynamicvariableprolog