Amir ben-Amram - Academia.edu (original) (raw)

Papers by Amir ben-Amram

Research paper thumbnail of On the Edge of Decidability in Complexity Analysis of Loop Programs

International Journal of Foundations of Computer Science, 2012

We investigate the decidability of the feasibility problem for imperative programs with bounded l... more We investigate the decidability of the feasibility problem for imperative programs with bounded loops. A program is called feasible if all values it computes are polynomially bounded in terms of the input. The feasibility problem is representative of a group of related properties, like that of polynomial time complexity. It is well known that such properties are undecidable for a Turing-complete programming language. They may be decidable, however, for languages that are not Turing-complete. But if these languages are expressive enough, they do pose a challenge for analysis. We are interested in tracing the edge of decidability for the feasibility problem and similar problems. In previous work, we proved that such problems are decidable for a language where loops are bounded but indefinite (that is, the loops may exit before completing the given iteration count). In this paper, we consider definite loops. A second language feature that we vary, is the kind of assignment statements. ...

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

Electronic Proceedings in Theoretical Computer Science, 2016

We present a new method for inferring complexity properties for a class of programs in the form o... more 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 structured 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.

Research paper thumbnail of Linear, Polynomial or Exponential? Complexity Inference in Polynomial Time

Logic and Theory of Algorithms

Research paper thumbnail of On the linear ranking problem for integer linear-constraint loops

Proceedings of the 40th annual ACM SIGPLAN-SIGACT symposium on Principles of programming languages, 2013

In this paper we study the complexity of the problems: given a loop, described by linear constrai... more In this paper we study the complexity of the problems: given a loop, described by linear constraints over a finite set of variables, is there a linear or lexicographical-linear ranking function for this loop? While existence of such functions implies termination, these problems are not equivalent to termination. When the variables range over the rationals (or reals), it is known that both problems are PTIME decidable. However, when they range over the integers, whether for single-path or multipath loops, the complexity has not yet been determined. We show that both problems are coNP-complete. However, we point out some special cases of importance of PTIME complexity. We also present complete algorithms for synthesizing linear and lexicographical-linear ranking functions, both for the general case and the special PTIME cases. Moreover, in the rational setting, our algorithm for synthesizing lexicographical-linear ranking functions extends existing ones, because our class of ranking functions is more general, yet it has polynomial time complexity.

Research paper thumbnail of Ranking Functions for Linear-Constraint Loops

Journal of the ACM, 2014

In this article, we study the complexity of the problems: given a loop, described by linear const... more In this article, we study the complexity of the problems: given a loop, described by linear constraints over a finite set of variables, is there a linear or lexicographical-linear ranking function for this loop? While existence of such functions implies termination, these problems are not equivalent to termination. When the variables range over the rationals (or reals), it is known that both problems are PTIME decidable. However, when they range over the integers, whether for single-path or multipath loops, the complexity has not yet been determined. We show that both problems are coNP-complete. However, we point out some special cases of importance of PTIME complexity. We also present complete algorithms for synthesizing linear and lexicographical-linear ranking functions, both for the general case and the special PTIME cases. Moreover, in the rational setting, our algorithm for synthesizing lexicographical-linear ranking functions extends existing ones, because our definition for ...

Research paper thumbnail of Decidable and Undecidable Problems Related to Complexity Analysis of Loop Programs

Research paper thumbnail of Preprint. Submitted for publication in JACM

Research paper thumbnail of A note on busy beavers and other creatures

Mathematical Systems Theory, 1996

Research paper thumbnail of On the Edge of Decidability in Complexity Analysis of Loop Programs

International Journal of Foundations of Computer Science, 2012

ABSTRACT We investigate the decidability of the feasibility problem for imperative programs with ... more ABSTRACT We investigate the decidability of the feasibility problem for imperative programs with bounded loops. A program is called feasible if all values it computes are polynomially bounded in terms of the input. The feasibility problem is representative of a group of related properties, like that of polynomial time complexity. It is well known that such properties are undecidable for a Turing-complete programming language. They may be decidable, however, for languages that are not Turing-complete. But if these languages are expressive enough, they do pose a challenge for analysis. We are interested in tracing the edge of decidability for the feasibility problem and similar problems. In previous work, we proved that such problems are decidable for a language where loops are bounded but indefinite (that is, the loops may exit before completing the given iteration count). In this paper, we consider definite loops. A second language feature that we vary, is the kind of assignment statements. With ordinary assignment, we prove undecidability of a very tiny language fragment. We also prove undecidability with lossy assignment (that is, assignments where the modified variable may receive any value bounded by the given expression, even zero). But we prove decidability with max assignments (that is, assignments where the modified variable never decreases its value).

