【发布时间】:2014-11-25 22:26:35
【问题描述】:
我尝试使用 == 运算符在 pyDatalog 中创建谓词,但 fluent[X] 的定义似乎无效:
from pyDatalog import pyDatalog
pyDatalog.create_terms('flammable, notFlammable, X, Y')
flammable[X] = ((X == 'wood') or (X == 'coal'))`
#TypeError: unhashable type: 'Query'
notFlammable[X] = ~flammable[X]
#This doesn't work either.
我还尝试在 pyDataLog 谓词中包含比较运算符,但这也不起作用:
threeOrFour[X] = ((X < 3) or (X > 4))
#pyDatalog.util.DatalogError: Error: left hand side of comparison must be bound: </2 in line None of None
是否可以在 pyDatalog 谓词中包含这些比较和否定运算符?
【问题讨论】:
标签: pydatalog