Skip to main content

Derivation of Deterministic Inverse Programs Based on LR Parsing

  • Conference paper
Functional and Logic Programming (FLOPS 2004)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 2998))

Included in the following conference series:

Abstract

We present a method for automatic program inversion of functional programs based on methods of LR parsing. We formalize the transformation and illustrate it with the inversion of a program for run-length encoding. We solve one of the main problems of automatic program inversion—the elimination of nondeterminism—by viewing an inverse program as a context-free grammar and applying to it methods of LR parsing to turn it into a recursive, deterministic inverse program. This improves the efficiency of the inverse programs and greatly expands the application range of our earlier method for program inversion.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Subscribe and save

Springer+ Basic
$34.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or eBook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Similar content being viewed by others

References

  1. 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)

    Chapter  Google Scholar 

  2. Abramov, S.M., Glück, R.: The universal resolving algorithm and its correctness: inverse computation in a functional language. Science of Computer Programming 43(2-3), 193–229 (2002)

    Article  MATH  MathSciNet  Google Scholar 

  3. Aho, A.V., Sethi, R., Ullman, J.D.: Compilers: Principles, Techniques and Tools. Addison-Wesley, Reading (1986)

    Google Scholar 

  4. Bird, R., de Moor, O.: Algebra of Programming. Prentice Hall International Series in Computer Science. Prentice-Hall, Englewood Cliffs (1997)

    MATH  Google Scholar 

  5. Darlington, J.: An experimental program transformation and synthesis system. Artificial Intelligence 16(1), 1–46 (1981)

    Article  Google Scholar 

  6. Dijkstra, E.W.: Program inversion. In: Gerhart, S.L., Pair, C., Pepper, P.A., Wössner, H., Dijkstra, E.W., Guttag, J.V., Owicki, S.S., Partsch, H., Bauer, F.L., Gries, D., Griffiths, M., Horning, J.J., Wirsing, M. (eds.) Program Construction. LNCS, vol. 69, pp. 54–57. Springer, Heidelberg (1979)

    Chapter  Google Scholar 

  7. 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)

    Google Scholar 

  8. 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)

    Chapter  Google Scholar 

  9. 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)

    Chapter  Google Scholar 

  10. Glück, R., Turchin, V.F.: Application of metasystem transition to function inversion and transformation. In: Proceedings of the Int. Symposium on Symbolic and Algebraic Computation (ISSAC 1990), pp. 286–287. ACM Press, New York (1990)

    Chapter  Google Scholar 

  11. Gries, D.: The Science of Programming. In: Inverting Programs. Texts and Monographs in Computer Science, ch. 21, pp. 265–274. Springer, Heidelberg (1981)

    Google Scholar 

  12. 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)

    Google Scholar 

  13. Korf, R.E.: Inversion of applicative programs. In: Int. Joint Conference on Artificial Intelligence (IJCAI 1981), pp. 1007–1009. William Kaufmann, Inc., San Francisco (1981)

    Google Scholar 

  14. Mu, S.-C., Bird, R.: Inverting functions as folds. In: Boiten, E.A., Möller, B. (eds.) MPC 2002. LNCS, vol. 2386, pp. 209–232. Springer, Heidelberg (2002)

    Chapter  Google Scholar 

  15. Nemytykh, P., Pinchuk, V.A.: Program transformation with metasystem transitions: experiments with a supercompiler. In: Bjorner, D., Broy, M., Pottosin, I.V. (eds.) PSI 1996. LNCS, vol. 1181, pp. 249–260. Springer, Heidelberg (1996)

    Google Scholar 

  16. Romanenko, Y.: Inversion and metacomputation. In: Proceedings of the ACM Symposium on Partial Evaluation and Semantics-Based Program Manipulation, pp. 12–22. ACM Press, New York (1991)

    Google Scholar 

  17. Turchin, V.F.: Program transformation with metasystem transitions. Journal of Functional Programming 3(3), 283–313 (1993)

    Article  MathSciNet  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2004 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Glück, R., Kawabe, M. (2004). Derivation of Deterministic Inverse Programs Based on LR Parsing. In: Kameyama, Y., Stuckey, P.J. (eds) Functional and Logic Programming. FLOPS 2004. Lecture Notes in Computer Science, vol 2998. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-24754-8_21

Download citation

  • DOI: https://doi.org/10.1007/978-3-540-24754-8_21

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-21402-1

  • Online ISBN: 978-3-540-24754-8

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics