Synthesizing Loops for Program Inversion

  • Cong Hou
  • Daniel Quinlan
  • David Jefferson
  • Richard Fujimoto
  • Richard Vuduc
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 7581)


We propose a new automatic program inversion method for imperative programs that contain loops. In particular, given a loop that produces an output state given a particular input state, our method can synthesize an inverse loop that reconstructs the input state given the original loop’s output state. The synthesis process consists of two major components: (a) building the inverse loop’s body, and (b) building the inverse loop’s predicate. Our method works for all natural loops, including those that take early exits (e.g., via breaks, gotos, returns). This work extends a program analysis and synthesis framework, called Backstroke, that we developed in prior work.


Program Inversion Program Synthesis Compilers 


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Biswas, B., Mall, R.: Reverse execution of programs. ACM SIGPLAN Notices 34(4), 61–69 (1999)CrossRefGoogle Scholar
  2. 2.
    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)CrossRefGoogle Scholar
  3. 3.
    Hou, C., Vulov, G., Quinlan, D., Jefferson, D., Fujimoto, R., Vuduc, R.: A New Method for Program Inversion. In: O’Boyle, M. (ed.) CC 2012. LNCS, vol. 7210, pp. 81–100. Springer, Heidelberg (2012)CrossRefGoogle Scholar
  4. 4.
    Jefferson, D.R.: Virtual time. ACM Transactions on Programming Languages and Systems 7(3), 404–425 (1985)MathSciNetCrossRefGoogle Scholar
  5. 5.
    Muchnick, S.S.: Advanced Compiler Design Implementation. Morgan Kaufmann Publishers (1997)Google Scholar
  6. 6.
    Pratt, V.R.: Semantical consideration on floyo-hoare logic. In: 17th Annual Symposium on Foundations of Computer Science (1976)Google Scholar
  7. 7.
    Ballance, R.A., Maccabe, A.B., Ottenstein, K.J.: The Program Dependence Web: A Representation Supporting Control-, Data-, and Demand-Driven Interpretation of Imperative Language. In: PLDI 1990 (1990)Google Scholar
  8. 8.
    Roşu, G., Ellison, C., Schulte, W.: Matching Logic: An Alternative to Hoare/Floyd Logic. In: Johnson, M., Pavlovic, D. (eds.) AMAST 2010. LNCS, vol. 6486, pp. 142–162. Springer, Heidelberg (2011)CrossRefGoogle Scholar
  9. 9.
    Pop, S., Jouvelot, P., Silber, G.-A.: In and Out of SSA: A Denotational Specification. In: Static Single-Assignment Form Seminar (2009)Google Scholar
  10. 10.
    Srivastava, S., Gulwani, S., Chaudhuri, S., Foster, J.S.: Path-based inductive synthesis for program inversion. In: PLDI 2011. ACM Press (2011)Google Scholar
  11. 11.
    Vulov, G., Hou, C., Vuduc, R., Quinlan, D., Fujimoto, R., Jefferson, D.: The backstroke framework for source level reverse computation applied to parallel discrete event simulation. In: Winter Simulation Conference (2011)Google Scholar
  12. 12.
    Wolfe, M.: Beyond Induction Variables. In: Proceedings of the ACM SIGPLAN 1992 Conference on Programming Language Design and Implementation, PLDI (1992)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2013

Authors and Affiliations

  • Cong Hou
    • 1
  • Daniel Quinlan
    • 2
  • David Jefferson
    • 2
  • Richard Fujimoto
    • 1
  • Richard Vuduc
    • 1
  1. 1.Georgia Institute of TechnologyUSA
  2. 2.Lawrence Livermore National LaboratoryUSA

Personalised recommendations