Skip to main content
QUICK REVIEW

[论文解读] Inference of termination conditions for numerical loops

Alexander Serebrenik, Danny De Schreye|ArXiv.org|Jun 26, 2001
Logic, programming, and type systems参考文献 21被引用 7
一句话总结

本文提出了一种基于转换的新方法,用于推断逻辑程序中数值循环的终止条件,通过将数值分析整合到可接受性框架中,克服了传统层次映射方法的局限性。该方法通过定义随数值参数递减的良基层次映射,实现了对整数计算(如递归算术谓词)的自动且正确的终止分析,将先前基于约束的终止分析技术扩展至完整支持数值与符号计算的组合。

ABSTRACT

We present a new approach to termination analysis of numerical computations in logic programs. Traditional approaches fail to analyse them due to non well-foundedness of the integers. We present a technique that allows to overcome these difficulties. Our approach is based on transforming a program in way that allows integrating and extending techniques originally developed for analysis of numerical computations in the framework of query-mapping pairs with the well-known framework of acceptability. Such an integration not only contributes to the understanding of termination behaviour of numerical computations, but also allows to perform a correct analysis of such computations automatically, thus, extending previous work on a constraints-based approach to termination. In the last section of the paper we discuss possible extensions of the technique, including incorporating general term orderings.

研究动机与目标

  • 为解决在传统层次映射技术因整数的非良基性而失效时,自动推断逻辑程序中数值计算终止条件的挑战。
  • 将数值终止分析正式集成到成熟的可接受性框架中,以支持具有整数算术的程序中终止性的正确且自动的推理。
  • 将现有的基于约束的终止分析技术扩展至处理数值计算,同时保持对符号计算分析能力。
  • 提供一种形式化且实用的方法论,支持对复杂示例(包括阿克曼函数以及标准 Prolog 库谓词如 'ground' 和 'numbervars')的终止性推断。

提出的方法

  • 转换逻辑程序,以支持基于数值参数将原子映射到自然数的层次映射,确保良基递减。
  • 采用基于约束的方法推断在数值变量上递减的层次映射,例如将 p(X) 映射为 7−X(当 X < 7 时)。
  • 将查询-映射对形式化与可接受性框架结合,以支持互递归和数值依赖关系。
  • 使用自然数对的字典序(例如 (size, arithmetic value))来定义复杂终止证明的良基序。
  • 通过复合层次映射应用项可接受性,将符号与数值推理统一于单一良基序中。
  • 利用现有约束求解技术自动化推断终止条件,支持集成到 Decorte 等人 [9] 的工具中。

实验结果

研究问题

  • RQ1在标准层次映射技术因整数的非良基性而失效的数值循环中,如何自动推断逻辑程序的终止条件?
  • RQ2能否将数值终止分析正式集成到可接受性框架中,以支持互递归和复杂的算术依赖关系?
  • RQ3所提出的方法在多大程度上能够分析结合符号与数值计算的程序,如 'Ackermann' 或 'numbervars'?
  • RQ4该方法能否推断出仅在特定查询约束下才终止的程序的终止条件,例如 p(X) 且 X < 7?

主要发现

  • 所提出的转换方法能够正确分析如 p(X) ← X<7, X1 is X+1, p(X1) 的程序,通过定义层次映射 |p(X)| = 7−X(当 X<7 时),该映射在每次递归调用中递减。
  • 该方法成功分析了 GCD、mod 和阿克曼函数等示例,这些示例无法被依赖于项线性组合的先前基于约束的方法处理。
  • 通过在复合层次映射上使用字典序整合数值与符号推理,使得对复杂谓词(如 'ground'、'unify' 和 'numbervars')的终止性证明成为可能。
  • 该框架支持终止条件的自动推断,将 Decorte 等人 [9] 的工具扩展至处理数值计算,且不损失精度或正确性。
  • 该方法在理论上严谨且在实践中可行,由于在推断流程中使用了约束求解技术,具有高效率的潜力。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。