Research paper thumbnail of Size-change termination in polynomial time

ACM Transactions on Programming Languages and …, 2007

Research paper thumbnail of Computational Models with No Linear Speedup

The linear speedup theorem states, informally, that constants do not matter: It is essentially al... more The linear speedup theorem states, informally, that constants do not matter: It is essentially always possible to find a program solving any decision problem a factor of 2 faster. This result is a classical theorem in computing, but also one of the most debated. The main ingredient of the typical proof of the linear speedup theorem is tape compression, where a fast machine is constructed with tape alphabet or number of tapes far greater than that of the original machine. In this paper, we prove that limiting Turing machines to a fixed alphabet and a fixed number of tapes rules out linear speedup. Specifically, we describe a language that can be recognized in linear time (e. g., 1.51n), and provide a proof, based on Kolmogorov complexity, that the computation cannot be sped up (e. g., below 1.49n). Without the tape and alphabet limitation, the linear speedup theorem does hold and yields machines of time complexity of the form (1 + ε)n for arbitrarily small ε > 0. Earlier results negating linear speedup in alternative models of computation have often been based on the existence of very efficient universal machines. In the vernacular of programming language theory: These models have very efficient self-interpreters. As the second contribution of this paper, we define a class, PICSTI, of computation models that exactly captures this property, and we disprove the Linear Speedup Theorem for every model in this class, thus generalizing all similar, model-specific proofs.

Research paper thumbnail of Program termination analysis in polynomial time

ACM Transactions on Programming Languages and Systems, 2007

A size-change termination algorithm takes as input abstract information about a program in the fo... more A size-change termination algorithm takes as input abstract information about a program in the form of size-change graphs and uses it to determine whether any infinite computation would imply that some data decrease in size infinitely. Since such an infinite descent is presumed impossible, this proves program termination. The property of the graphs that implies program termination is called SCT. There are many examples of practical programs whose termination can be verified by creating size-change graphs and testing them for SCT.The size-change graph abstraction is useful because the graphs often carry sufficient information to deduce termination, and at the same time are simple enough to be analyzed automatically. However, there is a tradeoff between the completeness and efficiency of this analysis, and complete algorithms in the literature can easily be pushed to an exponential combinatorial search by certain patterns in the graph structures.We therefore propose a novel algorithm ...

Research paper thumbnail of On the Termination of Integer Loops

ACM Transactions on Programming Languages and Systems, 2012

In this article we study the decidability of termination of several variants of simple integer lo... more In this article we study the decidability of termination of several variants of simple integer loops, without branching in the loop body and with affine constraints as the loop guard (and possibly a precondition). We show that termination of such loops is undecidable in some cases, in particular, when the body of the loop is expressed by a set of linear inequalities where the coefficients are from Z ∪ { r } with r an arbitrary irrational; when the loop is a sequence of instructions, that compute either linear expressions or the step function; and when the loop body is a piecewise linear deterministic update with two pieces. The undecidability result is proven by a reduction from counter programs, whose termination is known to be undecidable. For the common case of integer linear-constraint loops with rational coefficients we have not succeeded in proving either decidability or undecidability of termination, but we show that a Petri net can be simulated with such a loop; this implies...

Research paper thumbnail of Ranking functions for size-change termination

ACM Transactions on Programming Languages and Systems, 2009

This article explains how to construct a ranking function for any program that is proved terminat... more This article explains how to construct a ranking function for any program that is proved terminating by size-change analysis . The “principle of size-change termination” for a first-order functional language with well-ordered data is intuitive: A program terminates on all inputs, if every infinite call sequence (following program control flow) would imply an infinite descent in some data values. Size-change analysis is based on information associated with the subject program's call-sites. This information indicates, for each call-site, strict or weak data decreases observed as a computation traverses the call-site. The set DESC of call-site sequences for which the size-changes imply infinite descent is ω-regular, as is the set FLOW of infinite call-site sequences following the program flowchart. If FLOW ⊆ DESC (a decidable problem), every infinite call sequence would imply infinite descent in a well-ordering—an impossibility—so the program must terminate. This analysis accounts ...

Research paper thumbnail of CONS-Free Programs with Tree Input (Extended Abstract)

Research paper thumbnail of On Pointers versus Addresses (Extended Abstract)

IEEE Symposium on Foundations of Computer Science, 1988

Research paper thumbnail of When can we sort in time

Journal of Computer and System Sciences, 1993

Research paper thumbnail of Worst-case and amortised optimality in union-find (extended abstract)

