Derivation of Deterministic Inverse Programs Based on LR Parsing

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.

[1]  David Eppstein,et al.  A Heuristic Approach to Program Inversion , 1985, IJCAI.

[2]  Richard E. Korf Inversion of Applicative Programs , 1981, IJCAI.

[3]  Edsger W. Dijkstra,et al.  Program Inversion , 1978, Program Construction.

[4]  Robert Glück,et al.  The universal resolving algorithm and its correctness: inverse computation in a functional language , 2002, Sci. Comput. Program..

[5]  Andrei P. Nemytykh,et al.  Program Transformation with Metasystem Transitions: Experiments with a Supercompiler , 1996, Ershov Memorial Conference.

[6]  Atsushi Ohori Programming Languages and Systems , 2003, Lecture Notes in Computer Science.

[7]  Richard S. Bird,et al.  Algebra of programming , 1997, Prentice Hall International series in computer science.

[8]  Robert Glück,et al.  Application of metasystem transition to function inversion and transformation , 1990, ISSAC '90.

[9]  John Darlington,et al.  An Experimental Program Transformation and Synthesis System , 1986, Artif. Intell..

[10]  Robert Glück,et al.  A Program Inverter for a Functional Language with Equality and Constructors , 2003, APLAS.

[11]  Bernhard Möller,et al.  Mathematics of Program Construction , 2002, Lecture Notes in Computer Science.

[12]  Shin-Cheng Mu,et al.  Inverting Functions as Folds , 2002, MPC.

[13]  Robert Glück,et al.  Transforming interpreters into inverse interpreters by partial evaluation , 2003, PPoPP 2003.

[14]  Hessam Khoshnevisan,et al.  InvX: An Automatic Function Inverter , 1989, RTA.

[15]  Alexander Romanenko,et al.  Inversion and metacomputation , 1991, PEPM '91.

[16]  Alfred V. Aho,et al.  Compilers: Principles, Techniques, and Tools , 1986, Addison-Wesley series in computer science / World student series edition.

[17]  David Gries,et al.  The Science of Programming , 1981, Text and Monographs in Computer Science.

[18]  Valentin F. Turchin,et al.  Program transformation with metasystem transitions , 1993, Journal of Functional Programming.

[19]  Robert Glück,et al.  Principles of Inverse Computation and the Universal Resolving Algorithm , 2002, The Essence of Computation.