Resumptions, Weak Bisimilarity and Big-Step Semantics for While with Interactive I/O: An Exercise in Mixed Induction-Coinduction

Resumptions, Weak Bisimilarity and Big-Step Semantics for While with   Interactive I/O: An Exercise in Mixed Induction-Coinduction
Notice: This research summary and analysis were automatically generated using AI technology. For absolute accuracy, please refer to the [Original Paper Viewer] below or the Original ArXiv Source.

We look at the operational semantics of languages with interactive I/O through the glasses of constructive type theory. Following on from our earlier work on coinductive trace-based semantics for While, we define several big-step semantics for While with interactive I/O, based on resumptions and termination-sensitive weak bisimilarity. These require nesting inductive definitions in coinductive definitions, which is interesting both mathematically and from the point-of-view of implementation in a proof assistant. After first defining a basic semantics of statements in terms of resumptions with explicit internal actions (delays), we introduce a semantics in terms of delay-free resumptions that essentially removes finite sequences of delays on the fly from those resumptions that are responsive. Finally, we also look at a semantics in terms of delay-free resumptions supplemented with a silent divergence option. This semantics hinges on decisions between convergence and divergence and is only equivalent to the basic one classically. We have fully formalized our development in Coq.


💡 Research Summary

The paper investigates the operational semantics of a simple imperative language, While, extended with interactive input/output, from the perspective of constructive type theory. Building on earlier work that gave a coinductive trace‑based semantics for the pure While language, the authors introduce three big‑step semantics that make use of resumptions and a termination‑sensitive notion of weak bisimilarity. The central technical challenge is that each semantics nests an inductive definition inside a coinductive one, a pattern that is both mathematically interesting and non‑trivial to encode in a proof assistant such as Coq.

The first semantics is the “basic” one. It interprets each statement as a coinductive resumption that may emit three kinds of observable actions: an input request, an output value, or an internal delay (τ‑action). Delays model finite periods of internal computation or scheduling that do not involve the environment. The resumption type is essentially a coinductive tree whose nodes are labelled by these actions and whose branches point to the continuation state. Weak bisimilarity is defined on this structure by ignoring finite sequences of τ‑actions and comparing only the observable I/O actions. The authors prove that weak bisimilarity is an equivalence relation and that it respects the big‑step evaluation relation.

The second semantics refines the basic one by eliminating finite stretches of delays on the fly. The authors define a transformation that, given a “responsive” resumption (i.e., one that eventually performs an observable I/O action), collapses any leading finite τ‑sequence into a single τ‑step or removes it entirely. This transformation is expressed as a coinductive function that internally uses an inductive recursion to scan the initial τ‑chain. Implementing this in Coq requires a careful mix of CoFixpoint (for the outer coinductive definition) and Fixpoint (for the inner inductive scan). The paper shows that the transformed, delay‑free resumptions are weakly bisimilar to the original ones, and that the transformation preserves the big‑step semantics for all terminating and convergent programs.

The third semantics adds a “silent divergence” option to the delay‑free resumptions. Here the authors distinguish between two kinds of non‑terminating behaviour: (i) infinite internal delay without ever producing I/O (which is considered benign divergence) and (ii) genuine divergence where the program loops forever without any observable action. To make this distinction constructive, they introduce a decision predicate that determines, for a given resumption, whether it will eventually converge to an I/O action or diverge silently. When the predicate yields a positive answer, the resumption is equipped with an explicit divergence constructor. This enriched semantics coincides with the basic semantics under classical logic (because classical reasoning can decide convergence vs. divergence), but it is strictly stronger constructively, as it requires an explicit witness of convergence.

All three semantics, together with the weak bisimilarity relation, are fully formalized in Coq. The development includes: (1) the definition of the resumption datatype and its constructors; (2) the inductive definition of weak bisimilarity and proofs of reflexivity, symmetry, and transitivity; (3) the three big‑step evaluation relations (basic, delay‑free, and delay‑free with silent divergence); (4) the transformation functions between them; and (5) a suite of lemmas establishing that the transformations preserve weak bisimilarity and that the three semantics are equivalent in the appropriate logical setting. The Coq scripts also demonstrate how to reason about mixed inductive‑coinductive definitions, a technique that can be reused for other languages with interactive effects.

In summary, the paper provides a rigorous, constructive account of interactive I/O for While, showing how resumptions can capture the interplay between computation and external communication, how weak bisimilarity abstracts away internal delays, and how one can systematically remove those delays while preserving observable behaviour. The work bridges the gap between operational semantics and mechanized proof, offering tools that are directly applicable to the verification of reactive, real‑time, or embedded systems where I/O responsiveness is a first‑class concern.


Comments & Academic Discussion

Loading comments...

Leave a Comment