English

A Reversible Semantics for Janus

Programming Languages 2026-02-27 v2 Artificial Intelligence Logic in Computer Science

Abstract

Janus is a paradigmatic example of a reversible programming language. Indeed, Janus programs can be executed backwards as well as forwards. However, its current 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 a 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.

Cite

@article{arxiv.2602.16913,
  title  = {A Reversible Semantics for Janus},
  author = {Ivan Lanese and Germán Vidal},
  journal= {arXiv preprint arXiv:2602.16913},
  year   = {2026}
}

Comments

Submitted for publication

R2 v1 2026-07-01T10:42:11.365Z