skip to main content
10.1145/3414080.3414089acmotherconferencesArticle/Chapter ViewAbstractPublication PagesppdpConference Proceedingsconference-collections
research-article

Inversion Framework: Reasoning about Inversion by Conditional Term Rewriting Systems

Published:21 September 2020Publication History

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.

References

  1. 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 ScholarGoogle ScholarCross RefCross Ref
  2. 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 ScholarGoogle Scholar
  3. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  4. Franz Baader and Tobias Nipkow. 1998. Term Rewriting and All That. Cambridge University Press, United Kingdom.Google ScholarGoogle Scholar
  5. 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 ScholarGoogle Scholar
  6. 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 ScholarGoogle Scholar
  7. 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 ScholarGoogle Scholar
  8. 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 ScholarGoogle Scholar
  9. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  10. 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 ScholarGoogle Scholar
  11. 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 ScholarGoogle Scholar
  12. 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 ScholarGoogle Scholar
  13. 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 ScholarGoogle ScholarCross RefCross Ref
  14. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  15. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  16. 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 ScholarGoogle Scholar
  17. 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 ScholarGoogle Scholar
  18. Richard E. Korf. 1981. Inversion of applicative programs. In International Joint Conference on Artificial Intelligence (IJCAI-81). Proceedings. William Kaufmann, Inc., 1007–1009.Google ScholarGoogle Scholar
  19. 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 ScholarGoogle Scholar
  20. 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 ScholarGoogle Scholar
  21. 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 ScholarGoogle Scholar
  22. 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 ScholarGoogle Scholar
  23. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  24. Naoki Nishida. 2004. Transformational Approach to Inverse Computation in Term Rewriting. Ph.D. Dissertation. Graduate School of Engineering, Nagoya University, Japan.Google ScholarGoogle Scholar
  25. 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 ScholarGoogle ScholarCross RefCross Ref
  26. 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 ScholarGoogle Scholar
  27. 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 ScholarGoogle Scholar
  28. 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 ScholarGoogle Scholar
  29. Enno Ohlebusch. 2002. Advanced Topics in Term Rewriting. Springer, New York.Google ScholarGoogle Scholar
  30. 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 ScholarGoogle Scholar
  31. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  32. 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 ScholarGoogle Scholar
  33. 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 ScholarGoogle Scholar

Recommendations

Comments

Login options

Check if you have access through your login credentials or your institution to get full access on this article.

Sign in
  • Published in

    cover image ACM Other conferences
    PPDP '20: Proceedings of the 22nd International Symposium on Principles and Practice of Declarative Programming
    September 2020
    179 pages
    ISBN:9781450388214
    DOI:10.1145/3414080

    Copyright © 2020 ACM

    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 the author(s) 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: 21 September 2020

    Permissions

    Request permissions about this article.

    Request Permissions

    Check for updates

    Qualifiers

    • research-article
    • Research
    • Refereed limited

    Acceptance Rates

    Overall Acceptance Rate230of486submissions,47%

PDF Format

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

HTML Format

View this article in HTML Format .

View HTML Format