We present a reversible runtime environment for simple parallel programs and its experimental implementation. We aim at a light-weight implementation of the backtrack reversibility by the state-saving mechanism using stacks. We translate a program to a sequence of simple commands of an executable intermediate representation for reversible stack machines. The parallel composition is implemented using the multiprocessing feature of Python. While executing the commands, the stack machines collect the information for the backward execution in the auxiliary stacks for the update history of the variables and the history of jumps. The commands for the backward execution is obtained by reversing the commands for the forward execution by replacing each command with the corresponding reversed command. In the purpose of behaviour analysis with reversibility such as debugging, our runtime is more portable than the source-to-source translation of a high-level programming language.
[1]
Irek Ulidowski,et al.
Reversible Imperative Parallel Programs and Debugging
,
2019,
RC.
[2]
Ivan Lanese,et al.
A Reversible Abstract Machine and Its Space Overhead
,
2012,
FMOODS/FORTE.
[3]
Robert Glück,et al.
A reversible programming language and its invertible self-interpreter
,
2007,
PEPM '07.
[4]
Holger Bock Axelsen,et al.
Interpretation and programming of the reversible functional language RFUN
,
2015,
IFL '15.
[5]
Robert Glück,et al.
Reversible Machine Code and Its Abstract Processor Architecture
,
2007,
CSR.
[6]
Alan T. Sherman,et al.
A Note on Bennett's Time-Space Tradeoff for Reversible Computation
,
1990,
SIAM J. Comput..
[7]
Irek Ulidowski,et al.
Reversing Parallel Programs with Blocks and Procedures
,
2018,
EXPRESS/SOS.