Proceedings of the thirty-first annual ACM symposium on Theory of Computing, 1999

We study the interplay between worst-case and amortised time bounds for the classic Disjoint Set ... more We study the interplay between worst-case and amortised time bounds for the classic Disjoint Set Union problem (Union-Find). We ask whether it is possible to achieve optimal worst-case and amortised bounds simultaneously. Furthermore we would like to allow a tradeoff between the worst-case time for a query and for an update. We answer this question by first providing lower bounds for the possible worst-case time tradeoffs, as well as lower bounds which show where in this tradeoff range optimal amortised time is achievable. We then give an algorithm which tightly matches both lower bounds simultaneously. The lower bounds are provided in the cell-probe model as well as in the algebraic real-number RAM, and the upper bounds hold for a RAM with logarithmic word size and a modest instruction set. Our lower bounds show that for worst-case query and update time t, and t, respectively, one must have t, = a(log n/ log t,), and only for t, 2 cx(m, n) can this tradeoff be achieved simultaneously with the optimal amortised time of o(c~(m,n)). Our 'DIK", Camp. sci. Dept., ""ivorsity of Copenhagen, Denmark. E-mail: slephe"mdik".dk. Part of thin work W&S done while "isiting BRIGS and Lund University.

Research paper thumbnail of What can we sort in o(nlog n) time?

Proceedings of 1993 IEEE 34th Annual Foundations of Computer Science

... Amir M. Ben-Amram* Tel-Aviv University Zvi Galil** Tel-Aviv University and Columbia Universit... more ... Amir M. Ben-Amram* Tel-Aviv University Zvi Galil** Tel-Aviv University and Columbia University Socrates: What sort? Not a trivial one, as I see it Plato (H. Tkedennick, tr.) Abstract We define two conditions on a random access ma-chine (RAM) with arithmetic and Boolean ...

Research paper thumbnail of Lower bounds for data structure problems on RAMs

[1991] Proceedings 32nd Annual Symposium of Foundations of Computer Science

... YUi . Thus, to each node X of level i in the meta tree are associated: (i) a subset PA of ?Er... more ... YUi . Thus, to each node X of level i in the meta tree are associated: (i) a subset PA of ?Erto describing possible values (ii) an assignment Ax. ... (ii) Let X be a node of level i. By the observation above, fUi [Ax] is a function of XI, . . . , X,. Let UI, . . . ...

Research paper thumbnail of On the Edge of Decidability in Complexity Analysis of Loop Programs

International Journal of Foundations of Computer Science, 2012

We investigate the decidability of the feasibility problem for imperative programs with bounded l... more We investigate the decidability of the feasibility problem for imperative programs with bounded loops. A program is called feasible if all values it computes are polynomially bounded in terms of the input. The feasibility problem is representative of a group of related properties, like that of polynomial time complexity. It is well known that such properties are undecidable for a Turing-complete programming language. They may be decidable, however, for languages that are not Turing-complete. But if these languages are expressive enough, they do pose a challenge for analysis. We are interested in tracing the edge of decidability for the feasibility problem and similar problems. In previous work, we proved that such problems are decidable for a language where loops are bounded but indefinite (that is, the loops may exit before completing the given iteration count). In this paper, we consider definite loops. A second language feature that we vary, is the kind of assignment statements. ...

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

Electronic Proceedings in Theoretical Computer Science, 2016

We present a new method for inferring complexity properties for a class of programs in the form o... more 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 structured 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.

Research paper thumbnail of Linear, Polynomial or Exponential? Complexity Inference in Polynomial Time

Logic and Theory of Algorithms

Research paper thumbnail of On the linear ranking problem for integer linear-constraint loops

Proceedings of the 40th annual ACM SIGPLAN-SIGACT symposium on Principles of programming languages, 2013

In this paper we study the complexity of the problems: given a loop, described by linear constrai... more In this paper we study the complexity of the problems: given a loop, described by linear constraints over a finite set of variables, is there a linear or lexicographical-linear ranking function for this loop? While existence of such functions implies termination, these problems are not equivalent to termination. When the variables range over the rationals (or reals), it is known that both problems are PTIME decidable. However, when they range over the integers, whether for single-path or multipath loops, the complexity has not yet been determined. We show that both problems are coNP-complete. However, we point out some special cases of importance of PTIME complexity. We also present complete algorithms for synthesizing linear and lexicographical-linear ranking functions, both for the general case and the special PTIME cases. Moreover, in the rational setting, our algorithm for synthesizing lexicographical-linear ranking functions extends existing ones, because our class of ranking functions is more general, yet it has polynomial time complexity.

