改进 stableKanren 的向后兼容性
Improving stableKanren's Backward Compatibility
AI总结:
本文通过提供细粒度的矛盾处理和“run-partial”接口,解决了标准 miniKanren 程序在 stableKanren 中因无限结果和矛盾处理粗糙导致的兼容性问题。
摘要:
我们改进了 stableKanren 的向后兼容性,以运行 miniKanren 程序。stableKanren 是一个 miniKanren 扩展,能够通过稳定模型语义进行非单调推理。然而,产生无限结果的标准 miniKanren 程序在 stableKanren 中无法按预期运行。根据稳定模型语义,矛盾是由否定产生的。标准 miniKanren 的关系不涉及否定,而 stableKanren 中粗糙的矛盾处理导致了这一兼容性问题。因此,我们提供了一种细粒度的矛盾处理方法来限制检查范围。结果,标准 miniKanren 关系可以产生答案。我们还添加了一个“run-partial”接口,使得用“define”/“defineo”实现的标准 miniKanren 关系即使与不终止或不可满足的 stableKanren 关系共存于同一环境中,也能生成答案。“run-partial”接口还支持更快地运行分层否定程序,而无需检查全局不可避免的矛盾。未来可以对输入查询应用依赖图分析,以便“run”接口能够隐式地决定是否执行不可避免的矛盾检查,从而提高可用性。
英文摘要:
We improve the backward compatibility of stableKanren to run miniKanren programs. stableKanren is a miniKanren extension capable of non-monotonic reasoning through stable model semantics. However, standard miniKanren programs that produce infinite results do not run as expected in stableKanren. According to stable model semantics, the contradictions are created by negations. A standard miniKanren's relations do not involve negation, and the coarse contradictions handling in stableKanren causes this compatibility issue. Therefore, we provide a find-grinded contradiction handling to restrict the checking scope. As a result, standard miniKanren relations can produce answers. We also add a ``run-partial'' interface so that standard miniKanren's relations implemented with ``define''/``defineo'' can generate answers even if they coexist with non-terminating or unsatisfiable stableKanren relations in the same environment. The ``run-partial'' interface also supports running stratified negation programs faster without checking global unavoidable contradictions. A dependency graph analysis can be applied to the input query in the future, so the ``run'' interface can implicitly decide whether to perform unavoidable contradictions checking to improve usability.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。