Polynomial Constants Are Decidable

Constant propagation aims at identifying expressions that always yield a unique constant value at run-time. It is well-known that constant propagation is undecidable for programs working on integers even if guards are ignored as in non-deterministic flow graphs. We show that polynomial constants are decidable in non-deterministic flow graphs. In polynomial constant propagation, assignment statements that use the operators +,-,* are interpreted exactly but all assignments that use other operators are conservatively interpreted as non-deterministic assignments.We present a generic algorithm for constant propagation via a symbolic weakest precondition computation and show how this generic algorithm can be instantiated for polynomial constant propagation by exploiting techniques from computable ring theory.

[1]  Charles N. Fischer,et al.  Crafting a Compiler , 1988 .

[2]  Matthew S. Hecht,et al.  Flow Analysis of Computer Programs , 1977 .

[3]  David A. Schmidt,et al.  Calois Connections and Computer Science Applications , 1985, CTCS.

[4]  James H. Davenport,et al.  Computer Algebra: Systems and Algorithms for Algebraic Computation , 1988 .

[5]  Franz Winkler,et al.  Polynomial Algorithms in Computer Algebra , 1996, Texts and Monographs in Symbolic Computation.

[6]  Michael Karr,et al.  Affine relationships among variables of a program , 1976, Acta Informatica.

[7]  Krzysztof R. Apt,et al.  Countable nondeterminism and random assignment , 1986, JACM.

[8]  Patrick Cousot,et al.  Abstract interpretation: a unified lattice model for static analysis of programs by construction or approximation of fixpoints , 1977, POPL.

[9]  Alfred V. Aho,et al.  Compilers: Principles, Techniques, and Tools , 1986, Addison-Wesley series in computer science / World student series edition.

[10]  Roland Carl Backhouse,et al.  Fixed-Point Calculus , 1995, Inf. Process. Lett..

[11]  Markus Müller-Olm,et al.  On the Complexity of Constant Propagation , 2001, ESOP.

[12]  Thomas W. Reps,et al.  Precise Interprocedural Dataflow Analysis with Applications to Constant Propagation , 1995, TAPSOFT.

[13]  Keith O. Geddes,et al.  Algorithms for computer algebra , 1992 .

[14]  Samson Abramsky,et al.  Category Theory and Computer Programming , 1986, Lecture Notes in Computer Science.

[15]  Edsger W. Dijkstra,et al.  A Discipline of Programming , 1976 .

[16]  John H. Reif,et al.  Symbolic evaluation and the global value graph , 1977, POPL.

[17]  Bernhard Steffen,et al.  Finite Constants: Characterizations of a New Decidable Set of Constants , 1991, Theor. Comput. Sci..

[18]  Steven S. Muchnick,et al.  Advanced Compiler Design and Implementation , 1997 .

[19]  Bud Mishra,et al.  Algorithmic Algebra , 1993, Texts and Monographs in Computer Science.

[20]  Patrick Cousot,et al.  Abstract Interpretation Frameworks , 1992, J. Log. Comput..