Nothing Special   »   [go: up one dir, main page]

skip to main content
article

Transforming interpreters into inverse interpreters by partial evaluation

Published: 07 June 2003 Publication History

Abstract

The experiments in this paper apply the idea of prototyping programming language tools from robust semantics: we used a partial evaluator (Similix) to turn interpreters into inverse interpreters. This way we generated inverse interpreters for several small languages including interpreters for Turing machines, an applied lambda calculus, a flowchart language, and a subset of Java bytecode. Limiting factors of online partial evaluation were the polyvariant specialization scheme with its lack of generalization;advantages were the availability of higher-order values to specialize a breadth-first tree traversal.This application of self-applicable partial evaluation is different from the classical Futamura projections that tell us how to translate a program by specialization of an interpreter.

References

[1]
S. M. Abramov and R. Glück. Combining semantics with non-standard interpreter hierarchies. In S. Kapoor and S. Prasad, editors, Foundations of Software Technology and Theoretical Computer Science. Proceedings, LNCS 1974, pages 201--213. Springer-Verlag,2000.]]
[2]
S. M. Abramov and R. Gl ück. From standard to non-standard semantics by semantics modifiers. International Journal of Foundations of Computer Science, 12(2):171--211, 2001.]]
[3]
S. M. Abramov and R. Glück. Principles of inverse computation and the universal resolving algorithm. In T. A. Mogensen, D. Schmidt, and H. I. Sudborough, editors, The Essence of Computation: Complexity, Analysis, Transformation, LNCS 2566, pages 269--295. Springer-Verlag, 2002.]]
[4]
S. M. Abramov and R. Glück. The universal resolving algorithm and its correctness: inverse computation in a functional language. Science of Computer Programming, 43(2-3):193--229, 2002.]]
[5]
E. Albert and G. Vidal. The narrowing-driven approach to functional logic program specialization. New Generation Computing, 20(1):3--26, 2002.]]
[6]
A. Bondorf. Automatic autoprojection of higher order recursive equations. Science of Computer Programming,17(1 .3):3--34, 1991.]]
[7]
A. Bondorf. Similix 5.0 Manual. DIKU, University of Copenhagen, Denmark, 1993. Included in the Similix distribution, 82 pages.]]
[8]
A. Bondorf and O. Danvy. Automatic autoprojection of recursive equations with global variables and abstract data types. Science of Computer Programming,16:151--195, 1991.]]
[9]
A. Bondorf and J. Jorgensen. Efficient analyses for realistic off-line partial evaluation. Journal of Functional Programming, 11:315--346, 1993.]]
[10]
A. Bondorf and J. Palsberg. Generating action compilers by partial evaluation. Journal of Functional Programming, 6(2):269--298, 1996.]]
[11]
N. H. Christensen and R. Glück. On the equivalence of online and offine partial evaluation. Manuscript, DIKU, Department of Computer Science, University of Copenhagen, 2001.]]
[12]
E. W. Dijkstra. Program inversion. In F. L. Bauer and M. Broy, editors, Program Construction: International Summer School, LNCS 69, pages 54--57. Springer-Verlag, 1978.]]
[13]
R.Glück and A. V. Klimov. Occam's razor in metacomputation: the notion of a perfect process tree. In P. Cousot, M. Falaschi,G.Filé, and A. Rauzy, editors, Static Analysis. Proceedings, LNCS 724, pages 112--123. Springer-Verlag, 1993.]]
[14]
R.Glück and M. H. Sorensen. Partial deduction and driving are equivalent. In M. Hermenegildo and J. Penjam, editors, Programming Language Implementation and Logic Programming.Proceedings, LNCS 844, pages 165--181. Springer-Verlag, 1994.]]
[15]
M. Hanus. The integration of functions into logic programming: from theory to practice. Journal of Logic Programming,19&20: 583--628, 1994.]]
[16]
J. Hatcliff. An introduction to online and offline partial evaluation using a simple flowchart language. In J. Hatcliff, T. Mogensen, and P. Thiemann, editors, Partial Evaluation.Practice and Theory, LNCS 1706, pages 20--82. Springer-Verlag, 1999.]]
[17]
N. D. Jones, C. K. Gomard, and P. Sestoft. Partial Evaluation and Automatic Program Generation. Prentice-Hall, 1993.]]
[18]
J. Jorgensen. Generating a compiler for a lazy language by partial evaluation. In Conference Record of the Nighteenth Symposium on Principles of Programming Languages, pages 258--268. ACM Press, 1992.]]
[19]
J. Jorgensen. Similix: a self-applicable partial evaluator for scheme. In J.Hatcliff, T. Mogensen, and P. Thiemann, editors, Partial Evaluation. Practice and Theory, LNCS 1706, pages 83--107. Springer-Verlag, 1999.]]
[20]
S. Katsumata and A. Ohori. Proof-directed de-compilation of Java bytecode. In D. Sands, editor, Programming Languages and Systems. Proceedings, LNCS 2028, pages 352--366. Springer-Verlag, 2001.]]
[21]
J. McCarthy. The inversion of functions defined by Turing machines. In C. E. Shannon and J. McCarthy, editors, Automata Studies, pages 177--181. Princeton University Press, 1956.]]
[22]
S.-C. Mu and R. Bird. Inverting functions as folds. In E. A. Boiten and B. Möller, editors, Mathematics of Program Construction. Proceedings, LNCS 2386, pages 209--232. Springer-Verlag, 2002.]]
[23]
A. P. Nemytykh and V. A. Pinchuk. Program transformation with metasystem transitions: experiments with a supercompiler. In D.Bjorner, M. Broy, and I. V. Pottosin, editors, Perspectives of System Informatics. Proceedings, LNCS 1181, pages 249--260. Springer-Verlag, 1996.]]
[24]
S. Thibault, C. Consel, J. L. Lawall, R. Marlet, and G. Muller. Static and dynamic program compilation by interpreter specialization. Higher-Order and Symbolic Computation, 13(3):161--178, 2000.]]