Research paper thumbnail of Ranking Functions for Linear-Constraint Loops

Journal of the ACM, 2014

In this article, we study the complexity of the problems: given a loop, described by linear const... more In this article, we study the complexity of the problems: given a loop, described by linear constraints over a finite set of variables, is there a linear or lexicographical-linear ranking function for this loop? While existence of such functions implies termination, these problems are not equivalent to termination. When the variables range over the rationals (or reals), it is known that both problems are PTIME decidable. However, when they range over the integers, whether for single-path or multipath loops, the complexity has not yet been determined. We show that both problems are coNP-complete. However, we point out some special cases of importance of PTIME complexity. We also present complete algorithms for synthesizing linear and lexicographical-linear ranking functions, both for the general case and the special PTIME cases. Moreover, in the rational setting, our algorithm for synthesizing lexicographical-linear ranking functions extends existing ones, because our definition for ...

Research paper thumbnail of Decidable and Undecidable Problems Related to Complexity Analysis of Loop Programs

Research paper thumbnail of Preprint. Submitted for publication in JACM

Research paper thumbnail of A note on busy beavers and other creatures

Mathematical Systems Theory, 1996

Research paper thumbnail of On the Edge of Decidability in Complexity Analysis of Loop Programs

International Journal of Foundations of Computer Science, 2012

ABSTRACT We investigate the decidability of the feasibility problem for imperative programs with ... more ABSTRACT We investigate the decidability of the feasibility problem for imperative programs with bounded loops. A program is called feasible if all values it computes are polynomially bounded in terms of the input. The feasibility problem is representative of a group of related properties, like that of polynomial time complexity. It is well known that such properties are undecidable for a Turing-complete programming language. They may be decidable, however, for languages that are not Turing-complete. But if these languages are expressive enough, they do pose a challenge for analysis. We are interested in tracing the edge of decidability for the feasibility problem and similar problems. In previous work, we proved that such problems are decidable for a language where loops are bounded but indefinite (that is, the loops may exit before completing the given iteration count). In this paper, we consider definite loops. A second language feature that we vary, is the kind of assignment statements. With ordinary assignment, we prove undecidability of a very tiny language fragment. We also prove undecidability with lossy assignment (that is, assignments where the modified variable may receive any value bounded by the given expression, even zero). But we prove decidability with max assignments (that is, assignments where the modified variable never decreases its value).

Research paper thumbnail of Size-change termination in polynomial time

ACM Transactions on Programming Languages and …, 2007

Research paper thumbnail of Computational Models with No Linear Speedup

The linear speedup theorem states, informally, that constants do not matter: It is essentially al... more The linear speedup theorem states, informally, that constants do not matter: It is essentially always possible to find a program solving any decision problem a factor of 2 faster. This result is a classical theorem in computing, but also one of the most debated. The main ingredient of the typical proof of the linear speedup theorem is tape compression, where a fast machine is constructed with tape alphabet or number of tapes far greater than that of the original machine. In this paper, we prove that limiting Turing machines to a fixed alphabet and a fixed number of tapes rules out linear speedup. Specifically, we describe a language that can be recognized in linear time (e. g., 1.51n), and provide a proof, based on Kolmogorov complexity, that the computation cannot be sped up (e. g., below 1.49n). Without the tape and alphabet limitation, the linear speedup theorem does hold and yields machines of time complexity of the form (1 + ε)n for arbitrarily small ε > 0. Earlier results negating linear speedup in alternative models of computation have often been based on the existence of very efficient universal machines. In the vernacular of programming language theory: These models have very efficient self-interpreters. As the second contribution of this paper, we define a class, PICSTI, of computation models that exactly captures this property, and we disprove the Linear Speedup Theorem for every model in this class, thus generalizing all similar, model-specific proofs.

Research paper thumbnail of Program termination analysis in polynomial time

ACM Transactions on Programming Languages and Systems, 2007

A size-change termination algorithm takes as input abstract information about a program in the fo... more A size-change termination algorithm takes as input abstract information about a program in the form of size-change graphs and uses it to determine whether any infinite computation would imply that some data decrease in size infinitely. Since such an infinite descent is presumed impossible, this proves program termination. The property of the graphs that implies program termination is called SCT. There are many examples of practical programs whose termination can be verified by creating size-change graphs and testing them for SCT.The size-change graph abstraction is useful because the graphs often carry sufficient information to deduce termination, and at the same time are simple enough to be analyzed automatically. However, there is a tradeoff between the completeness and efficiency of this analysis, and complete algorithms in the literature can easily be pushed to an exponential combinatorial search by certain patterns in the graph structures.We therefore propose a novel algorithm ...

