一阶逻辑引擎
我想创建一个可以使用一阶逻辑进行简单推理的应用程序。谁能推荐一个可以接受任意数量的 FOL 表达式并允许查询这些表达式(最好通过 Python 访问)的“引擎”?
I'd like to create an application that can do simple reasoning using first order logic. Can anyone recommend an "engine" that can accept an arbitrary number of FOL expressions, and allow querying of those expressions (preferably accessible via Python)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
除非绝对必要,否则不要使用一阶逻辑 (FOL) 进行查询:一阶逻辑不可判定,而只是半可判定,因此查询通常不可避免地不会终止。
描述逻辑本质上是一阶逻辑的可判定片段,以适合的方式重新表述谈论实体的类别及其相互关系。 Python中有很多描述逻辑的引擎,例如基于OWL-DL的seth。
如果您确实确定需要丰富的 FOL,那么 FLiP 值得一看。我还没有使用过它(说实话,我不太喜欢 Python),但这是使编程语言可以进行逻辑检查的好方法。
Don't query using first-order logic (FOL) unless you absolutely have to: first-order logic is not decidable, but only semi-decidable, and so queries will often, unavoidably not terminate.
Description logic is essentially a decidable fragment of first-order logic, reformulated in a manner that is good for talking about classes of entity and their interrelationships. There are many engines for description logic in Python, for example seth, based on OWL-DL.
If you are really sure that you need the vastness of FOL, then FLiP is worth a look. I've not used it (not really keen on Python, to be honest), but this is a good approach to making logic checking available to a programming language.
PyLog:
PyLog:
食谱 303057:Pythologic —— Python 中的 Prolog 语法 / http://code.activestate.com/recipes/ 303057/
Recipe 303057: Pythologic -- Prolog syntax in Python / http://code.activestate.com/recipes/303057/