Table of Contents
Fetching ...

A Reversible Semantics for Janus

Ivan Lanese, Germán Vidal

TL;DR

A novel small-step semantics which is actually reversible, while remaining equivalent to the previous one is presented, which involves the non-trivial challenge of defining a semantics based on a"program counter" for a high-level programming language.

Abstract

Janus is a paradigmatic example of reversible programming language. Indeed, Janus programs can be executed backwards as well as forwards. However, its small-step semantics (useful, e.g., for debugging or as a basis for extensions with concurrency primitives) is not reversible, since it loses information while computing forwards. E.g., it does not satisfy the Loop Lemma, stating that any reduction has an inverse, a main property of reversibility in process calculi, where small-step semantics is commonly used. We present here a novel small-step semantics which is actually reversible, while remaining equivalent to the previous one. It involves the non-trivial challenge of defining a semantics based on a "program counter" for a high-level programming language.

A Reversible Semantics for Janus

TL;DR

A novel small-step semantics which is actually reversible, while remaining equivalent to the previous one is presented, which involves the non-trivial challenge of defining a semantics based on a"program counter" for a high-level programming language.

Abstract

Janus is a paradigmatic example of reversible programming language. Indeed, Janus programs can be executed backwards as well as forwards. However, its small-step semantics (useful, e.g., for debugging or as a basis for extensions with concurrency primitives) is not reversible, since it loses information while computing forwards. E.g., it does not satisfy the Loop Lemma, stating that any reduction has an inverse, a main property of reversibility in process calculi, where small-step semantics is commonly used. We present here a novel small-step semantics which is actually reversible, while remaining equivalent to the previous one. It involves the non-trivial challenge of defining a semantics based on a "program counter" for a high-level programming language.
Paper Structure (5 sections, 4 theorems, 3 equations, 16 figures)

This paper contains 5 sections, 4 theorems, 3 equations, 16 figures.

Key Result

lemma thmcounterlemma

Let $\sigma \vdash s \Downarrow \sigma'$ be a proof with the big-step semantics of Figure fig:bigstep. Then, we have where $\pi$ is an arbitrary stack.

Figures (16)

  • Figure 1: Language syntax
  • Figure 2: Semantics of expressions
  • Figure 3: Big-step semantics of sequential Janus
  • Figure 4: Inverter function for Janus statements
  • Figure 5: Semantics of expressions
  • ...and 11 more figures

Theorems & Definitions (11)

  • lemma thmcounterlemma
  • proof
  • definition thmcounterdefinition: balanced derivation
  • definition thmcounterdefinition: loop derivation
  • definition thmcounterdefinition: trace
  • lemma thmcounterlemma
  • proof
  • theorem thmcountertheorem
  • proof
  • lemma thmcounterlemma
  • ...and 1 more