Abstract
Program inversion is a fundamental concept in programtransformation. We describe the principles behind an automatic program inverter, which we developed for a first-order functional language, and show several inverse programs automatically produced by our system. The examples belong to different application areas, including encoding and decoding, printing and parsing, and bidirectional data conversion. The core of the system uses a stack-based language, local inversion, and eliminates nondeterminism by applying methods from parsing theory.
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
Abramov, S.M., Glück, R.: Principles of inverse computation and the universal resolving algorithm. In: Mogensen, T.Æ., Schmidt, D.A., Sudborough, I.H. (eds.) The Essence of Computation. LNCS, vol. 2566, pp. 269–295. Springer, Heidelberg (2002)
Bird, R., de Moor, O.: Algebra of Programming. Prentice Hall International Series in Computer Science. Prentice Hall, Englewood Cliffs (1997)
Dijkstra, E.W.: Program inversion. In: Bauer, F.L., Broy, M. (eds.) Program Construction: International Summer School. LNCS, vol. 69, pp. 54–57. Springer, Heidelberg (1978)
Eppstein, D.: A heuristic approach to program inversion. In: Int. Joint Conference on Artificial Intelligence (IJCAI 1985), pp. 219–221. Morgan Kaufmann, Inc., San Francisco (1985)
Floyd, R.W.: Nondeterministic algorithms. Journal of the ACM 14(4), 636–644 (1967)
Glück, R., Kawabe, M.: A program inverter for a functional language with equality and constructors. In: Ohori, A. (ed.) APLAS 2003. LNCS, vol. 2895, pp. 246–264. Springer, Heidelberg (2003)
Glück, R., Kawabe, M.: Derivation of deterministic inverse programs based on LR parsing. In: Kameyama, Y., Stuckey, P.J. (eds.) FLOPS 2004. LNCS, vol. 2998, pp. 291–306. Springer, Heidelberg (2004)
Glück, R., Kawada, Y., Hashimoto, T.: Transforming interpreters into inverse interpreters by partial evaluation. In: Proceedings of the ACM SIGPLAN Workshop on Partial Evaluation and Semantics-Based Program Manipulation, pp. 10–19. ACM Press, New York (2003)
Gries, D.: The Science of Programming. In: Inverting Programs, ch. 21. Texts and Monographs in Computer Science, pp. 265–274. Springer, Heidelberg (1981)
Hu, Z., Mu, S.-C., Takeichi, M.: A programmable editor for developing structured documents based on bidirectional transformations. In: Proceedings of the ACM SIGPLAN Symposium on Partial Evaluation and Semantics-Based Program Manipulation, pp. 178–189. ACM Press, New York (2004)
Khoshnevisan, H., Sephton, K.M.: InvX: An automatic function inverter. In: Dershowitz, N. (ed.) RTA 1989. LNCS, vol. 355, pp. 564–568. Springer, Heidelberg (1989)
Knuth, D.E.: On the translation of languages from left to right. Information and Control 8(6), 607–639 (1965)
McCarthy, J.: The inversion of functions defined by Turing machines. In: Shannon, C.E., McCarthy, J. (eds.) Automata Studies, pp. 177–181. Princeton University Press, Princeton (1956)
Mu, S.-C., Bird, R.S.: Inverting functions as folds. In: Boiten, E.A., Möller, B. (eds.) MPC 2002. LNCS, vol. 2386, pp. 209–232. Springer, Heidelberg (2002)
Mu, S.-C., Hu, Z., Takeichi, M.: An injective language for reversible computation. In: Kozen, D. (ed.) MPC 2004. LNCS, vol. 3125, pp. 289–313. Springer, Heidelberg (2004)
Pettorossi, A., Proietti, M., Renault, S.: Reducing nondeterminism while specializing logic programs. In: Proceedings of the Twenty Fourth ACM Symposium on Principles of Programming Languages, pp. 414–427. ACM Press, New York (1997)
Rosenblueth, D.A., Peralta, J.C.: SLR inference an inference system for fixed-mode logic programs based on SLR parsing. Journal of Logic Programming 34(3), 227–259 (1998)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2005 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Kawabe, M., Glück, R. (2005). The Program Inverter LRinv and Its Structure. In: Hermenegildo, M.V., Cabeza, D. (eds) Practical Aspects of Declarative Languages. PADL 2005. Lecture Notes in Computer Science, vol 3350. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-30557-6_17
Download citation
DOI: https://doi.org/10.1007/978-3-540-30557-6_17
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-24362-5
Online ISBN: 978-3-540-30557-6
eBook Packages: Computer ScienceComputer Science (R0)