Abstract
The paper presents a new method to prove the invariance of the system of linear inequalities and completability of linear definite iterative loops for imperative programs. Loop body is a linear operator that transforms the vector of program variables. The method takes into account loop precondition, as well as the condition of loop repetition in the form of a set of systems of linear inequalities. The method is based on the construction and analysis of the spectrum of linear operator and calculation of the number of loop iterations after which the invariance is either provided or disproved. The theory is illustrated by examples.
Similar content being viewed by others
References
R. W. Floyd, “Assigning meanings to programs,” in: J. T. Schwartz (ed.), Proc. Symp. on Applied Mathematics, 19, American Math. Society, Providence (1967), pp. 19–32.
C. A. R. Hoare, “An axiomatic basis for computer programming,” Communications of the ACM, 12, No. 10, 576–580 (1969).
A. B. Godlevskii, Yu. V. Kapitonova, S. L. Krivoy, and A. A. Letichevskii, “Iterative methods of program analysis,” Cybernetics, 25, No. 2, 139–152 (1989).
M. S. L’vov, “Invariant equalities of small degrees in programs defined over a field,” Kibernetika, No. 1, 108–110 (1988).
A. Letichevsky and M. Lvov, “Discovery of invariant equalities in programs over data fields,” Applicable Algebra in Engineering, Communication and Computing, No. 4, 21–29 (1993).
M. Lvov, “About one algorithm of program polynomial invariants generation,” in: M. Giese and T. Jebelean (eds.), Proc. Workshop on Invariant Generation, WING 2007, Technical Report No. 07-07 in RISC Report Series, University of Linz, Austria, June 2007, Workshop Proc. (2007), pp. 85–99.
M. Muller-Olm and H. Seidl, “Computing polynomial program invariants,” Inf. Process. Lett., 91, No. 5, 233–244 (2004).
M. Muller-Olm and H. Seidl, “Precise interprocedural analysis through linear algebra,” in: Proc. 31st ACM SIGPLAN-SIGACT Symp. on Principles of Programming Languages, SIGPLAN Notices, POPL ‘04, 39, No. 1, (2004), pp. 330–341.
S. Sankaranarayanan, H. Sipma, and Z. Manna, “Non-linear loop invariant generation using Grobner bases,” in: Proc. Symp. on Principles of Programming Languages, Venice, Italy, January 14–16, 2004, ACM, New York (2004), pp. 318–329.
E. Rodríguez-Carbonell and D. Kapur, “Automatic generation of polynomial loop invariants: algebraic foundations,” in: Proc. Intern. Symp. on Symbolic and Algebraic Computation, Santander, Spain, July 4–7, 2004, ACM, New York (2004), pp. 266–273.
L. I. Kovács and T. Jebelean, “An algorithm for automated generation of invariants for loops with conditionals,” in: Proc. Intern. Symp. on Symbolic and Numeric Algorithms for Scientific Computing, Timisoara, Romania, Sept. 25–29, 2005, IEEE Computer Society (2005), pp. 245–249.
M. S. Lvov, “Polynomial invariants for linear loops,” Cybern. Syst. Analysis, 46, No. 4, 660–668 (2010).
M. S. Lvov and V. A. Kreknin, “Nonlinear invariants for linear loops and eigenpolynomials of linear operators,” Cybern. Syst. Analysis, 48, No. 2, 268–281 (2012).
P. Cousot and N. Halbwachs, “Automatic discovery of linear restraints among variables of a program,” in: Conf. Record of the 5th Annual ACM SIGPLAN-SIGACT Symp. on Principles of Programming Languages, Tucson, Arizona, ACM Press, New York (1978), pp. 84–97.
S. L. Krivoi and S. G. Raksha, “Search for invariant linear relationships in programs,” Cybernetics, 20, No. 6, 796–803 (1984).
A. B. Godlevskii, Yu. V. Kapitonova, S. L. Krivoi, and A. A. Letichevskii, “Iterative methods of program analysis. Equalities and inequalities,” Cybernetics, 26, No. 3, 307–318 (1990).
M. S. L’vov, “Invariant inequalities in programs interpreted over an ordered field,” Cybernetics, 22, No. 5, 560–567 (1986).
M. S. Lvov, “On invariant inequalities for states of schemes of programs interpreted over a vector space,” Kibernetika, 21, No. 2, 111–112 (1985).
M. S. Lvov, “A method of proving the invariance of linear inequalities for linear loops,” Cybern. Syst. Analysis, 50, No. 4, 643–648 (2014).
A. V. Robinson, An Introduction to the Models Theory and Algebra Metamathematics [Russian translation], Nauka, GRFML, Moscow (1967).
B. L. van der Waerden, Algebra, Springer (2003).
W. V. D. Hodge and D. Pedoe, Methods of Algebraic Geometry, Vol. 1, Cambridge Univ. Press (1994).
B. Buchberger, G. E. Collins, R. Loos, and R. Albrecht (eds.), Computer Algebra: Symbolic and Algebraic Computation, Springer (1983).
Author information
Authors and Affiliations
Corresponding author
Additional information
Translated from Kibernetika i Sistemnyi Analiz, No. 1, January–February, 2016, pp. 122–136.
Rights and permissions
About this article
Cite this article
Lvov, M.S. Analysis of Linear Definite Iterative Loops. Cybern Syst Anal 52, 113–126 (2016). https://doi.org/10.1007/s10559-016-9806-5
Received:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s10559-016-9806-5