Clean Translation of an Imperative Reversible Programming Language (original) (raw)
Related papers
Reversers-A programming language construct for reversing out of code
Advances in Systems, Computing Sciences and Software Engineering, 2006
This paper proposes a new programming language construct called a reverser for situations in which a subroutine performs actions that it must reverse if it encounters a failure. The reversal code stacks up as more actions are performed. A failure invokes all the reversals in LIFO order; success invokes none of them. The reverser construct avoids a common situation in the Linux source code that is currently programmed by goto statements.
A new method for program inversion
2012
Program inversion has been successfully applied to several areas such as optimistic parallel discrete event simulation (OPDES) and reverse debugging. This paper introduces a new program inversion algorithm for imperative languages, and focuses on handling arbitrary control flows and basic operations. By building a value search graph that represents recoverability relationships between variable values, we turn the problem of recovering previous values into a graph search one.
A New Compiler: Code Conversion at Assembly Level
International Journal of Engineering and Advanced Technology, 2020
Ever switched programming languages? If yes, you know how difficult it is to learn the syntax and get familiar with new language. But what if we write the code in our preferred language and it can run as any other language’s code. The thing is, whatever we write ultimately gets converted to 0’s and 1’s, the only difference is how these 0’s and 1’s is shown to our machine. We may need different languages, but what if the code with the syntax of one language, runs reasonably well as if it was written with syntax of some other language. This is where a compiler comes in[1]. The aim of this paper is to develop a compiler which could create a new code for another language, based on the machine code developed by other languages. This compiler solves two problems Syntax issue and Universal Compiler.
A Symmetric Approach to Compilation and Decompilation
Lecture Notes in Computer Science, 2002
Abstract. Just as an interpreter for a source language can be turned into a compiler from the source language to a target language, we observe that an interpreter for a target language can be turned into a compiler from the target language to a source language. In both cases, the key ...
ASIF: An Internal Representation Suitable for Program Transformation and Parallel Conversion
2021
Adding the Transformation and Parallelization capabilities to a compiler requires selecting a suitable language for representing the given program internally. The higher level language used to develop the code is an obvious choice but supporting the transformations at that level would require major rework to support other higher languages. The other choice is to use the assembly representation of the given program for implementing transformations. But this would require rework when supporting multiple targets. These considerations lead to the development of an internal representation that is not tied to any specific higher level language or hardware architecture. However, creating a new Internal Representation for a compiler that ultimately determines the quality and the capabilities of the compiler offers challenges of its own. Here we explore the design choices that determine the flavor of a representation, and propose a representation that includes, Instructions and Annotations t...
A Grammar-Based Approach to Invertible Programs
Lecture Notes in Computer Science, 2010
Program inversion has many applications such as in the implementation of serialization/deserialization and in providing support for redo/undo, and has been studied by many researchers. However, little attention has been paid to two problems: how to characterize programs that are easy or hard to invert and whether, for each class of programs, efficient inverses can be obtained. In this paper, we propose an inversion framework that we call grammar-based inversion, where a program is associated with an unambiguous grammar describing the range of the program. The complexity of the grammar indicates how hard it is to invert the program, while the complexity is related to how efficient an inverse can be obtained.
A syntactic approach to program transformations
ACM SIGPLAN Notices, 1991
Kid, a language for expressing compiler optimizations for functional languages is introduced. The language is -calculus based but treats let-blocks as rst class objects. Let-blocks and associated rewrite rules provide the basis to capture the sharing of subexpressions precisely. The language goes beyond -calculus by including I-structures which are essential to express e cient translations of list and array comprehensions. A calculus and a parallel interpreter for Kid are developed. Many commonly known program transformations are also presented. A partial evaluator for Kid is developed and a notion of correctness of Kid transformations based on the syntactic structure of terms and printable answers is presented.
Control flow reversal for adjoint code generation
Source Code Analysis and Manipulation, Fourth IEEE International Workshop on, 2004
We describe an approach to the reversal of the control flow of structured programs. It is used to automatically generate adjoint code for numerical programs by semantic source transformation. After a short introduction to applications and the implementation tool set, we describe the building blocks using a simple example. We then illustrate the code reversal within basic blocks. The main part of the paper covers the reversal of structured control flow graphs. We show the algorithmic steps for simple branches and loops and give a detailed algorithm for the reversal of arbitrary combinations of loops and branches in a general control flow graph. 1
Recursive AOP for Reversible Software
Baltic Journal of Modern Computing
Innovative paradigm of reversible computing (RC) is on the focus of current computer science. The main idea of it is to enable the execution of programs not forward only (as it is now) but backwards as well. The set of possible applications of RC includes software debugging, faulttolerance increasing and quantum computing. In order to do reversible computing operational there is a need to code (manually) or to generate opposite "reverse" element for each "forward" element. However, this emerging paradigm still needs the methods for expressing opposite language elements in advance (during design-time). On the other hand, classic Aspect oriented paradigm (AOP) helps to deal with crosscutting concerns such as security, transactions etc. at design time, allows to separate development tasks by proficiency instead of by modules and to run weaved program at run-time. In this paper author present the idea to express opposite language elements by using recursive aspects.