Cited By

View all

Recommendations

Comments

Please enable JavaScript to view thecomments powered by Disqus.

Information & Contributors

Information

Published In

cover image ACM SIGPLAN Notices
ACM SIGPLAN Notices  Volume 38, Issue 10
Proceedings of the ACM SIGPLAN symposium on principles and practice of parallel programming (PPoPP 2003) and workshop on partial evaluation and semantics-based program manipulation (PEPM 2003)
October 2003
331 pages
ISSN:0362-1340
EISSN:1558-1160
DOI:10.1145/966049
Issue’s Table of Contents
  • cover image ACM Conferences
    PEPM '03: Proceedings of the 2003 ACM SIGPLAN workshop on Partial evaluation and semantics-based program manipulation
    June 2003
    100 pages
    ISBN:1581136676
    DOI:10.1145/777388
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 07 June 2003
Published in SIGPLAN Volume 38, Issue 10

Check for updates

Author Tags

  1. binding-time improvements
  2. inverse interpreter
  3. program in-vision
  4. self-application
  5. semantics modifier

Qualifiers

  • Article

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)4
  • Downloads (Last 6 weeks)0
Reflects downloads up to 22 Nov 2024

Other Metrics

Citations

Cited By

View all
  • (2022)Reversible Computing from a Programming Language PerspectiveTheoretical Computer Science10.1016/j.tcs.2022.06.010Online publication date: Dec-2022
  • (2016)On reversible Turing machines and their function universalityActa Informatica10.1007/s00236-015-0253-y53:5(509-543)Online publication date: 27-Jan-2016
  • (2013)Improving Determinization of Grammar Programs for Program InversionLogic-Based Program Synthesis and Transformation10.1007/978-3-642-38197-3_11(155-175)Online publication date: 2013
  • (2019)A Method for Automatic Program Inversion Based on LR(0) ParsingFundamenta Informaticae10.5555/2370162.237016666:4(367-395)Online publication date: 4-Jan-2019
  • (2019)A Method for Automatic Program Inversion Based on LR(0) ParsingFundamenta Informaticae10.5555/1227189.122719366:4(367-395)Online publication date: 4-Jan-2019
  • (2019)On reversible Turing machines and their function universalityActa Informatica10.1007/s00236-015-0253-y53:5(509-543)Online publication date: 2-Jan-2019
  • (2009)An experiment with the fourth Futamura projectionProceedings of the 7th international Andrei Ershov Memorial conference on Perspectives of Systems Informatics10.1007/978-3-642-11486-1_12(135-150)Online publication date: 15-Jun-2009
  • (2007)Report on an Implementation of a Semi-inverterPerspectives of Systems Informatics10.1007/978-3-540-70881-0_28(322-334)Online publication date: 2007
  • (2006)Report on an implementation of a semi-inverterProceedings of the 6th international Andrei Ershov memorial conference on Perspectives of systems informatics10.5555/1760700.1760730(322-334)Online publication date: 27-Jun-2006
  • (2005)Revisiting an automatic program inverter for LispACM SIGPLAN Notices10.1145/1071221.107122240:5(8-17)Online publication date: 1-May-2005
  • Show More Cited By

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media