Abstract
Program inversion has been successfully applied to several areas such as optimistic parallel discrete event simulation (OPDES) and reverse debugging. This paper introduces a new program inversion algorithm for imperative languages, and focuses on handling arbitrary control flows and basic operations. By building a value search graph that represents recoverability relationships between variable values, we turn the problem of recovering previous values into a graph search one. Forward and reverse code is generated according to the search results. We have implemented our algorithm as part of a compiler framework named Backstroke, a C++ source-to-source translator based on ROSE compiler. Backstroke targets optimistic simulation codes and automatically generates a reverse function to recover values modified by a target function. Experimental results show that our method is effective and produces better performance than previously proposed methods.
Chapter PDF
References
Abramov, S., Glück, R.: The Universal Resolving Algorithm: Inverse Computation in a Functional Language. Science of Computer Programming 43(2-3), 193–229 (2002)
Akgul, T., Mooney III, V.J.: Assembly instruction level reverse execution for debugging. ACM Transactions on Software Engineering and Methodology 13(2), 149–198 (2004)
Alpern, B., Wegman, M.N., Kenneth, F.: Detecting Equality of Variables in Programs. In: PPL (January 1988)
Ball, T., Larus, J.R.: Optimally profiling and tracing programs. ACM Transactions on Programming Languages and Systems 16(4), 1319–1360 (1994)
Ball, T., Larus, J.R.: Efficient Path Profiling. In: MICRO 1996, pp. 46–57 (1996)
Biswas, B., Mall, R.: Reverse execution of programs. ACM SIGPLAN Notices 34(4), 61–69 (1999)
Briggs, J.S.: Generating reversible programs. Software: Practice and Experience 17(7), 439–453 (1987)
Carothers, C.D., Perumalla, K.S., Fujimoto, R.M.: Efficient Optimistic Parallel Simulations Using Reverse Computation. In: PADS (1999)
Chow, F., Chan, S., Liu, S.-M., Lo, R., Streich, M.: Effective Representation of Aliases and Indirect Memory Operations in SSA Form. In: Gyimóthy, T. (ed.) CC 1996. LNCS, vol. 1060, pp. 253–267. Springer, Heidelberg (1996)
Cooper, K.D., Taylor Simpson, L., Vick, C.A.: Operator strength reduction. ACM Transactions on Programming Languages and Systems 23(5), 603–625 (2001)
Cytron, R., Ferrante, J., Rosen, B.K., Wegman, M.N., Zadeck, F.K.: Efficiently computing static single assignment form and the control dependence graph. ACM Transactions on Programming Languages and Systems 13(4), 451–490 (1991)
Ferrante, J., Ottenstein, K.J., Warren, J.D.: The program dependence graph and its use in optimization. ACM Transactions on Programming Languages and Systems 9(3), 319–349 (1987)
Fink, S., Knobe, K., Sarkar, V.: Unified Analysis of Array and Object References in Strongly Typed Languages. In: SAS 2000. LNCS, vol. 1824, pp. 155–174. Springer, Heidelberg (2000)
Fujimoto, R.M.: Parallel and Distributed Simulation Systems. Wiley (2000)
Glück, R., Kawabe, M.: Revisiting an automatic program inverter for Lisp. ACM SIGPLAN Notices 40(5), 8–17 (2005)
Jefferson, D.R.: Virtual time. ACM Transactions on Programming Languages and Systems 7(3), 404–425 (1985)
Kawabe, M., Glück, R.: The Program Inverter LRinv and Its Structure. In: Hermenegildo, M.V., Cabeza, D. (eds.) PADL 2004. LNCS, vol. 3350, pp. 219–234. Springer, Heidelberg (2005)
Knobe, K., Sarkar, V.: Array SSA form and its use in parallelization. In: POPL 1998, pp. 107–120. ACM Press, New York (1998)
Muchnick, S.S.: Advanced Compiler Design and Implementation (1997)
Ross, B.J.: Running programs backwards: The logical inversion of imperative computation. Formal Aspects of Computing 9(3), 331–348 (1997)
Srivastava, S., Gulwani, S., Chaudhuri, S., Foster, J.S.: Path-based inductive synthesis for program inversion. In: PLDI 2011, p. 492. ACM Press, New York (2011)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2012 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Hou, C., Vulov, G., Quinlan, D., Jefferson, D., Fujimoto, R., Vuduc, R. (2012). A New Method for Program Inversion. In: O’Boyle, M. (eds) Compiler Construction. CC 2012. Lecture Notes in Computer Science, vol 7210. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-28652-0_5
Download citation
DOI: https://doi.org/10.1007/978-3-642-28652-0_5
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-642-28651-3
Online ISBN: 978-3-642-28652-0
eBook Packages: Computer ScienceComputer Science (R0)