arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 1410.4011cs.PLcs.FLcs.LO
收藏

流程图程序、正则表达式和多项式增长率的可判定性

Flowchart Programs, Regular Expressions, and Decidability of Polynomial Growth-Rate

Amir M. Ben-Amram, Aviad Pineles

摘要:

我们提出了一种新的方法来推断复杂性的性质,为一类程序的形式的流程图注释循环信息。具体来说,我们的方法可以(健全和完全)决定计算值是否作为输入的函数多项式有界;运行时间也是如此。这样的复杂性属性对于图灵完备程序设计语言来说是不可判定的,而在程序分析中,一个常见的解决方案是解决合理但不完整的解决方案。相比之下,我们认为一类程序是图灵不完全的,但足够强大,包括这种分析的几个挑战。对于一个具有良好结构语法的相关语言,类似于Meyer和Ritchie的LOOP程序,这个问题以前已经被证明是可判定的。分析依赖于程序的组合性,因此在获得类似的结果与任意控制流图的流程图程序的挑战。我们的挑战的答案是双重的:首先,我们提出了一类循环注释的流程图,这是更一般的流程图,直接代表结构化的程序;其次,我们提出了一种技术,重用的想法,从工作结构化的程序,并将它们应用到这样的流程图。该技术的灵感来自于非确定性自动机到正则表达式的经典翻译,但我们将构建这样一个表达式的指数成本降低,获得多项式时间分析。这些思想可以很好地适用于其他分析问题。

英文摘要:

We present a new method for inferring complexity properties for a class of programs in the form of flowcharts annotated with loop information. Specifically, our method can (soundly and completely) decide if computed values are polynomially bounded as a function of the input; and similarly for the running time. Such complexity properties are undecidable for a Turing-complete programming language, and a common work-around in program analysis is to settle for sound but incomplete solutions. In contrast, we consider a class of programs that is Turing-incomplete, but strong enough to include several challenges for this kind of analysis. For a related language that has well-structured syntax, similar to Meyer and Ritchie's LOOP programs, the problem has been previously proved to be decidable. The analysis relied on the compositionality of programs, hence the challenge in obtaining similar results for flowchart programs with arbitrary control-flow graphs. Our answer to the challenge is twofold: first, we propose a class of loop-annotated flowcharts, which is more general than the class of flowcharts that directly represent structured programs; secondly, we present a technique to reuse the ideas from the work on tructured programs and apply them to such flowcharts. The technique is inspired by the classic translation of non-deterministic automata to regular expressions, but we obviate the exponential cost of constructing such an expression, obtaining a polynomial-time analysis. These ideas may well be applicable to other analysis problems.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