ABSTRACT
We introduce a language-independent framework for reasoning about program inverters by conditional term rewriting systems. These systems can model the three fundamental forms of inversion, i.e., full, partial and semi-inversion, in declarative languages.
The correctness of the generic inversion algorithm introduced in this contribution is proven for all well-behaved rule inverters, and we demonstrate that this class of inverters encompasses several of the inversion algorithms published throughout the past years.
This new generic approach enables us to establish fundamental properties, e.g., orthogonality, for entire classes of well-behaved full inverters, partial inverters and semi-inverters regardless of their particular local rule inverters. We study known inverters as well as classes of inverters that yield left-to-right deterministic systems; left-to-right determinism is a desirable property, e.g., for functional programs; however, at the same time it is not generally a property of inverted systems. This generic approach enables a more systematic design of program inverters and fills a gap in our knowledge of program inversion.
- Sergei M. Abramov and Robert Glück. 2002. The universal resolving algorithm and its correctness: inverse computation in a functional language. Science of Computer Programming 43, 2-3 (2002), 193–229. https://doi.org/10.1016/S0167-6423(02)00023-0Google ScholarCross Ref
- Jesús M. Almendros-Jiménez and Germán Vidal. 2007. Automatic partial inversion of inductively sequential functions. In Implementation and Application of Functional Languages. Proceedings(LNCS 4449), Zoltán Horváth et al.(Eds.). Springer, 253–270. https://doi.org/10.1007/978-3-540-74130-5_15Google Scholar
- Sergio Antoy. 2010. Programming with narrowing: A tutorial. Journal of Symbolic Computation 45, 5 (2010), 501–522. https://doi.org/10.1016/j.jsc.2010.01.006 (version: June 2017, update).Google ScholarDigital Library
- Franz Baader and Tobias Nipkow. 1998. Term Rewriting and All That. Cambridge University Press, United Kingdom.Google Scholar
- Marc Bezem, Jan W. Klop, and Roel de Vrijer. 2003. Term rewriting systems: Terese. Cambridge Tracts in Theoretical Computer Science, Vol. 55. Cambridge University Press, United Kingdom.Google Scholar
- Edsger W. Dijkstra. 1978. Program inversion. In Program Construction: International Summer School(LNCS 69), Friedrich L. Bauer and Manfred Broy (Eds.). Springer, 54–57. https://doi.org/10.1007/BFb0014657Google Scholar
- David Eppstein. 1985. A heuristic approach to program inversion. In International Joint Conference on Artificial Intelligence (IJCAI-85). Proceedings, Vol. 1. Morgan Kaufmann, Inc., 219–221.Google Scholar
- Robert Glück and Masahiko Kawabe. 2003. A program inverter for a functional language with equality and constructors. In Programming Languages and Systems. Proceedings(LNCS 2895), Atsushi Ohori (Ed.). Springer, 246–264. https://doi.org/10.1007/978-3-540-40018-9_17Google Scholar
- Robert Glück and Masahiko Kawabe. 2005. Revisiting an automatic program inverter for Lisp. SIGPLAN Notices 40, 5 (2005), 8–17. https://doi.org/10.1145/1071221.1071222Google ScholarDigital Library
- Robert Glück, Youhei Kawada, and Takuya Hashimoto. 2003. Transforming interpreters into inverse interpreters by partial evaluation. In Partial Evaluation and Semantics-Based Program Manipulation. Proceedings. ACM, 10–19. https://doi.org/10.1145/777388.777391Google Scholar
- Robert Glück and Andrei V. Klimov. 1994. Metacomputation as a tool for formal linguistic modeling. In Cybernetics and Systems ’94, Robert Trappl (Ed.), Vol. 2. World Scientific, 1563–1570.Google Scholar
- Robert Glück and Valentin F. Turchin. 1990. Application of metasystem transition to function inversion and transformation. In International Symposium on Symbolic and Algebraic Computation. Proceedings. ACM, 286–287. https://doi.org/10.1145/96877.96953Google Scholar
- Michael Hanus. 1994. The integration of functions into logic programming: From theory to practice. The Journal of Logic Programming 19-20, Suppl. 1 (1994), 583–628. https://doi.org/10.1016/0743-1066(94)90034-5Google ScholarCross Ref
- Michael Hanus. 1997. A unified computation model for functional and logic programming. In Proceedings of the 24th ACM Symposium on Principles of Programming Languages. ACM, 80–93. https://doi.org/10.1145/263699.263710Google ScholarDigital Library
- Peter G. Harrison and Hessam Khoshnevisan. 1992. On the synthesis of function inverses. Acta Informatica 29, 3 (1992), 211–239. https://doi.org/10.1007/BF01185679Google ScholarDigital Library
- Masahiko Kawabe and Robert Glück. 2005. The program inverter LRinv and its structure. In Practical Aspects of Declarative Languages. Proceedings(LNCS 3350), Manuel Hermenegildo and Daniel Cabeza (Eds.). Springer, 219–234. https://doi.org/10.1007/978-3-540-30557-6_17Google Scholar
- Maja H. Kirkeby and Robert Glück. 2020. Semi-inversion of conditional constructor term rewriting systems. In Logic-based Program Synthesis and Transformation. Proceedings(LNCS 12042), Maurizio Gabbrielli (Ed.). Springer, 243–259. https://doi.org/10.1007/978-3-030-45260-5_15Google Scholar
- Richard E. Korf. 1981. Inversion of applicative programs. In International Joint Conference on Artificial Intelligence (IJCAI-81). Proceedings. William Kaufmann, Inc., 1007–1009.Google Scholar
- Kazutaka Matsuda, Shin-Cheng Mu, Zhenjiang Hu, and Masato Takeichi. 2010. A grammar-based approach to invertible programs. In Programming Languages and Systems. Proceedings(LNCS 6012), Andrew D. Gordon (Ed.). Springer, 448–467. https://doi.org/10.1007/978-3-642-11957-6_24Google Scholar
- John McCarthy. 1956. The inversion of functions defined by Turing machines. In Automata Studies, Claude E. Shannon and John McCarthy (Eds.). Princeton University Press, 177–181.Google Scholar
- Torben Æ. Mogensen. 2005. Semi-inversion of guarded equations. In Generative Programming and Component Engineering. Proceedings(LNCS 3676), Robert Glück and Michael Lowry (Eds.). Springer, 189–204. https://doi.org/10.1007/11561347_14Google Scholar
- Torben Æ. Mogensen. 2007. Report on an implementation of a semi-inverter. In Perspectives of Systems Informatics. Proceedings(LNCS 4378), Irina Virbitskaite and Andrei Voronkov (Eds.). Springer, 322–334. https://doi.org/10.1007/978-3-540-70881-0_28Google Scholar
- Masanori Nagashima, Masahiko Sakai, and Toshiki Sakabe. 2012. Determinization of conditional term rewriting systems. Theoretical Computer Science 464 (2012), 72–89. https://doi.org/10.1016/j.tcs.2012.09.005Google ScholarDigital Library
- Naoki Nishida. 2004. Transformational Approach to Inverse Computation in Term Rewriting. Ph.D. Dissertation. Graduate School of Engineering, Nagoya University, Japan.Google Scholar
- Naoki Nishida, Adrián Palacios, and Germán Vidal. 2018. Reversible computation in term rewriting. Journal of Logical and Algebraic Methods in Programming 94 (2018), 128–149. https://doi.org/10.1016/j.jlamp.2017.10.003Google ScholarCross Ref
- Naoki Nishida, Masahiko Sakai, and Toshiki Sakabe. 2005. Partial inversion of constructor term rewriting systems. In Rewriting Techniques and Applications. Proceedings(LNCS 3467), Jürgen Giesl (Ed.). Springer, 264–278. https://doi.org/10.1007/978-3-540-32033-3_20Google Scholar
- Naoki Nishida and Germán Vidal. 2011. Program inversion for tail recursive functions. In Rewriting Techniques and Applications. Proceedings(LIPIcs), Manfred Schmidt-Schauß (Ed.), Vol. 10. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 283–298. https://doi.org/10.4230/LIPIcs.RTA.2011.283Google Scholar
- Enno Ohlebusch. 1999. Transforming conditional rewrite systems with extra variables into unconditional systems. In Logic Programming and Automated Reasoning. Proceedings(LNCS 1705), Harald Ganzinger et al. (Eds.). Springer, 111–130. https://doi.org/10.1007/3-540-48242-3_8Google Scholar
- Enno Ohlebusch. 2002. Advanced Topics in Term Rewriting. Springer, New York.Google Scholar
- Alexander Y. Romanenko. 1991. Inversion and metacomputation. In Partial Evaluation and Semantics-Based Program Manipulation. Proceedings. ACM, 12–22. https://doi.org/10.1145/115865.115868Google Scholar
- Peter Schneider-Kamp, Jürgen Giesl, Alexander Serebrenik, and René Thiemann. 2009. Automated termination proofs for logic programs by term rewriting. ACM Transactions on Computational Logic 11, 1 (2009), 2:1–2:52. https://doi.org/10.1145/1614431.1614433Google ScholarDigital Library
- Tetsuo Yokoyama and Robert Glück. 2007. A reversible programming language and its invertible self-interpreter. In Partial Evaluation and Program Manipulation. Proceedings. ACM, 144–153. https://doi.org/10.1145/1244381.1244404Google Scholar
- Amira Zaki, Thom Frühwirth, and Slim Abdennadher. 2013. Towards inverse execution of constraint handling rules. Theory and Practice of Logic Programming 13, 4-5 Online Supplement(2013), Article 10.Google Scholar
Recommendations
Semi-inversion of Conditional Constructor Term Rewriting Systems
Logic-Based Program Synthesis and TransformationAbstractInversion is an important and useful program transformation and has been studied in various programming language paradigms. Semi-inversion is more general than just swapping the input and output of a program; instead, parts of the input and output ...
A Critical Pair Criterion for Level-Commutation of Conditional Term Rewriting Systems
Frontiers of Combining SystemsAbstractThe rewrite relation of a conditional term rewriting system (CTRS) can be divided into a hierarchy of rewrite relations of term rewriting systems (TRSs) by the depth of the recursive use of rewrite relation in conditions; a CTRS is said to be ...
Operational termination of conditional term rewriting systems
We describe conditional rewriting by means of an inference system and capture termination as the absence of infinite inference: that is, all proof attempts must either successfully terminate, or they must fail in finite time. We call this notion ...
Comments