Logic rules are powerful for expressing complex reasoning and analysis problems. At the same time, they are inconvenient or impossible to use for many other aspects of applications. Integrating rules in a language with sets and functions, and furthermore with updates to objects, has been a subject of significant study. What's lacking is a language that integrates all constructs seamlessly. This paper presents a language, Alda, that supports all of rules, sets, functions, updates, and objects as seamlessly integrated built-ins, including concurrent and distributed processes. The key idea is to support predicates as set-valued variables that can be used and updated in any scope, and support queries and inference with both explicit and automatic calls to an inference function. We develop a complete formal semantics for Alda. We design a compilation framework that ensures the declarative semantics of rules, while also being able to exploit available optimizations. We describe a prototype implementation that builds on a powerful extension of Python and employs an efficient logic rule engine. We develop a range of benchmarks and present results of experiments to demonstrate Alda's power for programming and generally good performance.
翻译:逻辑规则对于表达复杂的推理和分析问题非常有力。 同时,逻辑规则对于应用的许多其他方面来说是难于或不可能使用的。 将规则整合成具有设置和功能的语文,再加上对对象的更新,已成为一项重要研究的主题。 缺少的是一种将所有结构都无缝整合起来的语言。 本文展示了一种语言, Alda, 支持所有的规则、 设置、 功能、 更新和天体, 作为无缝整合的内建, 包括同时和分布的过程。 关键的想法是支持作为定值变量的上游, 可以在任何范围内加以使用和更新, 支持查询和推断, 支持明确和自动的推断功能。 我们为 Alda 开发了一个完整的正式的语义框架。 我们设计了一个汇编框架, 以确保规则的宣示性语义, 同时能够利用现有的优化。 我们描述一个基于Python 强大扩展的原型执行模式, 并使用高效的逻辑规则引擎。 我们开发了一系列基准和当前实验结果, 以展示Alda 的编程和一般良好表现能力。