Abstract
An inverse of a program is a program that takes the output of the original program and produces its input. A semi-inverse of a program is a program that takes some of the input and some of the output of the original program and produces the remaining input and output. Inversion is, hence, a special case of semi-inversion.
We propose a method for inverting and semi-inverting programs written as guarded equations. The semi-inversion process is divided into four phases: Translation of equations into a relational form, refining operators, determining evaluation order for each equation of the semi-inverted functions and translation of semi-inverted functions back to the original syntax. In cases where the method fails to semi-invert a program, it can suggest which additional parts of the programs input or output are needed to make it work.
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
Bondorf, A.: Improving binding times without explicit CPS-conversion. In: ACM Conference on Lisp and Functional Programming, pp. 1–10. ACM Press, New York (1992)
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)
Glück, R.: Jones optimality, binding-time improvements, and the strength of program specializers. In: Proceedings of the Asian Symposium on Partial Evaluation and Semantics-Based Program Manipulation, pp. 9–19. ACM Press, New York (2002)
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)
Gries, D.: The Science of Programming. In: Inverting Programs. Texts and Monographs in Computer Science, ch. 21, pp. 265–274. Springer, Heidelberg (1981)
Holst, C.K., Hughes, J.: Towards binding-time improvement for free. In: [7], pp. 83–100 (1991)
Jones, S.L.P., Hutton, G., Holst, C.K. (eds.): Functional Programming, Glasgow 1990. Workshops in Computing. Springer, Heidelberg (1991)
Knapen, E.: Relational programming, program inversion and the derivation of parsing algorithms. Master’s thesis, Eindhoven University of Technology (1993)
Launchbury, J.: Projection Factorisations in Partial Evaluation. In: Distinguished Dissertations in Computer Science. Cambridge University Press, Cambridge (1991)
Launchbury, J.: Projections for specialisation. In: Bjørner, D., Ershov, A.P., Jones, N.D. (eds.) Partial Evaluation and Mixed Computation, pp. 299–315. North-Holland, Amsterdam (1988)
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)
Romanenko, A.Y.: The generation of inverse functions in Refal. In: Bjørner, D., Ershov, A.P., Jones, N.D. (eds.) Partial Evaluation and Mixed Computation, pp. 427–444. North-Holland, Amsterdam (1988)
Sterling, L., Shapiro, E.: The Art of Prolog, 2nd edn. MIT Press, Cambridge (1994)
Turchin, V.F.: The use of metasystem transition in theorem proving and program optimization. In: de Bakker, J.W., van Leeuwen, J. (eds.) ICALP 1980. LNCS, vol. 85, pp. 645–657. Springer, Heidelberg (1980)
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
Mogensen, T.Æ. (2005). Semi-inversion of Guarded Equations. In: Glück, R., Lowry, M. (eds) Generative Programming and Component Engineering. GPCE 2005. Lecture Notes in Computer Science, vol 3676. Springer, Berlin, Heidelberg. https://doi.org/10.1007/11561347_14
Download citation
DOI: https://doi.org/10.1007/11561347_14
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-29138-1
Online ISBN: 978-3-540-31977-1
eBook Packages: Computer ScienceComputer Science (R0)