Research paper thumbnail of On the Termination of Integer Loops

ACM Transactions on Programming Languages and Systems, 2012

In this article we study the decidability of termination of several variants of simple integer lo... more In this article we study the decidability of termination of several variants of simple integer loops, without branching in the loop body and with affine constraints as the loop guard (and possibly a precondition). We show that termination of such loops is undecidable in some cases, in particular, when the body of the loop is expressed by a set of linear inequalities where the coefficients are from Z ∪ { r } with r an arbitrary irrational; when the loop is a sequence of instructions, that compute either linear expressions or the step function; and when the loop body is a piecewise linear deterministic update with two pieces. The undecidability result is proven by a reduction from counter programs, whose termination is known to be undecidable. For the common case of integer linear-constraint loops with rational coefficients we have not succeeded in proving either decidability or undecidability of termination, but we show that a Petri net can be simulated with such a loop; this implies...

Research paper thumbnail of Ranking functions for size-change termination

ACM Transactions on Programming Languages and Systems, 2009

This article explains how to construct a ranking function for any program that is proved terminat... more This article explains how to construct a ranking function for any program that is proved terminating by size-change analysis . The “principle of size-change termination” for a first-order functional language with well-ordered data is intuitive: A program terminates on all inputs, if every infinite call sequence (following program control flow) would imply an infinite descent in some data values. Size-change analysis is based on information associated with the subject program's call-sites. This information indicates, for each call-site, strict or weak data decreases observed as a computation traverses the call-site. The set DESC of call-site sequences for which the size-changes imply infinite descent is ω-regular, as is the set FLOW of infinite call-site sequences following the program flowchart. If FLOW ⊆ DESC (a decidable problem), every infinite call sequence would imply infinite descent in a well-ordering—an impossibility—so the program must terminate. This analysis accounts ...

Research paper thumbnail of CONS-Free Programs with Tree Input (Extended Abstract)

Research paper thumbnail of On Pointers versus Addresses (Extended Abstract)

IEEE Symposium on Foundations of Computer Science, 1988

Research paper thumbnail of When can we sort in time

Journal of Computer and System Sciences, 1993

Research paper thumbnail of Worst-case and amortised optimality in union-find (extended abstract)

Proceedings of the thirty-first annual ACM symposium on Theory of Computing, 1999

We study the interplay between worst-case and amortised time bounds for the classic Disjoint Set ... more We study the interplay between worst-case and amortised time bounds for the classic Disjoint Set Union problem (Union-Find). We ask whether it is possible to achieve optimal worst-case and amortised bounds simultaneously. Furthermore we would like to allow a tradeoff between the worst-case time for a query and for an update. We answer this question by first providing lower bounds for the possible worst-case time tradeoffs, as well as lower bounds which show where in this tradeoff range optimal amortised time is achievable. We then give an algorithm which tightly matches both lower bounds simultaneously. The lower bounds are provided in the cell-probe model as well as in the algebraic real-number RAM, and the upper bounds hold for a RAM with logarithmic word size and a modest instruction set. Our lower bounds show that for worst-case query and update time t, and t, respectively, one must have t, = a(log n/ log t,), and only for t, 2 cx(m, n) can this tradeoff be achieved simultaneously with the optimal amortised time of o(c~(m,n)). Our 'DIK", Camp. sci. Dept., ""ivorsity of Copenhagen, Denmark. E-mail: slephe"mdik".dk. Part of thin work W&S done while "isiting BRIGS and Lund University.

Research paper thumbnail of What can we sort in o(nlog n) time?

Proceedings of 1993 IEEE 34th Annual Foundations of Computer Science

... Amir M. Ben-Amram* Tel-Aviv University Zvi Galil** Tel-Aviv University and Columbia Universit... more ... Amir M. Ben-Amram* Tel-Aviv University Zvi Galil** Tel-Aviv University and Columbia University Socrates: What sort? Not a trivial one, as I see it Plato (H. Tkedennick, tr.) Abstract We define two conditions on a random access ma-chine (RAM) with arithmetic and Boolean ...

Research paper thumbnail of Lower bounds for data structure problems on RAMs

[1991] Proceedings 32nd Annual Symposium of Foundations of Computer Science

... YUi . Thus, to each node X of level i in the meta tree are associated: (i) a subset PA of ?Er... more ... YUi . Thus, to each node X of level i in the meta tree are associated: (i) a subset PA of ?Erto describing possible values (ii) an assignment Ax. ... (ii) Let X be a node of level i. By the observation above, fUi [Ax] is a function of XI, . . . , X,. Let UI, . . . ...